bpfilter: read fail -512 kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN CPU: 0 PID: 4579 Comm: syz-executor4 Not tainted 4.17.0+ #118 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:file_write_hint include/linux/fs.h:1934 [inline] RIP: 0010:init_sync_kiocb include/linux/fs.h:1953 [inline] RIP: 0010:new_sync_write fs/read_write.c:470 [inline] RIP: 0010:__vfs_write+0x49f/0x9d0 fs/read_write.c:487 Code: 48 c1 ea 03 80 3c 02 00 0f 85 17 05 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 6b 20 49 8d bd c8 00 00 00 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 59 03 00 00 45 8b ad c8 00 00 RSP: 0018:ffff880192487690 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff8801cda12a00 RCX: ffffffff81c0dc3a RDX: 0000000000000019 RSI: ffffffff81c0dc44 RDI: 00000000000000c8 RBP: ffff880192487808 R08: ffff88019247a300 R09: fffffbfff130c799 R10: ffff880192487850 R11: ffffffff89863ccb R12: ffff8801924877e0 R13: 0000000000000000 R14: 0000000000000000 R15: ffff8801924878c8 FS: 0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:0000000009315900 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00007f02186e4518 CR3: 000000019245c000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __kernel_write+0x10c/0x380 fs/read_write.c:506 __bpfilter_process_sockopt+0x1d8/0x35b net/bpfilter/bpfilter_kern.c:66 bpfilter_mbox_request+0x4d/0xb0 net/ipv4/bpfilter/sockopt.c:25 bpfilter_ip_get_sockopt+0x6b/0x90 net/ipv4/bpfilter/sockopt.c:42 compat_ip_getsockopt+0x256/0x2f0 net/ipv4/ip_sockglue.c:1600 inet_csk_compat_getsockopt+0x97/0x120 net/ipv4/inet_connection_sock.c:1023 compat_tcp_getsockopt+0x49/0x80 net/ipv4/tcp.c:3543 compat_sock_common_getsockopt+0xb4/0x150 net/core/sock.c:3023 __compat_sys_getsockopt+0x1ae/0x880 net/compat.c:532 __do_compat_sys_socketcall net/compat.c:916 [inline] __se_compat_sys_socketcall net/compat.c:844 [inline] __ia32_compat_sys_socketcall+0xcd1/0x1070 net/compat.c:844 do_syscall_32_irqs_on arch/x86/entry/common.c:323 [inline] do_fast_syscall_32+0x345/0xf9b arch/x86/entry/common.c:394 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f11cb9 Code: 55 08 8b 88 64 cd ff ff 8b 98 68 cd ff ff 89 c8 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 1c 24 c3 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:000000000845e340 EFLAGS: 00000206 ORIG_RAX: 0000000000000066 RAX: ffffffffffffffda RBX: 000000000000000f RCX: 000000000845e35c RDX: 000000000845e3b4 RSI: 000000000845e3b4 RDI: 000000000845e408 RBP: 000000000811fe18 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: Dumping ftrace buffer: (ftrace buffer empty) ---[ end trace 84c6f321ffafa85c ]--- RIP: 0010:file_write_hint include/linux/fs.h:1934 [inline] RIP: 0010:init_sync_kiocb include/linux/fs.h:1953 [inline] RIP: 0010:new_sync_write fs/read_write.c:470 [inline] RIP: 0010:__vfs_write+0x49f/0x9d0 fs/read_write.c:487 Code: 48 c1 ea 03 80 3c 02 00 0f 85 17 05 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 6b 20 49 8d bd c8 00 00 00 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 59 03 00 00 45 8b ad c8 00 00 RSP: 0018:ffff880192487690 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff8801cda12a00 RCX: ffffffff81c0dc3a RDX: 0000000000000019 RSI: ffffffff81c0dc44 RDI: 00000000000000c8 RBP: ffff880192487808 R08: ffff88019247a300 R09: fffffbfff130c799 R10: ffff880192487850 R11: ffffffff89863ccb R12: ffff8801924877e0 R13: 0000000000000000 R14: 0000000000000000 R15: ffff8801924878c8 FS: 0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:0000000009315900 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00007f02186e4518 CR3: 000000019245c000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400