Hello,
syzbot tried to test the proposed patch but the build/boot failed:
ermissive=1
[ 27.902088][ T370] cgroup: Unknown subsys name 'hugetlb'
[ 27.907887][ T370] cgroup: Unknown subsys name 'rlimit'
[ 28.031500][ T23] audit: type=1400 audit(1667801872.340:82): avc: denied { setattr } for pid=370 comm="syz-executor" name="raw-gadget" dev="devtmpfs" ino=166 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file permissive=1
[ 28.101853][ T374] bridge0: port 1(bridge_slave_0) entered blocking state
[ 28.109088][ T374] bridge0: port 1(bridge_slave_0) entered disabled state
[ 28.116432][ T374] device bridge_slave_0 entered promiscuous mode
[ 28.123190][ T374] bridge0: port 2(bridge_slave_1) entered blocking state
[ 28.130230][ T374] bridge0: port 2(bridge_slave_1) entered disabled state
[ 28.137741][ T374] device bridge_slave_1 entered promiscuous mode
[ 28.165091][ T374] bridge0: port 2(bridge_slave_1) entered blocking state
[ 28.172275][ T374] bridge0: port 2(bridge_slave_1) entered forwarding state
[ 28.179510][ T374] bridge0: port 1(bridge_slave_0) entered blocking state
[ 28.186628][ T374] bridge0: port 1(bridge_slave_0) entered forwarding state
[ 28.201922][ T74] bridge0: port 1(bridge_slave_0) entered disabled state
[ 28.209269][ T74] bridge0: port 2(bridge_slave_1) entered disabled state
[ 28.217112][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready
[ 28.224835][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
[ 28.240983][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): bridge_slave_0: link becomes ready
[ 28.250601][ T74] bridge0: port 1(bridge_slave_0) entered blocking state
[ 28.257632][ T74] bridge0: port 1(bridge_slave_0) entered forwarding state
[ 28.265664][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): bridge_slave_1: link becomes ready
[ 28.273859][ T74] bridge0: port 2(bridge_slave_1) entered blocking state
[ 28.280884][ T74] bridge0: port 2(bridge_slave_1) entered forwarding state
[ 28.288693][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_0: link becomes ready
[ 28.296741][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_1: link becomes ready
[ 28.310807][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): veth0_vlan: link becomes ready
[ 28.318674][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): veth0_macvtap: link becomes ready
[ 28.326888][ T74] IPv6: ADDRCONF(NETDEV_CHANGE): veth0_virt_wifi: link becomes ready
[ 28.339759][ T123] IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
[ 28.348516][ T123] IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready
2022/11/07 06:17:52 building call list...
[ 28.363330][ T374] cgroup: cgroup: disabling cgroup2 socket matching due to net_prio or net_cls activation
[ 28.430746][ T374] ==================================================================
[ 28.439433][ T374] BUG: KASAN: use-after-free in task_active_pid_ns+0x9a/0xa0
[ 28.446820][ T374] Read of size 4 at addr ffff888100152184 by task syz-executor.0/374
[ 28.454981][ T374]
[ 28.457300][ T374] CPU: 1 PID: 374 Comm: syz-executor.0 Not tainted 5.11.0-rc1-syzkaller-00046-g2569063c7140 #0
[ 28.468675][ T374] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
[ 28.478728][ T374] Call Trace:
[ 28.482097][ T374] dump_stack+0x19c/0x1e2
[ 28.486425][ T374] ? task_active_pid_ns+0x9a/0xa0
[ 28.491436][ T374] print_address_description+0x7a/0x3b0
[ 28.496978][ T374] ? task_active_pid_ns+0x9a/0xa0
[ 28.501999][ T374] kasan_report+0x18e/0x230
[ 28.506506][ T374] ? task_active_pid_ns+0x9a/0xa0
[ 28.511542][ T374] __asan_report_load4_noabort+0x14/0x20
[ 28.517174][ T374] task_active_pid_ns+0x9a/0xa0
[ 28.522020][ T374] do_notify_parent+0x2f6/0x990
[ 28.526957][ T374] ? __kasan_check_write+0x14/0x20
[ 28.532094][ T374] do_exit+0x140b/0x2250
[ 28.536413][ T374] ? mutex_unlock+0x1d/0x40
[ 28.540922][ T374] do_group_exit+0x13a/0x300
[ 28.545506][ T374] ? __kasan_check_write+0x14/0x20
[ 28.550711][ T374] get_signal+0xd59/0x1320
[ 28.555123][ T374] ? init_wait_entry+0xe0/0xe0
[ 28.560051][ T374] arch_do_signal_or_restart+0x5d/0x5c0
[ 28.565594][ T374] exit_to_user_mode_loop+0xd4/0x110
[ 28.570979][ T374] syscall_exit_to_user_mode+0x75/0xa0
[ 28.576436][ T374] do_syscall_64+0x40/0x70
[ 28.580853][ T374] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 28.586841][ T374] RIP: 0033:0x7f4e815f32fe
[ 28.591249][ T374] Code: Unable to access opcode bytes at RIP 0x7f4e815f32d4.
[ 28.598598][ T374] RSP: 002b:00007ffecb776338 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 28.607001][ T374] RAX: 0000000000000000 RBX: 00007ffecb7763c0 RCX: 00007f4e815f32fe
[ 28.615068][ T374] RDX: 0000000000000040 RSI: 00007f4e8175e020 RDI: 00000000000000f9
[ 28.623031][ T374] RBP: 0000000000000003 R08: 00000000000002e8 R09: ffffffffffff0000
[ 28.631097][ T374] R10: 00007f4e81738000 R11: 0000000000000246 R12: 0000000000000032
[ 28.639061][ T374] R13: 0000000000006ec9 R14: 0000000000000003 R15: 00007ffecb776400
[ 28.647204][ T374]
[ 28.649514][ T374] Allocated by task 0:
[ 28.653569][ T374] ____kasan_kmalloc+0xcb/0x100
[ 28.658506][ T374] __kasan_slab_alloc+0x11/0x20
[ 28.663354][ T374] kmem_cache_alloc+0x17d/0x2b0
[ 28.668231][ T374] alloc_pid+0x9c/0xad0
[ 28.672430][ T374] copy_process+0x16d7/0x32d0
[ 28.677203][ T374] kernel_clone+0x1d7/0x840
[ 28.681706][ T374] kernel_thread+0x11b/0x160
[ 28.686286][ T374] rest_init+0x22/0xf0
[ 28.690518][ T374] arch_call_rest_init+0xe/0x10
[ 28.695362][ T374] start_kernel+0x45a/0x4cc
[ 28.699861][ T374] x86_64_start_reservations+0x2a/0x2c
[ 28.705568][ T374] x86_64_start_kernel+0x7a/0x7d
[ 28.711218][ T374] secondary_startup_64_no_verify+0xb0/0xbb
[ 28.717287][ T374]
[ 28.719612][ T374] Freed by task 370:
[ 28.723488][ T374] kasan_set_track+0x4c/0x80
[ 28.728093][ T374] kasan_set_free_info+0x23/0x40
[ 28.733199][ T374] ____kasan_slab_free+0xf6/0x120
[ 28.738394][ T374] __kasan_slab_free+0xe/0x10
[ 28.743069][ T374] slab_free_freelist_hook+0x7b/0x150
[ 28.748622][ T374] kmem_cache_free+0x9e/0x1d0
[ 28.753306][ T374] put_pid+0xb3/0x120
[ 28.757484][ T374] proc_do_cad_pid+0x131/0x1d0
[ 28.762238][ T374] proc_sys_call_handler+0x501/0x7c0
[ 28.767513][ T374] proc_sys_write+0x22/0x30
[ 28.772011][ T374] vfs_write+0xb57/0xe50
[ 28.776255][ T374] ksys_write+0x157/0x260
[ 28.780753][ T374] __x64_sys_write+0x7b/0x90
[ 28.785344][ T374] do_syscall_64+0x34/0x70
[ 28.789857][ T374] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 28.795772][ T374]
[ 28.798096][ T374] The buggy address belongs to the object at ffff888100152180
[ 28.798096][ T374] which belongs to the cache pid of size 112
[ 28.811449][ T374] The buggy address is located 4 bytes inside of
[ 28.811449][ T374] 112-byte region [ffff888100152180, ffff8881001521f0)
[ 28.824989][ T374] The buggy address belongs to the page:
[ 28.830627][ T374] page:00000000e10c63dc refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100152
[ 28.841382][ T374] flags: 0x8000000000000200(slab)
[ 28.846436][ T374] raw: 8000000000000200 dead000000000100 dead000000000122 ffff888100125140
[ 28.855010][ T374] raw: 0000000000000000 0000000000150015 00000001ffffffff 0000000000000000
[ 28.863691][ T374] page dumped because: kasan: bad access detected
[ 28.870267][ T374] page_owner tracks the page as allocated
[ 28.876089][ T374] page last allocated via order 0, migratetype Unmovable, gfp_mask 0x0(), pid 1, ts 987467602
[ 28.886328][ T374] register_early_stack+0x41/0x80
[ 28.891438][ T374] init_page_owner+0x32/0x810
[ 28.896117][ T374] page_ext_init+0x342/0x369
[ 28.900701][ T374] kernel_init_freeable+0x205/0x306
[ 28.905887][ T374] page_owner free stack trace missing
[ 28.911232][ T374]
[ 28.913538][ T374] Memory state around the buggy address:
[ 28.919155][ T374] ffff888100152080: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
[ 28.927380][ T374] ffff888100152100: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
[ 28.935435][ T374] >ffff888100152180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc
[ 28.943504][ T374] ^
[ 28.947928][ T374] ffff888100152200: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
[ 28.956243][ T374] ffff888100152280: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
[ 28.964293][ T374] ==================================================================
[ 28.972443][ T374] Disabling lock debugging due to kernel taint
[ 28.978852][ T374] BUG: unable to handle page fault for address: ffffed122001b53f
[ 28.986641][ T374] #PF: supervisor read access in kernel mode
[ 28.992787][ T374] #PF: error_code(0x0000) - not-present page
[ 28.998753][ T374] PGD 23fff2067 P4D 23fff2067 PUD 0
[ 29.004470][ T374] Oops: 0000 [#1] PREEMPT SMP KASAN
[ 29.009739][ T374] CPU: 1 PID: 374 Comm: syz-executor.0 Tainted: G B 5.11.0-rc1-syzkaller-00046-g2569063c7140 #0
[ 29.021438][ T374] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
[ 29.031739][ T374] RIP: 0010:task_active_pid_ns+0x69/0xa0
[ 29.037367][ T374] Code: 4d ca 22 00 48 8d 7b 04 48 89 f8 48 c1 e8 03 42 8a 04 30 84 c0 75 33 8b 43 04 48 c1 e0 04 48 8d 5c 03 68 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 88 bb 59 00 48 8b 03 eb 07 e8 0e
[ 29.056962][ T374] RSP: 0018:ffffc90000917b90 EFLAGS: 00010806
[ 29.063019][ T374] RAX: 1ffff1122001b53f RBX: ffff8891000da9f8 RCX: 0000000000000002
[ 29.071094][ T374] RDX: 0000000000000000 RSI: 0000000000000082 RDI: 0000000000000001
[ 29.079085][ T374] RBP: ffffc90000917ba0 R08: ffffffff813d1193 R09: fffffbfff0c7aaf9
[ 29.087061][ T374] R10: fffffbfff0c7aaf9 R11: 1ffffffff0c7aaf8 R12: 0000000000000011
[ 29.095037][ T374] R13: 0000000000000011 R14: dffffc0000000000 R15: dffffc0000000000
[ 29.103015][ T374] FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
[ 29.112293][ T374] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 29.118957][ T374] CR2: ffffed122001b53f CR3: 0000000119157000 CR4: 00000000003506a0
[ 29.127369][ T374] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 29.135532][ T374] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 29.143521][ T374] Call Trace:
[ 29.146798][ T374] do_notify_parent+0x2f6/0x990
[ 29.151649][ T374] ? __kasan_check_write+0x14/0x20
[ 29.156761][ T374] do_exit+0x140b/0x2250
[ 29.161082][ T374] ? mutex_unlock+0x1d/0x40
[ 29.165584][ T374] do_group_exit+0x13a/0x300
[ 29.170249][ T374] ? __kasan_check_write+0x14/0x20
[ 29.175347][ T374] get_signal+0xd59/0x1320
[ 29.179765][ T374] ? init_wait_entry+0xe0/0xe0
[ 29.184528][ T374] arch_do_signal_or_restart+0x5d/0x5c0
[ 29.190154][ T374] exit_to_user_mode_loop+0xd4/0x110
[ 29.195431][ T374] syscall_exit_to_user_mode+0x75/0xa0
[ 29.200887][ T374] do_syscall_64+0x40/0x70
[ 29.205290][ T374] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 29.211179][ T374] RIP: 0033:0x7f4e815f32fe
[ 29.215680][ T374] Code: Unable to access opcode bytes at RIP 0x7f4e815f32d4.
[ 29.223151][ T374] RSP: 002b:00007ffecb776338 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 29.231833][ T374] RAX: 0000000000000000 RBX: 00007ffecb7763c0 RCX: 00007f4e815f32fe
[ 29.239794][ T374] RDX: 0000000000000040 RSI: 00007f4e8175e020 RDI: 00000000000000f9
[ 29.247758][ T374] RBP: 0000000000000003 R08: 00000000000002e8 R09: ffffffffffff0000
[ 29.255993][ T374] R10: 00007f4e81738000 R11: 0000000000000246 R12: 0000000000000032
[ 29.264227][ T374] R13: 0000000000006ec9 R14: 0000000000000003 R15: 00007ffecb776400
[ 29.272192][ T374] Modules linked in:
[ 29.276176][ T374] CR2: ffffed122001b53f
[ 29.280331][ T374] ---[ end trace 298419b119b38927 ]---
[ 29.285957][ T374] RIP: 0010:task_active_pid_ns+0x69/0xa0
[ 29.291789][ T374] Code: 4d ca 22 00 48 8d 7b 04 48 89 f8 48 c1 e8 03 42 8a 04 30 84 c0 75 33 8b 43 04 48 c1 e0 04 48 8d 5c 03 68 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 88 bb 59 00 48 8b 03 eb 07 e8 0e
[ 29.311675][ T374] RSP: 0018:ffffc90000917b90 EFLAGS: 00010806
[ 29.318025][ T374] RAX: 1ffff1122001b53f RBX: ffff8891000da9f8 RCX: 0000000000000002
[ 29.326084][ T374] RDX: 0000000000000000 RSI: 0000000000000082 RDI: 0000000000000001
[ 29.334230][ T374] RBP: ffffc90000917ba0 R08: ffffffff813d1193 R09: fffffbfff0c7aaf9
[ 29.342298][ T374] R10: fffffbfff0c7aaf9 R11: 1ffffffff0c7aaf8 R12: 0000000000000011
[ 29.350356][ T374] R13: 0000000000000011 R14: dffffc0000000000 R15: dffffc0000000000
[ 29.358325][ T374] FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
[ 29.367512][ T374] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 29.374227][ T374] CR2: ffffed122001b53f CR3: 0000000119157000 CR4: 00000000003506a0
[ 29.382293][ T374] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 29.390608][ T374] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 29.398940][ T374] Kernel panic - not syncing: Fatal exception
[ 29.405168][ T374] Kernel Offset: disabled
[ 29.409590][ T374] Rebooting in 86400 seconds..
syzkaller build log:
go env (err=<nil>)
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/syzkaller/.cache/go-build"
GOENV="/syzkaller/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/syzkaller/jobs/linux/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/syzkaller/jobs/linux/gopath"
GOPRIVATE=""
GOPROXY="
https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="
sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/syzkaller/jobs/linux/gopath/src/
github.com/google/syzkaller/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build629744628=/tmp/go-build -gno-record-gcc-switches"
git status (err=<nil>)
HEAD detached at 23bf86af9
nothing to commit, working tree clean
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:32: run command via tools/syz-env for best compatibility, see:
Makefile:33:
https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
make .descriptions
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
bin/syz-sysgen
touch .descriptions
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X
github.com/google/syzkaller/prog.GitRevision=23bf86af9a2ba03cda2b5b913bafb76ce8ce14b8 -X '
github.com/google/syzkaller/prog.gitRevisionDate=20221023-092708'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-fuzzer
github.com/google/syzkaller/syz-fuzzer
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X
github.com/google/syzkaller/prog.GitRevision=23bf86af9a2ba03cda2b5b913bafb76ce8ce14b8 -X '
github.com/google/syzkaller/prog.gitRevisionDate=20221023-092708'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-execprog
github.com/google/syzkaller/tools/syz-execprog
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X
github.com/google/syzkaller/prog.GitRevision=23bf86af9a2ba03cda2b5b913bafb76ce8ce14b8 -X '
github.com/google/syzkaller/prog.gitRevisionDate=20221023-092708'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-stress
github.com/google/syzkaller/tools/syz-stress
mkdir -p ./bin/linux_amd64
gcc -o ./bin/linux_amd64/syz-executor executor/executor.cc \
-m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -static-pie -fpermissive -w -DGOOS_linux=1 -DGOARCH_amd64=1 \
-DHOSTGOOS_linux=1 -DGIT_REVISION=\"23bf86af9a2ba03cda2b5b913bafb76ce8ce14b8\"
Error text is too large and was truncated, full error text is at:
https://syzkaller.appspot.com/x/error.txt?x=10867961880000
Tested on:
commit: 2569063c blk-mq: test QUEUE_FLAG_HCTX_ACTIVE for sbitm..
git tree:
https://android.googlesource.com/kernel/common
kernel config:
https://syzkaller.appspot.com/x/.config?x=98a7c6248e6ac84d
Note: no patches were applied.