kernel BUG at /home/blee/project/race-fuzzer/kernels/kernel_v4.16-rc3/net/packet/af_packet.c:LINE!
From: DaeRyong Jeong <hidden>
Date: 2018-03-30 16:33:52
We report the crash: kernel BUG at /home/blee/project/race-fuzzer/kernels/kernel_v4.16-rc3/net/packet/af_packet.c:LINE! This crash has been found in v4.16-rc3 using RaceFuzzer (a modified version of Syzkaller), which we describe more at the end of this report. Our analysis shows that the race occurs when invoking two syscalls concurrently, (setsockopt$packet_int) and (bind$packet). We have confirmed that the kernel v4.16-rc3, v4.16-rc7, and v4.15.14 built with gcc 7.1.0 are crashing by running the provided C repro program within a few minutes (5 minutes). Note that this crash can be triggered from the user space. C repro code : https://kiwi.cs.purdue.edu/static/race-fuzzer/afpacket-setsockopt-bind-repro.c kernel config v4.16-rc3 : https://kiwi.cs.purdue.edu/static/race-fuzzer/afpacket-setsockopt-bind-v4.16-rc3.config kernel config v4.16-rc7 : https://kiwi.cs.purdue.edu/static/race-fuzzer/afpacket-setsockopt-bind-v4.16-rc7.config kernel config v4.15.14 : https://kiwi.cs.purdue.edu/static/race-fuzzer/afpacket-setsockopt-bind-v4.15.14.config [ 881.047513] ------------[ cut here ]------------ [ 881.048416] kernel BUG at /home/blee/project/race-fuzzer/kernels/kernel_v4.16-rc3/net/packet/af_packet.c:3107! [ 881.050014] invalid opcode: 0000 [#1] SMP KASAN [ 881.050698] Dumping ftrace buffer: [ 881.051244] (ftrace buffer empty) [ 881.051768] Modules linked in: [ 881.052236] CPU: 1 PID: 18247 Comm: syz-executor0 Not tainted 4.16.0-rc3 #1 [ 881.053247] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014 [ 881.054880] RIP: 0010:packet_do_bind+0x88d/0x950 [ 881.055553] RSP: 0018:ffff8802231d7b08 EFLAGS: 00010212 [ 881.056310] RAX: 0000000000010000 RBX: ffff8800af831740 RCX: ffffc900025ce000 [ 881.057318] RDX: 00000000000000a5 RSI: ffffffff838b257d RDI: 0000000000000001 [ 881.058301] RBP: ffff8802231d7c10 R08: ffff8802342f2480 R09: 0000000000000000 [ 881.059298] R10: 0000000000000001 R11: 0000000000000000 R12: ffff8802309f8f00 [ 881.060314] R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000001000 [ 881.061320] FS: 00007f7fab50d700(0000) GS:ffff88023fc00000(0000) knlGS:0000000000000000 [ 881.062467] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033