Dirk van der Merwe
9354544cbc
net/tls: fix page double free on TX cleanup
With commit 94850257cf ("tls: Fix tls_device handling of partial records")
a new path was introduced to cleanup partial records during sk_proto_close.
This path does not handle the SW KTLS tx_list cleanup.
This is unnecessary though since the free_resources calls for both
SW and offload paths will cleanup a partial record.
The visible effect is the following warning, but this bug also causes
a page double free.
WARNING: CPU: 7 PID: 4000 at net/core/stream.c:206 sk_stream_kill_queues+0x103/0x110
RIP: 0010:sk_stream_kill_queues+0x103/0x110
RSP: 0018:ffffb6df87e07bd0 EFLAGS: 00010206
RAX: 0000000000000000 RBX: ffff8c21db4971c0 RCX: 0000000000000007
RDX: ffffffffffffffa0 RSI: 000000000000001d RDI: ffff8c21db497270
RBP: ffff8c21db497270 R08: ffff8c29f4748600 R09: 000000010020001a
R10: ffffb6df87e07aa0 R11: ffffffff9a445600 R12: 0000000000000007
R13: 0000000000000000 R14: ffff8c21f03f2900 R15: ffff8c21f03b8df0
Call Trace:
inet_csk_destroy_sock+0x55/0x100
tcp_close+0x25d/0x400
? tcp_check_oom+0x120/0x120
tls_sk_proto_close+0x127/0x1c0
inet_release+0x3c/0x60
__sock_release+0x3d/0xb0
sock_close+0x11/0x20
__fput+0xd8/0x210
task_work_run+0x84/0xa0
do_exit+0x2dc/0xb90
? release_sock+0x43/0x90
do_group_exit+0x3a/0xa0
get_signal+0x295/0x720
do_signal+0x36/0x610
? SYSC_recvfrom+0x11d/0x130
exit_to_usermode_loop+0x69/0xb0
do_syscall_64+0x173/0x180
entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x7fe9b9abc10d
RSP: 002b:00007fe9b19a1d48 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 0000000000000006 RCX: 00007fe9b9abc10d
RDX: 0000000000000002 RSI: 0000000000000080 RDI: 00007fe948003430
RBP: 00007fe948003410 R08: 00007fe948003430 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00005603739d9080
R13: 00007fe9b9ab9f90 R14: 00007fe948003430 R15: 0000000000000000
Fixes: 94850257cf ("tls: Fix tls_device handling of partial records")
Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-24 07:20:45 -07:00
..
2019-05-30 11:29:21 -07:00
2019-05-05 19:29:04 +02:00
2019-05-30 11:29:22 -07:00
2018-09-26 09:56:07 -07:00
2019-06-19 17:09:55 +02:00
2019-06-15 18:47:31 -07:00
2019-06-19 17:09:07 +02:00
2019-06-05 17:37:07 +02:00
2019-05-24 17:39:00 +02:00
2019-05-30 11:29:52 -07:00
2017-04-12 22:02:36 +02:00
2019-03-21 13:26:42 -07:00
2019-06-12 11:00:11 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-02-28 08:24:23 -07:00
2019-06-05 17:37:05 +02:00
2017-11-02 11:10:55 +01:00
2019-05-05 11:25:49 -07:00
2017-11-02 11:10:55 +01:00
2019-01-23 11:18:00 -08:00
2019-06-19 17:09:55 +02:00
2019-05-24 17:37:53 +02:00
2019-05-21 11:28:40 +02:00
2019-05-30 11:26:32 -07:00
2018-09-26 20:22:19 -07:00
2019-04-27 09:07:04 -07:00
2019-06-05 17:37:06 +02:00
2019-05-21 11:28:45 +02:00
2019-06-19 17:09:55 +02:00
2019-06-21 09:58:42 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:45 +02:00
2019-05-30 11:26:32 -07:00
2016-04-25 16:44:27 -04:00
2016-06-25 12:19:35 -04:00
2016-04-25 16:44:27 -04:00
2019-04-19 14:07:40 -07:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:29:52 -07:00
2019-05-30 11:29:52 -07:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-05-21 11:52:39 +02:00
2019-05-21 11:52:39 +02:00
2017-11-04 09:26:51 +09:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2018-03-05 12:52:45 -05:00
2017-11-04 09:26:51 +09:00
2017-11-02 11:10:55 +01:00
2019-03-21 13:39:25 -07:00
2018-05-20 18:31:42 -04:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2018-05-28 22:59:54 -04:00
2019-04-22 21:50:53 -07:00
2018-04-23 10:21:24 -04:00
2017-11-02 11:10:55 +01:00
2019-06-12 10:09:56 -07:00
2019-05-16 12:02:42 -07:00
2019-02-27 12:50:17 -08:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:30:27 +02:00
2019-06-05 17:30:27 +02:00
2017-11-02 11:10:55 +01:00
2018-11-17 21:37:29 -08:00
2019-04-27 17:07:22 -04:00
2019-03-22 12:09:31 -07:00
2018-12-10 15:53:04 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-11 14:10:06 -05:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2019-02-22 12:56:24 -08:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-04-22 21:50:53 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2018-12-15 13:23:02 -08:00
2019-05-30 11:26:32 -07:00
2018-10-17 17:45:07 -07:00
2019-02-26 08:27:05 -08:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-02-08 21:50:15 -08:00
2019-05-30 11:26:32 -07:00
2019-06-07 09:29:14 -07:00
2019-04-23 19:44:18 -07:00
2019-06-18 20:48:45 -04:00
2019-05-30 11:26:32 -07:00
2019-02-27 12:50:17 -08:00
2019-04-08 22:57:59 +02:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-05-05 10:40:24 -07:00
2019-04-17 23:10:47 -07:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2018-03-27 09:51:23 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2018-07-11 23:10:19 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 12:06:25 +09:00
2018-04-22 14:55:03 -04:00
2018-09-13 09:04:58 -07:00
2019-04-23 19:42:29 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:41 -07:00
2019-05-21 11:28:45 +02:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:36:38 +02:00
2019-06-05 17:36:38 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-04-08 15:22:40 -07:00
2019-04-17 23:19:07 -07:00
2018-05-28 22:59:54 -04:00
2019-03-28 17:00:45 -07:00
2017-11-02 11:10:55 +01:00
2018-08-01 09:52:30 -07:00
2019-05-21 11:28:45 +02:00
2019-05-04 01:27:11 -04:00
2019-05-30 11:26:32 -07:00
2019-04-11 13:59:49 -07:00
2016-07-08 12:20:57 +02:00
2017-11-08 16:12:33 +09:00
2017-11-02 11:10:55 +01:00
2018-05-24 18:36:15 -07:00
2019-05-30 11:26:32 -07:00
2019-05-07 12:23:40 -07:00
2018-09-25 20:17:35 -07:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2019-04-22 21:50:53 -07:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2017-12-05 14:37:13 -05:00
2018-08-28 11:11:47 +02:00
2019-06-19 17:46:57 -04:00
2018-05-16 07:23:35 +02:00
2019-05-30 11:26:32 -07:00
2018-03-13 18:37:02 +02:00
2018-11-06 15:00:45 -08:00
2019-04-22 21:47:25 -07:00
2019-04-23 18:36:33 +02:00
2018-07-21 10:43:12 -05:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2018-04-11 10:33:46 -04:00
2019-02-21 10:34:37 -08:00
2019-05-30 11:26:32 -07:00
2018-08-11 01:58:46 +02:00
2019-06-14 20:18:28 -07:00
2018-03-01 21:21:36 -05:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-15 18:47:31 -07:00
2019-05-30 11:26:32 -07:00
2018-05-08 00:02:41 -04:00
2019-06-24 07:20:45 -07:00
2018-07-07 10:58:49 +09:00
2017-11-02 11:10:55 +01:00
2017-08-29 15:16:52 -07:00
2019-03-29 10:53:45 -07:00
2019-05-31 08:34:32 -07:00
2018-02-16 15:57:42 -05:00
2019-06-05 17:37:05 +02:00
2019-03-22 12:09:31 -07:00
2018-01-24 19:13:45 -05:00
2019-06-05 17:30:29 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-03-16 01:27:51 +01:00
2019-06-05 17:37:09 +02:00
2019-05-07 22:03:58 -07:00