31 Oct, 2014

2 commits


15 May, 2014

1 commit

  • Fengguang reported the following sparse warning:

    >> net/ipv6/proc.c:198:41: sparse: incorrect type in argument 1 (different address spaces)
    net/ipv6/proc.c:198:41: expected void [noderef] *mib
    net/ipv6/proc.c:198:41: got void [noderef] **pcpumib

    Fixes: commit 698365fa1874aa7635d51667a3 (net: clean up snmp stats code)
    Reported-by: Fengguang Wu
    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    WANG Cong
     

22 Jan, 2014

1 commit


27 Dec, 2013

1 commit


07 Dec, 2013

1 commit

  • Several files refer to an old address for the Free Software Foundation
    in the file header comment. Resolve by replacing the address with
    the URL so that we do not have to keep
    updating the header comments anytime the address changes.

    CC: Vlad Yasevich
    CC: Neil Horman
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Jeff Kirsher
     

16 Aug, 2013

1 commit


10 Aug, 2013

1 commit

  • With the restructuring of the lksctp.org site, we only allow bug
    reports through the SCTP mailing list linux-sctp@vger.kernel.org,
    not via SF, as SF is only used for web hosting and nothing more.
    While at it, also remove the obvious statement that bugs will be
    fixed and incooperated into the kernel.

    Signed-off-by: Daniel Borkmann
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

25 Jul, 2013

1 commit

  • The SCTP mailing list address to send patches or questions
    to is linux-sctp@vger.kernel.org and not
    lksctp-developers@lists.sourceforge.net anymore. Therefore,
    update all occurences.

    Signed-off-by: Daniel Borkmann
    Acked-by: Neil Horman
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

26 Jun, 2013

1 commit


15 Jun, 2013

