linux/net/netfilter
Patrick McHardy 4498121ca3 [NET]: Handle disabled preemption in gfp_any()
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:
 [<ffffffff8109467f>] debug_show_held_locks+0x9/0xb
 [<ffffffff8100b0b4>] __might_sleep+0xd9/0xdb
 [<ffffffff810b5082>] __kmalloc+0x68/0x110
 [<ffffffff811ba8f2>] pskb_expand_head+0x4d/0x13b
 [<ffffffff81053147>] netlink_broadcast+0xa5/0x2e0
 [<ffffffff881cd1d7>] :nfnetlink:nfnetlink_send+0x83/0x8a
 [<ffffffff8834f6a6>] :nf_conntrack_netlink:ctnetlink_conntrack_event+0x94c/0x96a
 [<ffffffff810624d6>] notifier_call_chain+0x29/0x3e
 [<ffffffff8106251d>] atomic_notifier_call_chain+0x32/0x60
 [<ffffffff881d266d>] :nf_conntrack:destroy_conntrack+0xa5/0x1d3
 [<ffffffff881d194e>] :nf_conntrack:nf_ct_cleanup+0x8c/0x12c
 [<ffffffff881d4614>] :nf_conntrack:kill_l3proto+0x0/0x13
 [<ffffffff881d482a>] :nf_conntrack:nf_conntrack_l3proto_unregister+0x90/0x94
 [<ffffffff883551b3>] :nf_conntrack_ipv4:nf_conntrack_l3proto_ipv4_fini+0x2b/0x5d
 [<ffffffff8109d44f>] sys_delete_module+0x1b5/0x1e6
 [<ffffffff8105f245>] trace_hardirqs_on_thunk+0x35/0x37
 [<ffffffff8105911e>] 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 <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-02-28 09:42:13 -08:00
..
Kconfig [NETFILTER]: Kconfig: improve dependency handling 2007-02-12 11:15:02 -08:00
Makefile [NETFILTER]: add IPv6-capable TCPMSS target 2007-02-08 12:39:16 -08:00
core.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_amanda.c [NETFILTER]: nf_conntrack: fix header inclusions for helpers 2006-12-02 22:12:54 -08:00
nf_conntrack_core.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_ecache.c [NETFILTER]: nf_conntrack: fix header inclusions for helpers 2006-12-02 22:12:54 -08:00
nf_conntrack_expect.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_ftp.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_h323_asn1.c
nf_conntrack_h323_main.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_h323_types.c
nf_conntrack_helper.c
nf_conntrack_irc.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_l3proto_generic.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_netbios_ns.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_netlink.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_pptp.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_proto.c [NETFILTER]: nf_conntrack: change nf_conntrack_l[34]proto_unregister to void 2007-02-12 11:14:28 -08:00
nf_conntrack_proto_generic.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
nf_conntrack_proto_gre.c
nf_conntrack_proto_sctp.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
nf_conntrack_proto_tcp.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
nf_conntrack_proto_udp.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
nf_conntrack_sane.c [NETFILTER]: Add SANE connection tracking helper 2007-02-08 12:39:09 -08:00
nf_conntrack_sip.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_conntrack_standalone.c [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
nf_conntrack_tftp.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_internals.h [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_log.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_queue.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_sockopt.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nf_sysctl.c [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
nfnetlink.c [NET]: Handle disabled preemption in gfp_any() 2007-02-28 09:42:13 -08:00
nfnetlink_log.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
nfnetlink_queue.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
x_tables.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_CLASSIFY.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_CONNMARK.c [NETFILTER]: Remove useless comparisons before assignments 2007-02-08 12:39:11 -08:00
xt_CONNSECMARK.c [NETFILTER]: Remove useless comparisons before assignments 2007-02-08 12:39:11 -08:00
xt_DSCP.c
xt_MARK.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_NFLOG.c
xt_NFQUEUE.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_NOTRACK.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_SECMARK.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_TCPMSS.c [NETFILTER]: add IPv6-capable TCPMSS target 2007-02-08 12:39:16 -08:00
xt_comment.c
xt_connbytes.c [NETFILTER]: xt_connbytes: fix division by zero 2007-01-30 14:24:29 -08:00
xt_connmark.c [NETFILTER]: x_tables: error if ip_conntrack is asked to handle IPv6 packets 2006-12-13 16:48:20 -08:00
xt_conntrack.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_dccp.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_dscp.c
xt_esp.c
xt_hashlimit.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_helper.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_length.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_limit.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_mac.c [NETFILTER]: xt_mac/xt_CLASSIFY: use IPv6 hook names for IPv6 registration 2007-02-12 11:14:43 -08:00
xt_mark.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_multiport.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_physdev.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_pkttype.c
xt_policy.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_quota.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_realm.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_sctp.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_state.c [NETFILTER]: x_tables: error if ip_conntrack is asked to handle IPv6 packets 2006-12-13 16:48:20 -08:00
xt_statistic.c
xt_string.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_tcpmss.c [NETFILTER]: Fix whitespace errors 2007-02-12 11:15:49 -08:00
xt_tcpudp.c