Eric Dumazet
cbbb5a252d
tcp: tcp_release_cb() should release socket ownership
[ Upstream commit c3f9b01849 ]
Lars Persson reported following deadlock :
-000 |M:0x0:0x802B6AF8(asm) <-- arch_spin_lock
-001 |tcp_v4_rcv(skb = 0x8BD527A0) <-- sk = 0x8BE6B2A0
-002 |ip_local_deliver_finish(skb = 0x8BD527A0)
-003 |__netif_receive_skb_core(skb = 0x8BD527A0, ?)
-004 |netif_receive_skb(skb = 0x8BD527A0)
-005 |elk_poll(napi = 0x8C770500, budget = 64)
-006 |net_rx_action(?)
-007 |__do_softirq()
-008 |do_softirq()
-009 |local_bh_enable()
-010 |tcp_rcv_established(sk = 0x8BE6B2A0, skb = 0x87D3A9E0, th = 0x814EBE14, ?)
-011 |tcp_v4_do_rcv(sk = 0x8BE6B2A0, skb = 0x87D3A9E0)
-012 |tcp_delack_timer_handler(sk = 0x8BE6B2A0)
-013 |tcp_release_cb(sk = 0x8BE6B2A0)
-014 |release_sock(sk = 0x8BE6B2A0)
-015 |tcp_sendmsg(?, sk = 0x8BE6B2A0, ?, ?)
-016 |sock_sendmsg(sock = 0x8518C4C0, msg = 0x87D8DAA8, size = 4096)
-017 |kernel_sendmsg(?, ?, ?, ?, size = 4096)
-018 |smb_send_kvec()
-019 |smb_send_rqst(server = 0x87C4D400, rqst = 0x87D8DBA0)
-020 |cifs_call_async()
-021 |cifs_async_writev(wdata = 0x87FD6580)
-022 |cifs_writepages(mapping = 0x852096E4, wbc = 0x87D8DC88)
-023 |__writeback_single_inode(inode = 0x852095D0, wbc = 0x87D8DC88)
-024 |writeback_sb_inodes(sb = 0x87D6D800, wb = 0x87E4A9C0, work = 0x87D8DD88)
-025 |__writeback_inodes_wb(wb = 0x87E4A9C0, work = 0x87D8DD88)
-026 |wb_writeback(wb = 0x87E4A9C0, work = 0x87D8DD88)
-027 |wb_do_writeback(wb = 0x87E4A9C0, force_wait = 0)
-028 |bdi_writeback_workfn(work = 0x87E4A9CC)
-029 |process_one_work(worker = 0x8B045880, work = 0x87E4A9CC)
-030 |worker_thread(__worker = 0x8B045880)
-031 |kthread(_create = 0x87CADD90)
-032 |ret_from_kernel_thread(asm)
Bug occurs because __tcp_checksum_complete_user() enables BH, assuming
it is running from softirq context.
Lars trace involved a NIC without RX checksum support but other points
are problematic as well, like the prequeue stuff.
Problem is triggered by a timer, that found socket being owned by user.
tcp_release_cb() should call tcp_write_timer_handler() or
tcp_delack_timer_handler() in the appropriate context :
BH disabled and socket lock held, but 'owned' field cleared,
as if they were running from timer handlers.
Fixes: 6f458dfb40 ("tcp: improve latencies of timer triggered events")
Reported-by: Lars Persson <lars.persson@axis.com>
Tested-by: Lars Persson <lars.persson@axis.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14 06:42:16 -07:00
..
2013-02-27 22:51:08 -05:00
2013-10-13 16:08:32 -07:00
2013-04-23 13:25:51 -04:00
2013-04-19 17:32:31 -04:00
2013-04-08 17:16:57 -04:00
2013-12-08 07:29:25 -08:00
2013-04-05 20:12:54 +02:00
2013-04-12 16:54:45 +02:00
2012-06-17 16:29:38 -07:00
2013-05-01 14:08:52 -07:00
2013-02-12 18:59:45 -05:00
2013-10-13 16:08:30 -07:00
2013-05-01 15:13:49 -04:00
2012-08-09 16:18:06 -07:00
2013-02-27 19:10:24 -08:00
2013-04-22 15:48:00 +02:00
2012-08-30 03:00:16 +02:00
2013-11-04 04:31:04 -08:00
2013-04-09 13:19:35 -04:00
2012-08-10 16:52:54 -07:00
2012-04-15 12:44:40 -04:00
2012-04-05 05:08:04 -04:00
2013-03-22 10:31:16 -04:00
2013-01-28 00:15:27 -05:00
2012-04-15 12:44:40 -04:00
2013-01-09 23:59:53 -08:00
2012-07-19 10:43:03 -07:00
2013-11-04 04:31:03 -08:00
2012-06-29 01:36:36 -07:00
2013-03-26 12:32:13 -04:00
2013-03-20 12:14:36 -04:00
2012-10-08 17:42:36 -04:00
2013-09-14 06:54:55 -07:00
2013-03-26 12:27:18 -04:00
2013-01-27 22:46:33 -05:00
2013-02-22 15:10:18 -05:00
2012-11-27 11:56:18 +01:00
2013-04-08 12:00:16 -04:00
2013-04-09 13:12:23 -04:00
2012-07-16 03:44:56 -07:00
2013-02-21 18:15:58 -05:00
2012-07-19 11:02:03 -07:00
2013-03-12 08:30:34 -04:00
2012-09-27 18:12:37 -04:00
2013-05-06 11:06:51 -04:00
2013-02-27 19:10:24 -08:00
2013-02-21 18:15:58 -05:00
2013-02-27 19:10:24 -08:00
2012-07-10 22:40:14 -07:00
2013-01-08 17:56:10 -08:00
2013-11-20 12:27:46 -08:00
2013-11-04 04:31:05 -08:00
2013-03-26 12:27:18 -04:00
2013-03-13 10:47:09 -04:00
2013-11-20 12:27:46 -08:00
2013-12-08 07:29:25 -08:00
2013-12-08 07:29:25 -08:00
2013-12-08 07:29:25 -08:00
2012-05-17 18:45:20 -04:00
2013-04-29 15:41:56 -04:00
2012-04-15 12:44:40 -04:00
2012-05-15 20:14:35 -04:00
2012-09-17 13:13:24 -04:00
2013-09-07 22:09:59 -07:00
2012-06-26 21:06:11 -07:00
2013-02-10 20:37:22 -05:00
2013-08-11 18:35:26 -07:00
2013-02-11 00:21:44 -05:00
2013-04-05 19:35:02 +02:00
2013-01-14 15:04:59 -05:00
2012-09-17 18:08:54 -07:00
2012-09-10 15:30:41 -04:00
2013-04-09 13:19:37 -04:00
2013-02-27 19:10:24 -08:00
2013-01-14 15:09:36 -05:00
2013-02-12 18:59:45 -05:00
2012-11-15 17:39:51 -05:00
2012-05-19 01:08:16 -04:00
2012-04-16 23:53:11 -04:00
2013-01-03 13:01:30 +01:00
2013-04-22 15:55:48 -04:00
2012-11-03 14:59:04 -04:00
2013-03-22 10:31:16 -04:00
2013-09-14 06:54:55 -07:00
2013-04-22 20:32:51 -04:00
2013-10-13 16:08:30 -07:00
2012-08-06 13:40:47 -07:00
2014-04-14 06:42:16 -07:00
2012-04-10 10:04:07 -07:00
2014-03-23 21:38:10 -07:00
2012-06-09 14:56:12 -07:00
2013-01-31 13:53:08 -05:00
2013-07-28 16:29:49 -07:00
2012-04-15 12:44:40 -04:00
2012-05-16 15:17:08 -04:00
2012-04-15 12:44:40 -04:00
2013-05-31 17:30:07 -07:00