14 Apr, 2011

1 commit


28 Mar, 2011

1 commit

  • Define some constant offsets for CALL_REQUEST based on the description
    at and the
    definition of ROSE as using 10-digit (5-byte) addresses. Use them
    consistently. Validate all implicit and explicit facilities lengths.
    Validate the address length byte rather than either trusting or
    assuming its value.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

15 Feb, 2011

1 commit

  • With previous patch, rose_get_neigh() routine
    investigates the full list of neighbor nodes
    until it finds or not an already connected node whether
    it is called locally or through a level 3 transit frame.
    If no routes are opened through an adjacent connected node
    then a classical connect request is attempted.

    Then there is no more reason for an extra loop such
    as the one removed by this patch.

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     

21 Sep, 2010

1 commit


21 Apr, 2010

1 commit

  • Define a new function to return the waitqueue of a "struct sock".

    static inline wait_queue_head_t *sk_sleep(struct sock *sk)
    {
    return sk->sk_sleep;
    }

    Change all read occurrences of sk_sleep by a call to this function.

    Needed for a future RCU conversion. sk_sleep wont be a field directly
    available.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

11 Feb, 2010

1 commit


26 Nov, 2009

1 commit

  • Generated with the following semantic patch

    @@
    struct net *n1;
    struct net *n2;
    @@
    - n1 == n2
    + net_eq(n1, n2)

    @@
    struct net *n1;
    struct net *n2;
    @@
    - n1 != n2
    + !net_eq(n1, n2)

    applied over {include,net,drivers/net}.

    Signed-off-by: Octavian Purdila
    Signed-off-by: David S. Miller

    Octavian Purdila
     

06 Nov, 2009

1 commit

  • The generic __sock_create function has a kern argument which allows the
    security system to make decisions based on if a socket is being created by
    the kernel or by userspace. This patch passes that flag to the
    net_proto_family specific create function, so it can do the same thing.

    Signed-off-by: Eric Paris
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Eric Paris
     

07 Oct, 2009

1 commit


01 Oct, 2009

1 commit

  • This provides safety against negative optlen at the type
    level instead of depending upon (sometimes non-trivial)
    checks against this sprinkled all over the the place, in
    each and every implementation.

    Based upon work done by Arjan van de Ven and feedback
    from Linus Torvalds.

    Signed-off-by: David S. Miller

    David S. Miller
     

15 Sep, 2009

1 commit


07 Aug, 2009

1 commit


27 Jul, 2009

1 commit

  • The use of a static buffer in rose2asc() to return its result is not
    threadproof and can result in corruption if multiple threads are trying
    to use one of the procfs files based on rose2asc().

    Signed-off-by: Ralf Baechle
    Signed-off-by: David S. Miller

    Ralf Baechle
     

18 Jun, 2009

1 commit

  • commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
    (net: No more expensive sock_hold()/sock_put() on each tx)
    changed initial sk_wmem_alloc value.

    We need to take into account this offset when reporting
    sk_wmem_alloc to user, in PROC_FS files or various
    ioctls (SIOCOUTQ/TIOCOUTQ)

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

17 Jun, 2009

1 commit

  • commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
    (net: No more expensive sock_hold()/sock_put() on each tx)
    changed initial sk_wmem_alloc value.

    Some protocols check sk_wmem_alloc value to determine if a timer
    must delay socket deallocation. We must take care of the sk_wmem_alloc
    value being one instead of zero when no write allocations are pending.

    Reported by Ingo Molnar, and full diagnostic from David Miller.

    This patch introduces three helpers to get read/write allocations
    and a followup patch will use these helpers to report correct
    write allocations to user.

    Reported-by: Ingo Molnar
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

15 Apr, 2009

1 commit


27 Mar, 2009

1 commit


22 Jan, 2009

1 commit


04 Dec, 2008

1 commit


25 Nov, 2008

1 commit

  • Since changeset e79ad711a0108475c1b3a03815527e7237020b08 from mainline,
    >From David S. Miller,
    empty packet can be transmitted on connected socket for datagram protocols.

    However, this patch broke a high level application using ROSE network protocol with connected datagram.

    Bulletin Board Stations perform bulletins forwarding between BBS stations via ROSE network using a forward protocol.
    Now, if for some reason, a buffer in the application software happens to be empty at a specific moment,
    ROSE sends an empty packet via unfiltered packet socket.
    When received, this ROSE packet introduces perturbations of data exchange of BBS forwarding,
    for the application message forwarding protocol is waiting for something else.
    We agree that a more careful programming of the application protocol would avoid this situation and we are
    willing to debug it.
    But, as an empty frame is no use and does not have any meaning for ROSE protocol,
    we may consider filtering zero length data both when sending and receiving socket data.

    The proposed patch repaired BBS data exchange through ROSE network that were broken since 2.6.22.11 kernel.

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     

