13 May, 2010

1 commit


20 Apr, 2010

1 commit


21 Mar, 2010

1 commit


17 Mar, 2010

1 commit


13 Jan, 2010

1 commit


25 Aug, 2009

1 commit


03 Jun, 2009

2 commits

  • This patch removes the notify chain infrastructure and replace it
    by a simple function pointer. This issue has been mentioned in the
    mailing list several times: the use of the notify chain adds
    too much overhead for something that is only used by ctnetlink.

    This patch also changes nfnetlink_send(). It seems that gfp_any()
    returns GFP_KERNEL for user-context request, like those via
    ctnetlink, inside the RCU read-side section which is not valid.
    Using GFP_KERNEL is also evil since netlink may schedule(),
    this leads to "scheduling while atomic" bug reports.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     
  • This patch cleans up the message handling path in two aspects:

    * it uses NLMSG_LENGTH() instead of NLMSG_SPACE() like rtnetlink
    does in this case to check if there is enough room for the
    Netlink/nfnetlink headers. No need to check for the padding room.

    * it removes a redundant header size checking that has been
    already do at the beginning of the function.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

17 Apr, 2009

1 commit

  • With this patch, nfnetlink returns -ENOMEM instead of -EPERM if we
    fail to create the nfnetlink netlink socket during the module
    loading. This is exactly what rtnetlink does in this case.

    Ideally, it would be better if we propagate the error that has
    happened in netlink_kernel_create(), however, this function still
    does not implement this yet.

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Patrick McHardy

    Pablo Neira Ayuso
     

23 Mar, 2009

1 commit


17 Oct, 2008

1 commit


15 Oct, 2008

1 commit

  • This patch removes the module dependency between ctnetlink and
    nf_nat by means of an indirect call that is initialized when
    nf_nat is loaded. Now, nf_conntrack_netlink only requires
    nf_conntrack and nfnetlink.

    This patch puts nfnetlink_parse_nat_setup_hook into the
    nf_conntrack_core to avoid dependencies between ctnetlink,
    nf_conntrack_ipv4 and nf_conntrack_ipv6.

    This patch also introduces the function ctnetlink_change_nat
    that is only invoked from the creation path. Actually, the
    nat handling cannot be invoked from the update path since
    this is not allowed. By introducing this function, we remove
    the useless nat handling in the update path and we avoid
    deadlock-prone code.

    This patch also adds the required EAGAIN logic for nfnetlink.

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Pablo Neira Ayuso
     

29 Jan, 2008

1 commit


11 Oct, 2007

8 commits

  • This patch make processing netlink user -> kernel messages synchronious.
    This change was inspired by the talk with Alexey Kuznetsov about current
    netlink messages processing. He says that he was badly wrong when introduced
    asynchronious user -> kernel communication.

    The call netlink_unicast is the only path to send message to the kernel
    netlink socket. But, unfortunately, it is also used to send data to the
    user.

    Before this change the user message has been attached to the socket queue
    and sk->sk_data_ready was called. The process has been blocked until all
    pending messages were processed. The bad thing is that this processing
    may occur in the arbitrary process context.

    This patch changes nlk->data_ready callback to get 1 skb and force packet
    processing right in the netlink_unicast.

    Kernel -> user path in netlink_unicast remains untouched.

    EINTR processing for in netlink_run_queue was changed. It forces rtnl_lock
    drop, but the process remains in the cycle until the message will be fully
    processed. So, there is no need to use this kludges now.

    Signed-off-by: Denis V. Lunev
    Acked-by: Alexey Kuznetsov
    Signed-off-by: David S. Miller

    Denis V. Lunev
     
  • The code in netfilter/nfnetlink.c and in ./net/netlink/genetlink.c looks
    like outdated copy/paste from rtnetlink.c. Push them into sync with the
    original.

    Changes from v1:
    - deleted comment in nfnetlink_rcv_msg by request of Patrick McHardy

    Signed-off-by: Denis V. Lunev
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Denis V. Lunev
     
  • Add support for automatic checking of per-callback attribute policies.

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

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

    Patrick McHardy
     
  • Get rid of the duplicated rtnetlink macros and use the generic netlink
    attribute functions. The old duplicated stuff is moved to a new header
    file that exists just for userspace.

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

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

    Patrick McHardy
     
  • I was looking at Patrick's fix to inet_diag and it occured
    to me that we're using a pointer argument to return values
    unnecessarily in netlink_run_queue. Changing it to return
    the value will allow the compiler to generate better code
    since the value won't have to be memory-backed.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Each netlink socket will live in exactly one network namespace,
    this includes the controlling kernel sockets.

    This patch updates all of the existing netlink protocols
    to only support the initial network namespace. Request
    by clients in other namespaces will get -ECONREFUSED.
    As they would if the kernel did not have the support for
    that netlink protocol compiled in.

    As each netlink protocol is updated to be multiple network
    namespace safe it can register multiple kernel sockets
    to acquire a presence in the rest of the network namespaces.

    The implementation in af_netlink is a simple filter implementation
    at hash table insertion and hash table look up time.

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

    Eric W. Biederman
     

