Eric Dumazet
e776af608f
tcp: fix error recovery in tcp_zerocopy_receive()
...
If user provides wrong virtual address in TCP_ZEROCOPY_RECEIVE
operation we want to return -EINVAL error.
But depending on zc->recv_skip_hint content, we might return
-EIO error if the socket has SOCK_DONE set.
Make sure to return -EINVAL in this case.
BUG: KMSAN: uninit-value in tcp_zerocopy_receive net/ipv4/tcp.c:1833 [inline]
BUG: KMSAN: uninit-value in do_tcp_getsockopt+0x4494/0x6320 net/ipv4/tcp.c:3685
CPU: 1 PID: 625 Comm: syz-executor.0 Not tainted 5.7.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1c9/0x220 lib/dump_stack.c:118
kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121
__msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215
tcp_zerocopy_receive net/ipv4/tcp.c:1833 [inline]
do_tcp_getsockopt+0x4494/0x6320 net/ipv4/tcp.c:3685
tcp_getsockopt+0xf8/0x1f0 net/ipv4/tcp.c:3728
sock_common_getsockopt+0x13f/0x180 net/core/sock.c:3131
__sys_getsockopt+0x533/0x7b0 net/socket.c:2177
__do_sys_getsockopt net/socket.c:2192 [inline]
__se_sys_getsockopt+0xe1/0x100 net/socket.c:2189
__x64_sys_getsockopt+0x62/0x80 net/socket.c:2189
do_syscall_64+0xb8/0x160 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c829
Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f1deeb72c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00000000004e01e0 RCX: 000000000045c829
RDX: 0000000000000023 RSI: 0000000000000006 RDI: 0000000000000009
RBP: 000000000078bf00 R08: 0000000020000200 R09: 0000000000000000
R10: 00000000200001c0 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000001d8 R14: 00000000004d3038 R15: 00007f1deeb736d4
Local variable ----zc@do_tcp_getsockopt created at:
do_tcp_getsockopt+0x1a74/0x6320 net/ipv4/tcp.c:3670
do_tcp_getsockopt+0x1a74/0x6320 net/ipv4/tcp.c:3670
Fixes: 05255b823a61 ("tcp: add TCP_ZEROCOPY_RECEIVE support for zerocopy receive")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-05-14 15:12:08 -07:00
..
2019-05-21 12:33:38 -07:00
2020-03-15 15:20:16 +01:00
2020-03-29 22:14:49 -07:00
2020-03-12 15:55:00 -07:00
2020-03-12 15:55:00 -07:00
2020-03-30 19:52:37 -07:00
2020-05-12 18:12:40 -07:00
2019-11-01 14:57:52 -07:00
2020-04-09 10:27:23 -07:00
2020-03-26 14:51:07 +01:00
2020-02-19 13:52:32 +01:00
2020-03-23 20:59:40 -07:00
2020-03-29 22:30:57 -07:00
2019-10-04 11:10:56 -07:00
2019-10-04 11:10:56 -07:00
2020-04-22 19:57:39 -07:00
2020-03-30 20:48:43 -07:00
2020-01-23 14:32:52 +01:00
2020-03-08 21:25:37 -07:00
2020-01-03 12:24:34 -08:00
2020-03-12 15:55:00 -07:00
2020-02-23 21:15:36 -08:00
2020-03-12 22:34:48 -07:00
2020-03-12 22:34:48 -07:00
2019-08-08 15:55:10 -07:00
2019-12-13 21:40:49 -08:00
2019-05-21 10:50:45 +02:00
2019-11-07 16:15:56 -08:00
2019-09-20 18:23:33 -07:00
2019-08-08 15:55:10 -07:00
2020-03-16 17:19:56 -07:00
2020-03-30 13:45:04 -07:00
2019-06-21 18:35:51 +02:00
2020-03-29 21:53:18 -07:00
2019-05-25 11:00:50 -07:00
2020-03-29 22:30:57 -07:00
2020-03-29 22:16:27 -07:00
2020-02-06 13:27:30 +01:00
2019-07-05 15:01:15 -07:00
2020-03-02 13:11:46 -07:00
2019-07-25 17:23:40 -07:00
2019-10-04 11:10:56 -07:00
2020-03-12 15:55:00 -07:00
2020-03-30 12:45:23 -07:00
2020-03-09 22:34:58 +01:00
2019-05-21 10:50:45 +02:00
2019-01-28 11:32:58 +01:00
2019-05-21 10:50:45 +02:00
2020-03-12 15:55:00 -07:00
2019-09-13 21:44:19 +02:00
2020-03-29 22:14:49 -07:00
2019-05-30 11:26:32 -07:00
2020-03-12 22:34:48 -07:00
2020-03-11 23:19:40 -07:00
2020-05-08 22:52:57 -07:00
2020-01-29 17:45:20 +01:00
2020-03-12 12:08:09 -07:00
2020-01-21 10:45:49 +01:00
2020-03-16 18:26:54 -07:00
2020-05-06 00:22:22 +02:00
2019-05-21 10:50:45 +02:00
2020-01-09 08:46:18 -08:00
2019-12-30 14:44:27 -08:00
2019-05-30 11:26:32 -07:00
2018-10-10 22:26:00 -07:00
2020-02-27 18:50:19 -08:00
2019-10-25 19:25:37 -07:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2020-05-12 12:49:47 -07:00
2020-03-12 15:55:00 -07:00
2019-05-21 10:50:45 +02:00
2019-12-09 20:17:48 -08:00
2020-03-29 22:14:48 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2020-03-20 19:36:38 -07:00
2019-05-21 10:50:45 +02:00
2018-09-21 19:37:59 -07:00
2020-03-16 18:26:54 -07:00
2020-01-26 15:28:47 +01:00
2020-03-09 22:34:58 +01:00
2019-05-21 10:50:45 +02:00
2020-03-16 18:26:55 -07:00
2019-05-21 10:50:45 +02:00
2020-03-16 18:26:55 -07:00
2020-05-14 15:12:08 -07:00
2019-05-21 10:50:45 +02:00
2020-03-09 22:34:58 +01:00
2020-03-12 22:34:48 -07:00
2019-01-17 15:01:08 -08:00
2020-03-30 10:35:03 -07:00
2019-05-21 10:50:45 +02:00
2020-03-30 19:52:37 -07:00
2019-05-30 11:26:32 -07:00
2018-09-04 10:26:30 +02:00
2020-04-22 12:32:11 -07:00
2019-12-24 22:28:54 -08:00
2019-12-09 09:59:07 +01:00
2019-06-06 08:34:50 +02:00
2019-06-06 08:34:50 +02:00