linux/net/ipv4
Eric Dumazet b90e5794c5 net: dont call jump_label_dec from irq context
Igor Maravic reported an error caused by jump_label_dec() being called
from IRQ context :

 BUG: sleeping function called from invalid context at kernel/mutex.c:271
 in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper
 1 lock held by swapper/0:
  #0:  (&n->timer){+.-...}, at: [<ffffffff8107ce90>] call_timer_fn+0x0/0x340
 Pid: 0, comm: swapper Not tainted 3.2.0-rc2-net-next-mpls+ #1
Call Trace:
 <IRQ>  [<ffffffff8104f417>] __might_sleep+0x137/0x1f0
 [<ffffffff816b9a2f>] mutex_lock_nested+0x2f/0x370
 [<ffffffff810a89fd>] ? trace_hardirqs_off+0xd/0x10
 [<ffffffff8109a37f>] ? local_clock+0x6f/0x80
 [<ffffffff810a90a5>] ? lock_release_holdtime.part.22+0x15/0x1a0
 [<ffffffff81557929>] ? sock_def_write_space+0x59/0x160
 [<ffffffff815e936e>] ? arp_error_report+0x3e/0x90
 [<ffffffff810969cd>] atomic_dec_and_mutex_lock+0x5d/0x80
 [<ffffffff8112fc1d>] jump_label_dec+0x1d/0x50
 [<ffffffff81566525>] net_disable_timestamp+0x15/0x20
 [<ffffffff81557a75>] sock_disable_timestamp+0x45/0x50
 [<ffffffff81557b00>] __sk_free+0x80/0x200
 [<ffffffff815578d0>] ? sk_send_sigurg+0x70/0x70
 [<ffffffff815e936e>] ? arp_error_report+0x3e/0x90
 [<ffffffff81557cba>] sock_wfree+0x3a/0x70
 [<ffffffff8155c2b0>] skb_release_head_state+0x70/0x120
 [<ffffffff8155c0b6>] __kfree_skb+0x16/0x30
 [<ffffffff8155c119>] kfree_skb+0x49/0x170
 [<ffffffff815e936e>] arp_error_report+0x3e/0x90
 [<ffffffff81575bd9>] neigh_invalidate+0x89/0xc0
 [<ffffffff81578dbe>] neigh_timer_handler+0x9e/0x2a0
 [<ffffffff81578d20>] ? neigh_update+0x640/0x640
 [<ffffffff81073558>] __do_softirq+0xc8/0x3a0

Since jump_label_{inc|dec} must be called from process context only,
we must defer jump_label_dec() if net_disable_timestamp() is called
from interrupt context.

Reported-by: Igor Maravic <igorm@etf.rs>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-29 00:26:25 -05:00
..
netfilter net: dont call jump_label_dec from irq context 2011-11-29 00:26:25 -05:00
af_inet.c net: introduce and use netdev_features_t for device features sets 2011-11-16 17:43:10 -05:00
ah4.c ah: Don't return NET_XMIT_DROP on input. 2011-11-12 18:13:32 -05:00
arp.c ipv4: Remove all uses of LL_ALLOCATED_SPACE 2011-11-18 14:37:08 -05:00
cipso_ipv4.c
datagram.c
devinet.c
esp4.c
fib_frontend.c
fib_lookup.h
fib_rules.c
fib_semantics.c
fib_trie.c
gre.c
icmp.c
igmp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2011-11-26 14:47:03 -05:00
inet_connection_sock.c net: rename sk_clone to sk_clone_lock 2011-11-08 17:07:07 -05:00
inet_diag.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2011-11-26 14:47:03 -05:00
inet_fragment.c
inet_hashtables.c
inet_lro.c
inet_timewait_sock.c
inetpeer.c
ip_forward.c ipv4: Save nexthop address of LSRR/SSRR option to IPCB. 2011-11-23 19:19:32 -05:00
ip_fragment.c
ip_gre.c ip_gre: Set needed_headroom dynamically again 2011-11-18 14:37:10 -05:00
ip_input.c
ip_options.c ipv4: Save nexthop address of LSRR/SSRR option to IPCB. 2011-11-23 19:19:32 -05:00
ip_output.c
ip_sockglue.c ipv4: PKTINFO doesnt need dst reference 2011-11-09 16:36:27 -05:00
ipcomp.c
ipconfig.c ipv4: Remove all uses of LL_ALLOCATED_SPACE 2011-11-18 14:37:08 -05:00
ipip.c net: better pcpu data alignment 2011-11-08 15:10:59 -05:00
ipmr.c
Kconfig
Makefile
netfilter.c
ping.c ping: dont increment ICMP_MIB_INERRORS 2011-11-18 14:38:59 -05:00
proc.c ipv4: reduce percpu needs for icmpmsg mibs 2011-11-09 16:04:20 -05:00
protocol.c
raw.c ipv4: Remove all uses of LL_ALLOCATED_SPACE 2011-11-18 14:37:08 -05:00
route.c ipv4: Don't use the cached pmtu informations for input routes 2011-11-26 14:29:52 -05:00
syncookies.c
sysctl_net_ipv4.c
tcp_bic.c
tcp_cong.c
tcp_cubic.c
tcp_diag.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: skip cwnd moderation in TCP_CA_Open in tcp_try_to_open 2011-11-27 18:54:09 -05:00
tcp_ipv4.c tcp: clear xmit timers in tcp_v4_syn_recv_sock() 2011-11-16 16:57:45 -05:00
tcp_lp.c
tcp_minisocks.c net: remove ipv6_addr_copy() 2011-11-22 16:43:32 -05:00
tcp_output.c
tcp_probe.c
tcp_scalable.c
tcp_timer.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tcp.c tcp: tcp_sendmsg() wrong access to sk_route_caps 2011-11-28 18:58:24 -05:00
tunnel4.c
udp_impl.h
udp.c net: introduce and use netdev_features_t for device features sets 2011-11-16 17:43:10 -05:00
udplite.c
xfrm4_input.c
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c
xfrm4_state.c
xfrm4_tunnel.c