25 Jul, 2007

3 commits


19 Jul, 2007

3 commits


18 Jul, 2007

1 commit

  • Reading netlink_setsockopt it's not immediately clear why there isn't a
    bug when you pass in negative numbers, the reason being that the >=
    comparison is really unsigned although 'val' is signed because
    nlk->ngroups is unsigned. Make 'val' unsigned too.

    [ Update the get_user() cast to match. --DaveM ]

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

11 Jul, 2007

2 commits


08 Jun, 2007

1 commit


09 May, 2007

1 commit


05 May, 2007

1 commit

  • Remove bogus BUG_ON(mutex_is_locked(nlk_sk(sk)->cb_mutex)), when the
    netlink_kernel_create caller specifies an external mutex it might
    validly be locked.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

03 May, 2007

2 commits


26 Apr, 2007

15 commits

  • - make the following needlessly global variables static:
    - core/rtnetlink.c: struct rtnl_msg_handlers[]
    - netfilter/nf_conntrack_proto.c: struct nf_ct_protos[]
    - make the following needlessly global functions static:
    - core/rtnetlink.c: rtnl_dump_all()
    - netlink/af_netlink.c: netlink_queue_skip()

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • Don't reinitialize the callback mutex the netlink_kernel_create caller
    handed in, it is supposed to already be initialized and could already
    be held by someone.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Switch cb_lock to mutex and allow netlink kernel users to override it
    with a subsystem specific mutex for consistent locking in dump callbacks.
    All netlink_dump_start users have been audited not to rely on any
    side-effects of the previously used spinlock.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • This patch introduces a new NLA_BINARY attribute policy type with the
    verification of simply checking the maximum length of the payload.

    It also fixes a small typo in the example.

    Signed-off-by: Johannes Berg
    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • Now that all users of netlink_dump_start() use netlink_run_queue()
    to process the receive queue, it is possible to return -EINTR from
    netlink_dump_start() directly, therefore simplying the callers.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • The error pointer argument in netlink message handlers is used
    to signal the special case where processing has to be interrupted
    because a dump was started but no error happened. Instead it is
    simpler and more clear to return -EINTR and have netlink_run_queue()
    deal with getting the queue right.

    nfnetlink passed on this error pointer to its subsystem handlers
    but only uses it to signal the start of a netlink dump. Therefore
    it can be removed there as well.

    This patch also cleans up the error handling in the affected
    message handlers to be consistent since it had to be touched anyway.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Changes netlink_rcv_skb() to skip netlink controll messages and don't
    pass them on to the message handler.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • netlink_rcv_skb() is changed to skip messages which don't have the
    NLM_F_REQUEST bit to avoid every netlink family having to perform this
    check on their own.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Leftover from dynamic multicast groups allocation work.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • For the common "(struct nlmsghdr *)skb->data" sequence, so that we reduce the
    number of direct accesses to skb->data and for consistency with all the other
    cast skb member helpers.

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

    Arnaldo Carvalho de Melo
     
  • Now to convert the last one, skb->data, that will allow many simplifications
    and removal of some of the offset helpers.

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

    Arnaldo Carvalho de Melo
     
  • So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes
    on 64bit architectures, allowing us to combine the 4 bytes hole left by the
    layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4
    64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN...
    :-)

    Many calculations that previously required that skb->{transport,network,
    mac}_header be first converted to a pointer now can be done directly, being
    meaningful as offsets or pointers.

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

    Arnaldo Carvalho de Melo
     
  • For the common, open coded 'skb->h.raw = skb->data' operation, so that we can
    later turn skb->h.raw into a offset, reducing the size of struct sk_buff in
    64bit land while possibly keeping it as a pointer on 32bit.

    This one touches just the most simple cases:

    skb->h.raw = skb->data;
    skb->h.raw = {skb_push|[__]skb_pull}()

    The next ones will handle the slightly more "complex" cases.

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

    Arnaldo Carvalho de Melo
     
  • This patch removes the following not or no longer used exports:
    - drivers/char/random.c: secure_tcp_sequence_number
    - net/dccp/options.c: sysctl_dccp_feat_sequence_window
    - net/netlink/af_netlink.c: netlink_set_err

    Signed-off-by: Adrian Bunk
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • If the user passes MSG_TRUNC in via msg_flags, return
    the full packet size not the truncated size.

    Idea from Herbert Xu and Thomas Graf.

    Signed-off-by: David S. Miller

    David S. Miller
     

19 Apr, 2007

1 commit

  • There is a race between netlink_dump_start() and netlink_release()
    that can lead to the situation when a netlink socket with non-zero
    callback is freed.

    Here it is:

    CPU1: CPU2
    netlink_release(): netlink_dump_start():

    sk = netlink_lookup(); /* OK */

    netlink_remove();

    spin_lock(&nlk->cb_lock);
    if (nlk->cb) { /* false */
    ...
    }
    spin_unlock(&nlk->cb_lock);

    spin_lock(&nlk->cb_lock);
    if (nlk->cb) { /* false */
    ...
    }
    nlk->cb = cb;
    spin_unlock(&nlk->cb_lock);
    ...
    sock_orphan(sk);
    /*
    * proceed with releasing
    * the socket
    */

    The proposal it to make sock_orphan before detaching the callback
    in netlink_release() and to check for the sock to be SOCK_DEAD in
    netlink_dump_start() before setting a new callback.

    Signed-off-by: Denis Lunev
    Signed-off-by: Kirill Korotaev
    Signed-off-by: Pavel Emelianov
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Denis Lunev
     

13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

11 Feb, 2007

1 commit


04 Jan, 2007

1 commit


09 Dec, 2006

1 commit


07 Dec, 2006

2 commits


03 Dec, 2006

4 commits