14 Nov, 2008

1 commit

  • Wrap access to task credentials so that they can be separated more easily from
    the task_struct during the introduction of COW creds.

    Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

    Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
    sense to use RCU directly rather than a convenient wrapper; these will be
    addressed by later patches.

    Signed-off-by: David Howells
    Reviewed-by: James Morris
    Acked-by: Serge Hallyn
    Acked-by: Ralf Baechle
    Cc: linux-hams@vger.kernel.org
    Signed-off-by: James Morris

    David Howells
     

23 Jul, 2008

1 commit


20 Jul, 2008

1 commit


18 Jul, 2008

1 commit

  • alloc_netdev_mq() now allocates an array of netdev_queue
    structures for TX, based upon the queue_count argument.

    Furthermore, all accesses to the TX queues are now vectored
    through the netdev_get_tx_queue() and netdev_for_each_tx_queue()
    interfaces. This makes it easy to grep the tree for all
    things that want to get to a TX queue of a net device.

    Problem spots which are not really multiqueue aware yet, and
    only work with one queue, can easily be spotted by grepping
    for all netdev_get_tx_queue() calls that pass in a zero index.

    Signed-off-by: David S. Miller

    David S. Miller
     

09 Jul, 2008

1 commit


18 Jun, 2008

1 commit

  • ROSE network is organized through nodes connected via hamradio or Internet.
    AX25 packet radio frames sent to a remote ROSE address destination are routed
    through these nodes.

    Without the present patch, automatic routing mechanism did not work optimally
    due to an improper parameter checking.

    rose_get_neigh() function is called either by rose_connect() or by
    rose_route_frame().

    In the case of a call from rose_connect(), f0 timer is checked to find if a connection
    is already pending. In that case it returns the address of the neighbour, or returns a NULL otherwise.

    When called by rose_route_frame() the purpose was to route a packet AX25 frame
    through an adjacent node given a destination rose address.
    However, in that case, t0 timer checked does not indicate if the adjacent node
    is actually connected even if the timer is not null. Thus, for each frame sent, the
    function often tried to start a new connexion even if the adjacent node was already connected.

    The patch adds a "new" parameter that is true when the function is called by
    rose route_frame().
    This instructs rose_get_neigh() to check node parameter "restarted".
    If restarted is true it means that the route to the destination address is opened via a neighbour
    node already connected.
    If "restarted" is false the function returns a NULL.
    In that case the calling function will initiate a new connection as before.

    This results in a fast routing of frames, from nodes to nodes, until
    destination is reached, as originaly specified by ROSE protocole.

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     

17 Jun, 2008

1 commit


20 Apr, 2008

1 commit

  • ================================================
    [ BUG: lock held when returning to user space! ]
    ------------------------------------------------
    xfbbd/3683 is leaving the kernel with locks still held!
    1 lock held by xfbbd/3683:
    #0: (sk_lock-AF_ROSE){--..}, at: [] rose_connect+0x73/0x420 [rose]

    INFO: task xfbbd:3683 blocked for more than 120 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    xfbbd D 00000246 0 3683 3669
    c6965ee0 00000092 c02c5c40 00000246 c0f6b5f0 c0f6b5c0 c0f6b5f0 c0f6b5c0
    c0f6b614 c6965f18 c024b74b ffffffff c06ba070 00000000 00000000 00000001
    c6ab07c0 c012d450 c0f6b634 c0f6b634 c7b5bf10 c0d6004c c7b5bf10 c6965f40
    Call Trace:
    [] lock_sock_nested+0x6b/0xd0
    [] ? autoremove_wake_function+0x0/0x40
    [] sock_fasync+0x41/0x150
    [] sock_close+0x19/0x40
    [] __fput+0xb4/0x170
    [] fput+0x18/0x20
    [] filp_close+0x3e/0x70
    [] sys_close+0x69/0xb0
    [] sysenter_past_esp+0x5f/0xa5
    =======================
    INFO: lockdep is turned off.

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     

03 Apr, 2008

1 commit