1 commit

  • This clearly states a BUG somewhere in the SCTP code as e.g. fixed once
    in f28156335 ("sctp: Use correct sideffect command in duplicate cookie
    handling"). If this ever happens, throw a trace in the sideeffect engine
    where assocs clearly must have a primary_path assigned.

    When in sctp_seq_dump_local_addrs() also throw a WARN and bail out since
    we do not need to panic for printing this one asterisk. Also, it will
    avoid the not so obvious case when primary != NULL test passes and at a
    later point in time triggering a NULL ptr dereference caused by primary.
    While at it, also fix up the white space.

    Signed-off-by: Daniel Borkmann
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

17 Apr, 2013

1 commit

  • sctp: Add buffer utilization fields to /proc/net/sctp/assocs

    This patch adds the following fields to /proc/net/sctp/assocs output:

    - sk->sk_wmem_alloc as "wmema" (transmit queue bytes committed)
    - sk->sk_wmem_queued as "wmemq" (persistent queue size)
    - sk->sk_sndbuf as "sndbuf" (size of send buffer in bytes)
    - sk->sk_rcvbuf as "rcvbuf" (size of receive buffer in bytes)

    When small DATA chunks containing 136 bytes data are sent the TX_QUEUE
    (assoc->sndbuf_used) reaches a maximum of 40.9% of sk_sndbuf value when
    peer.rwnd = 0. This was diagnosed from sk_wmem_alloc value reaching maximum
    value of sk_sndbuf.

    TX_QUEUE (assoc->sndbuf_used), sk_wmem_alloc and sk_wmem_queued values are
    incremented in sctp_set_owner_w() for outgoing data chunks. Having access to
    the above values in /proc/net/sctp/assocs will provide a better understanding
    of SCTP buffer management.

    With patch applied, example output when peer.rwnd = 0

    where:
    ASSOC ffff880132298000 is sender
    ffff880125343000 is receiver

    ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE \
    ffff880132298000 ffff880124a0a0c0 2 1 3 29325 1 214656 0 \
    ffff880125343000 ffff8801237d7700 2 1 3 36210 2 0 524520 \

    UID INODE LPORT RPORT LADDRS RADDRS HBINT INS OUTS \
    0 25108 3455 3456 *10.4.8.3 *10.5.8.3 7500 2 2 \
    0 27819 3456 3455 *10.5.8.3 *10.4.8.3 7500 2 2 \

    MAXRT T1X T2X RTXC wmema wmemq sndbuf rcvbuf
    4 0 0 72 525633 440320 524288 524288
    4 0 0 0 1 0 524288 524288

    Signed-off-by: Dilip Daya
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Dilip Daya
     

28 Feb, 2013

1 commit

  • I'm not sure why, but the hlist for each entry iterators were conceived

    list_for_each_entry(pos, head, member)

    The hlist ones were greedy and wanted an extra parameter:

    hlist_for_each_entry(tpos, pos, head, member)

    Why did they need an extra pos parameter? I'm not quite sure. Not only
    they don't really need it, it also prevents the iterator from looking
    exactly like the list iterator, which is unfortunate.

    Besides the semantic patch, there was some manual work required:

    - Fix up the actual hlist iterators in linux/list.h
    - Fix up the declaration of other iterators based on the hlist ones.
    - A very small amount of places were using the 'node' parameter, this
    was modified to use 'obj->member' instead.
    - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
    properly, so those had to be fixed up manually.

    The semantic patch which is mostly the work of Peter Senna Tschudin is here:

    @@
    iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

    type T;
    expression a,c,d,e;
    identifier b;
    statement S;
    @@

    -T b;

    [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
    [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
    [akpm@linux-foundation.org: checkpatch fixes]
    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foudnation.org: redo intrusive kvm changes]
    Tested-by: Peter Senna Tschudin
    Acked-by: Paul E. McKenney
    Signed-off-by: Sasha Levin
    Cc: Wu Fengguang
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

08 Dec, 2012

2 commits

  • peer.transport_addr_list is currently only protected by sk_sock
    which is inpractical to acquire for procfs dumping purposes.

    This patch adds RCU protection allowing for the procfs readers to
    enter RCU read-side critical sections.

    Modification of the list continues to be serialized via sk_lock.

    V2: Use list_del_rcu() in sctp_association_free() to be safe
    Skip transports marked dead when dumping for procfs

    Cc: Vlad Yasevich
    Cc: Neil Horman
    Signed-off-by: Thomas Graf
    Acked-by: Vlad Yasevich
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • address_list is protected via the socket lock or RCU. Since we don't want
    to take the socket lock for each assoc we dump in procfs a RCU read-side
    critical section must be entered.

    V2: Skip local addresses marked as dead

    Cc: Vlad Yasevich
    Cc: Neil Horman
    Signed-off-by: Thomas Graf
    Acked-by: Vlad Yasevich
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Thomas Graf
     

16 Nov, 2012

1 commit

  • Commit 13d782f ("sctp: Make the proc files per network namespace.")
    changed the /proc/net/sctp/ struct file_operations opener functions to
    use single_open_net() and seq_open_net().

    Avoid leaking memory by using single_release_net() and seq_release_net()
    as the release functions.

    Discovered with Trinity (the syscall fuzzer).

    Signed-off-by: Tommi Rantala
    Acked-by: Neil Horman
    Cc: "Eric W. Biederman"
    Signed-off-by: David S. Miller

    Tommi Rantala
     

25 Aug, 2012

1 commit


17 Aug, 2012

1 commit


15 Aug, 2012

3 commits


01 Nov, 2011

1 commit


24 May, 2011

1 commit

  • The %pK format specifier is designed to hide exposed kernel pointers,
    specifically via /proc interfaces. Exposing these pointers provides an
    easy target for kernel write vulnerabilities, since they reveal the
    locations of writable structures containing easily triggerable function
    pointers. The behavior of %pK depends on the kptr_restrict sysctl.

    If kptr_restrict is set to 0, no deviation from the standard %p behavior
    occurs. If kptr_restrict is set to 1, the default, if the current user
    (intended to be a reader via seq_printf(), etc.) does not have CAP_SYSLOG
    (currently in the LSM tree), kernel pointers using %pK are printed as 0's.
    If kptr_restrict is set to 2, kernel pointers using %pK are printed as
    0's regardless of privileges. Replacing with 0's was chosen over the
    default "(null)", which cannot be parsed by userland %p, which expects
    "(nil)".

    The supporting code for kptr_restrict and %pK are currently in the -mm
    tree. This patch converts users of %p in net/ to %pK. Cases of printing
    pointers to the syslog are not covered, since this would eliminate useful
    information for postmortem debugging and the reading of the syslog is
    already optionally protected by the dmesg_restrict sysctl.

    Signed-off-by: Dan Rosenberg
    Cc: James Morris
    Cc: Eric Dumazet
    Cc: Thomas Graf
    Cc: Eugene Teo
    Cc: Kees Cook
    Cc: Ingo Molnar
    Cc: David S. Miller
    Cc: Peter Zijlstra
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Dan Rosenberg
     

18 May, 2010

1 commit

  • This patch removes from net/ (but not any netfilter files)
    all the unnecessary return; statements that precede the
    last closing brace of void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

17 Feb, 2010

1 commit

  • Add __percpu sparse annotations to net.

    These annotations are to make sparse consider percpu variables to be
    in a different address space and warn if accessed without going
    through percpu accessors. This patch doesn't affect normal builds.

    The macro and type tricks around snmp stats make things a bit
    interesting. DEFINE/DECLARE_SNMP_STAT() macros mark the target field
    as __percpu and SNMP_UPD_PO_STATS() macro is updated accordingly. All
    snmp_mib_*() users which used to cast the argument to (void **) are
    updated to cast it to (void __percpu **).

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Cc: Patrick McHardy
    Cc: Arnaldo Carvalho de Melo
    Cc: Vlad Yasevich
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Tejun Heo
     

23 Jan, 2010

1 commit


05 Sep, 2009

1 commit


23 Jul, 2008

1 commit

  • Commit 20c2c1fd6c842caf70dcb1d94b9d58861949fd3d
    (sctp: add sctp/remaddr table to complete RFC remote address table OID)
    added an unused sctp_assoc_proc_exit() function that seems to have been
    unintentionally created when copying the assocs code.

    Signed-off-by: Adrian Bunk
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Adrian Bunk
     

10 May, 2008

1 commit

  • Add support for RFC3873 remote address table OID.

    +--(5) sctpAssocRemAddrTable
    | |
    | |--(-) sctpAssocId (shared index)
    | |
    | +--(1) sctpAssocRemAddrType (index)
    . |
    . +--(2) sctpAssocRemAddr (index)
    . |
    +--(3) sctpAssocRemAddrActive
    |
    +--(4) sctpAssocRemAddrHBActive
    |
    +--(5) sctpAssocRemAddrRTO
    |
    +--(6) sctpAssocRemAddrMaxPathRtx
    |
    +--(7) sctpAssocRemAddrRtx
    |
    +--(8) sctpAssocRemAddrStartTime

    This patch places all the requsite data in /proc/net/sctp/remaddr.

    Signed-off-by: Neil Horman
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Neil Horman
     

13 Apr, 2008

2 commits

  • Replacing (almost) all invocations of list_for_each() with
    list_for_each_entry() tightens up the code and allows for the deletion
    of numerous list iterator variables that are no longer necessary.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Robert P. J. Day
     
  • Recently I posted a patch to add some informational items to
    /proc/net/sctp/assocs. All the information is correct, but because
    of how the seqfile show operation is laid out, some of the formatting
    is backwards. This patch corrects that formatting, so that the new
    information appears at the end of each line, rather than in the middle.

    Signed-off-by: Neil Horman
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Neil Horman
     

06 Mar, 2008

1 commit


04 Mar, 2008

1 commit


01 Mar, 2008

2 commits


29 Feb, 2008

1 commit


10 Feb, 2008

1 commit


05 Feb, 2008

1 commit

  • I was notified by Randy Stewart that lksctp claims to be
    "the reference implementation". First of all, "the
    refrence implementation" was the original implementation
    of SCTP in usersapce written ty Randy and a few others.
    Second, after looking at the definiton of 'reference implementation',
    we don't really meet the requirements.

    Signed-off-by: Vlad Yasevich

    Vlad Yasevich
     

10 Nov, 2007

1 commit


11 Jul, 2007

1 commit