26 Apr, 2007

11 commits


01 Mar, 2007

1 commit

  • ctnetlink uses netlink_unicast from an atomic_notifier_chain
    (which is called within a RCU read side critical section)
    without holding further locks. netlink_unicast calls netlink_trim
    with the result of gfp_any() for the gfp flags, which are passed
    down to pskb_expand_header. gfp_any() only checks for softirq
    context and returns GFP_KERNEL, resulting in this warning:

    BUG: sleeping function called from invalid context at mm/slab.c:3032
    in_atomic():1, irqs_disabled():0
    no locks held by rmmod/7010.

    Call Trace:
    [] debug_show_held_locks+0x9/0xb
    [] __might_sleep+0xd9/0xdb
    [] __kmalloc+0x68/0x110
    [] pskb_expand_head+0x4d/0x13b
    [] netlink_broadcast+0xa5/0x2e0
    [] :nfnetlink:nfnetlink_send+0x83/0x8a
    [] :nf_conntrack_netlink:ctnetlink_conntrack_event+0x94c/0x96a
    [] notifier_call_chain+0x29/0x3e
    [] atomic_notifier_call_chain+0x32/0x60
    [] :nf_conntrack:destroy_conntrack+0xa5/0x1d3
    [] :nf_conntrack:nf_ct_cleanup+0x8c/0x12c
    [] :nf_conntrack:kill_l3proto+0x0/0x13
    [] :nf_conntrack:nf_conntrack_l3proto_unregister+0x90/0x94
    [] :nf_conntrack_ipv4:nf_conntrack_l3proto_ipv4_fini+0x2b/0x5d
    [] sys_delete_module+0x1b5/0x1e6
    [] trace_hardirqs_on_thunk+0x35/0x37
    [] system_call+0x7e/0x83

    Since netlink_unicast is supposed to be callable from within RCU
    read side critical sections, make gfp_any() check for in_atomic()
    instead of in_softirq().

    Additionally nfnetlink_send needs to use gfp_any() as well for the
    call to netlink_broadcast).

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

    Patrick McHardy
     

15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

13 Feb, 2007

1 commit


01 Jul, 2006

1 commit


30 Jun, 2006

1 commit

  • This patch encapsulates the usage of eff_cap (in netlink_skb_params) within
    the security framework by extending security_netlink_recv to include a required
    capability parameter and converting all direct usage of eff_caps outside
    of the lsm modules to use the interface. It also updates the SELinux
    implementation of the security_netlink_send and security_netlink_recv
    hooks to take advantage of the sid in the netlink_skb_params struct.
    This also enables SELinux to perform auditing of netlink capability checks.
    Please apply, for 2.6.18 if possible.

    Signed-off-by: Darrel Goeddel
    Signed-off-by: Stephen Smalley
    Acked-by: James Morris
    Signed-off-by: David S. Miller

    Darrel Goeddel
     

21 Mar, 2006

1 commit


15 Jan, 2006

1 commit


06 Dec, 2005

1 commit