02 Apr, 2008

1 commit

  • rose_release() doesn't release sockets properly, e.g. it skips
    sock_orphan(), so OOPSes are triggered in sock_def_write_space(),
    which was observed especially while ROSE skbs were kfreed from
    ax25_frames_acked(). There is also sock_hold() and lock_sock() added -
    similarly to ax25_release(). Thanks to Bernard Pidoux for substantial
    help in debugging this problem.

    Signed-off-by: Jarek Poplawski
    Reported-and-tested-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Jarek Poplawski
     

26 Mar, 2008

2 commits


29 Jan, 2008

2 commits

  • CHECK net/rose/af_rose.c
    net/rose/af_rose.c:125:11: warning: expensive signed divide
    net/rose/af_rose.c:976:46: warning: expensive signed divide
    net/rose/af_rose.c:1379:13: warning: context imbalance in 'rose_info_start' - wrong count at exit
    net/rose/af_rose.c:1406:13: warning: context imbalance in 'rose_info_stop' - unexpected unlock
    CHECK net/rose/rose_in.c
    net/rose/rose_in.c:185:25: warning: expensive signed divide
    CHECK net/rose/rose_route.c
    net/rose/rose_route.c:997:46: warning: expensive signed divide
    net/rose/rose_route.c:1070:13: warning: context imbalance in 'rose_node_start' - wrong count at exit
    net/rose/rose_route.c:1093:13: warning: context imbalance in 'rose_node_stop' - unexpected unlock
    net/rose/rose_route.c:1146:13: warning: context imbalance in 'rose_neigh_start' - wrong count at exit
    net/rose/rose_route.c:1169:13: warning: context imbalance in 'rose_neigh_stop' - unexpected unlock
    net/rose/rose_route.c:1229:13: warning: context imbalance in 'rose_route_start' - wrong count at exit
    net/rose/rose_route.c:1252:13: warning: context imbalance in 'rose_route_stop' - unexpected unlock

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Many-many code in the kernel initialized the timer->function
    and timer->data together with calling init_timer(timer). There
    is already a helper for this. Use it for networking code.

    The patch is HUGE, but makes the code 130 lines shorter
    (98 insertions(+), 228 deletions(-)).

    Signed-off-by: Pavel Emelyanov
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

01 Nov, 2007

1 commit

  • Finally, the zero_it argument can be completely removed from
    the callers and from the function prototype.

    Besides, fix the checkpatch.pl warnings about using the
    assignments inside if-s.

    This patch is rather big, and it is a part of the previous one.
    I splitted it wishing to make the patches more readable. Hope
    this particular split helped.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

11 Oct, 2007

3 commits

  • Every user of the network device notifiers is either a protocol
    stack or a pseudo device. If a protocol stack that does not have
    support for multiple network namespaces receives an event for a
    device that is not in the initial network namespace it quite possibly
    can get confused and do the wrong thing.

    To avoid problems until all of the protocol stacks are converted
    this patch modifies all netdev event handlers to ignore events on
    devices that are not in the initial network namespace.

    As the rest of the code is made network namespace aware these
    checks can be removed.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • This patch passes in the namespace a new socket should be created in
    and has the socket code do the appropriate reference counting. By
    virtue of this all socket create methods are touched. In addition
    the socket create methods are modified so that they will fail if
    you attempt to create a socket in a non-default network namespace.

    Failing if we attempt to create a socket outside of the default
    network namespace ensures that as we incrementally make the network stack
    network namespace aware we will not export functionality that someone
    has not audited and made certain is network namespace safe.
    Allowing us to partially enable network namespaces before all of the
    exotic protocols are supported.

    Any protocol layers I have missed will fail to compile because I now
    pass an extra parameter into the socket creation code.

    [ Integrated AF_IUCV build fixes from Andrew Morton... -DaveM ]

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • This patch makes /proc/net per network namespace. It modifies the global
    variables proc_net and proc_net_stat to be per network namespace.
    The proc_net file helpers are modified to take a network namespace argument,
    and all of their callers are fixed to pass &init_net for that argument.
    This ensures that all of the /proc/net files are only visible and
    usable in the initial network namespace until the code behind them
    has been updated to be handle multiple network namespaces.

    Making /proc/net per namespace is necessary as at least some files
    in /proc/net depend upon the set of network devices which is per
    network namespace, and even more files in /proc/net have contents
    that are relevant to a single network namespace.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

19 Jul, 2007

1 commit