Re: [syzbot] [hfs?] KMSAN: uninit-value in hfs_revalidate_dentry

From: syzbot
Date: Sun Jun 09 2024 - 05:42:13 EST


Hello,

syzbot tried to test the proposed patch but the build/boot failed:

[ T1] Demotion targets for Node 1: null
[ 49.119163][ T1] Key type .fscrypt registered
[ 49.124054][ T1] Key type fscrypt-provisioning registered
[ 49.131133][ T1] kAFS: Red Hat AFS client v0.1 registering.
[ 49.161844][ T1] Btrfs loaded, assert=on, ref-verify=on, zoned=yes, fsverity=yes
[ 49.188222][ T1] Key type encrypted registered
[ 49.193331][ T1] AppArmor: AppArmor sha256 policy hashing enabled
[ 49.200083][ T1] ima: No TPM chip found, activating TPM-bypass!
[ 49.207200][ T1] Loading compiled-in module X.509 certificates
[ 49.249983][ T1] Loaded X.509 cert 'Build time autogenerated kernel key: 4044fdb61657f0d7afb57899761a918f325ad9da'
[ 49.261109][ T1] ima: Allocated hash algorithm: sha256
[ 49.267173][ T1] ima: No architecture policies found
[ 49.273691][ T1] evm: Initialising EVM extended attributes:
[ 49.279714][ T1] evm: security.selinux (disabled)
[ 49.284916][ T1] evm: security.SMACK64 (disabled)
[ 49.290078][ T1] evm: security.SMACK64EXEC (disabled)
[ 49.295621][ T1] evm: security.SMACK64TRANSMUTE (disabled)
[ 49.301561][ T1] evm: security.SMACK64MMAP (disabled)
[ 49.307143][ T1] evm: security.apparmor
[ 49.311428][ T1] evm: security.ima
[ 49.315316][ T1] evm: security.capability
[ 49.319780][ T1] evm: HMAC attrs: 0x1
[ 49.328692][ T1] PM: Magic number: 12:657:575
[ 49.334778][ T1] usbmon usbmon15: hash matches
[ 49.340450][ T1] tty ptyb7: hash matches
[ 49.346466][ T1] workqueue: hash matches
[ 49.351454][ T1] printk: legacy console [netcon0] enabled
[ 49.357452][ T1] netconsole: network logging started
[ 49.364585][ T1] gtp: GTP module loaded (pdp ctx size 128 bytes)
[ 49.373483][ T1] rdma_rxe: loaded
[ 49.379175][ T1] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 49.398675][ T1] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 49.416007][ T1] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[ 49.424502][ T1] clk: Disabling unused clocks
[ 49.429431][ T1] ALSA device list:
[ 49.433391][ T1] #0: Dummy 1
[ 49.436942][ T1] #1: Loopback 1
[ 49.440749][ T1] #2: Virtual MIDI Card 1
[ 49.450862][ T781] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 49.460739][ T781] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[ 49.470135][ T1] md: Waiting for all devices to be available before autodetect
[ 49.478147][ T1] md: If you don't use raid, use raid=noautodetect
[ 49.484855][ T1] md: Autodetecting RAID arrays.
[ 49.489958][ T1] md: autorun ...
[ 49.493726][ T1] md: ... autorun DONE.
[ 49.614018][ T1] EXT4-fs (sda1): mounted filesystem 5941fea2-f5fa-4b4e-b5ef-9af118b27b95 ro with ordered data mode. Quota mode: none.
[ 49.627278][ T1] VFS: Mounted root (ext4 filesystem) readonly on device 8:1.
[ 49.652172][ T1] devtmpfs: mounted
[ 49.914371][ T1] Freeing unused kernel image (initmem) memory: 36920K
[ 49.925939][ T1] Write protecting the kernel read-only data: 260096k
[ 49.973690][ T1] Freeing unused kernel image (rodata/data gap) memory: 1876K
[ 51.629847][ T1] x86/mm: Checked W+X mappings: passed, no W+X pages found.
[ 51.640154][ T1] x86/mm: Checking user space page tables
[ 53.150732][ T1] x86/mm: Checked W+X mappings: passed, no W+X pages found.
[ 53.159748][ T1] Failed to set sysctl parameter 'kernel.hung_task_all_cpu_backtrace=1': parameter not found
[ 53.180434][ T1] Failed to set sysctl parameter 'max_rcu_stall_to_panic=1': parameter not found
[ 53.192322][ T1] Run /sbin/init as init process
[ 54.758005][ T4441] mount (4441) used greatest stack depth: 8144 bytes left
[ 54.829184][ T4442] EXT4-fs (sda1): re-mounted 5941fea2-f5fa-4b4e-b5ef-9af118b27b95 r/w. Quota mode: none.
mount: mounting smackfs on /sys/fs/smackfs failed: No such file or directory
mount: mounting selinuxfs on /sys/fs/selinux failed: No such file or directory
[ 55.180355][ T4445] mount (4445) used greatest stack depth: 5568 bytes left
Starting syslogd: OK
Starting acpid: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev: [ 58.985674][ T4475] udevd[4475]: starting version 3.2.11
[ 62.542055][ T4476] udevd[4476]: starting eudev-3.2.11
[ 62.555019][ T4475] udevd (4475) used greatest stack depth: 5376 bytes left
[ 96.245738][ T1222] net_ratelimit: 2 callbacks suppressed
[ 96.245811][ T1222] aoe: packet could not be sent on lo. consider increasing tx_queue_len
[ 96.260621][ T1222] aoe: packet could not be sent on bond0. consider increasing tx_queue_len
[ 96.270147][ T1222] aoe: packet could not be sent on dummy0. consider increasing tx_queue_len
[ 96.279315][ T1222] aoe: packet could not be sent on eql. consider increasing tx_queue_len
[ 96.288322][ T1222] aoe: packet could not be sent on ifb0. consider increasing tx_queue_len
[ 96.297303][ T1222] aoe: packet could not be sent on ifb1. consider increasing tx_queue_len
[ 96.306386][ T1222] aoe: packet could not be sent on eth0. consider increasing tx_queue_len
[ 96.315372][ T1222] aoe: packet could not be sent on wlan0. consider increasing tx_queue_len
[ 96.324577][ T1222] aoe: packet could not be sent on wlan1. consider increasing tx_queue_len
[ 96.333636][ T1222] aoe: packet could not be sent on hwsim0. consider increasing tx_queue_len
done
Starting system message bus: done
Starting iptables: OK
Starting network: OK
Starting dhcpcd...
dhcpcd-9.4.1 starting
dev: loaded udev
DUID 00:04:ee:6e:2e:e3:62:a1:1e:1b:9d:a6:87:1c:6e:7e:27:0f
forked to background, child pid 4688
[ 109.985374][ T4689] 8021q: adding VLAN 0 to HW filter on device bond0
[ 110.004681][ T4689] eql: remember to turn off Van-Jacobson compression on your slave devices
Starting sshd: [ 111.585878][ T781] cfg80211: failed to load regulatory.db
OK


syzkaller

syzkaller login: [ 115.417995][ C1] =====================================================
[ 115.425211][ C1] BUG: KMSAN: uninit-value in receive_buf+0x25e3/0x5fd0
[ 115.432271][ C1] receive_buf+0x25e3/0x5fd0
[ 115.437052][ C1] virtnet_poll+0xd1c/0x23c0
[ 115.441841][ C1] __napi_poll+0xe7/0x980
[ 115.446368][ C1] net_rx_action+0x82a/0x1850
[ 115.451222][ C1] handle_softirqs+0x1ce/0x800
[ 115.456164][ C1] __irq_exit_rcu+0x68/0x120
[ 115.460908][ C1] irq_exit_rcu+0x12/0x20
[ 115.465413][ C1] common_interrupt+0x94/0xa0
[ 115.470274][ C1] asm_common_interrupt+0x2b/0x40
[ 115.475495][ C1] acpi_safe_halt+0x25/0x30
[ 115.480160][ C1] acpi_idle_do_entry+0x22/0x40
[ 115.485189][ C1] acpi_idle_enter+0xa1/0xc0
[ 115.489935][ C1] cpuidle_enter_state+0xcb/0x250
[ 115.495149][ C1] cpuidle_enter+0x7f/0xf0
[ 115.499731][ C1] do_idle+0x551/0x750
[ 115.503955][ C1] cpu_startup_entry+0x65/0x80
[ 115.508864][ C1] start_secondary+0xcb/0xd0
[ 115.513732][ C1] common_startup_64+0x12c/0x137
[ 115.518832][ C1]
[ 115.521190][ C1] Uninit was created at:
[ 115.525702][ C1] __alloc_pages_noprof+0x9d6/0xe70
[ 115.531074][ C1] alloc_pages_mpol_noprof+0x299/0x990
[ 115.536739][ C1] alloc_pages_noprof+0x1bf/0x1e0
[ 115.541955][ C1] skb_page_frag_refill+0x2bf/0x7c0
[ 115.547353][ C1] virtnet_rq_alloc+0x43/0xbb0
[ 115.552376][ C1] try_fill_recv+0x3f0/0x2f50
[ 115.557337][ C1] virtnet_open+0x1cc/0xb00
[ 115.561938][ C1] __dev_open+0x546/0x6f0
[ 115.566459][ C1] __dev_change_flags+0x309/0x9a0
[ 115.571639][ C1] dev_change_flags+0x8e/0x1d0
[ 115.576573][ C1] devinet_ioctl+0x13ec/0x22c0
[ 115.581510][ C1] inet_ioctl+0x4bd/0x6d0
[ 115.585995][ C1] sock_do_ioctl+0xb7/0x540
[ 115.590666][ C1] sock_ioctl+0x727/0xd70
[ 115.595147][ C1] __se_sys_ioctl+0x261/0x450
[ 115.599966][ C1] __x64_sys_ioctl+0x96/0xe0
[ 115.604710][ C1] x64_sys_call+0x18c0/0x3b90
[ 115.609556][ C1] do_syscall_64+0xcd/0x1e0
[ 115.614236][ C1] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 115.620293][ C1]
[ 115.622756][ C1] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.10.0-rc2-syzkaller-00366-g771ed66105de-dirty #0
[ 115.633186][ C1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
[ 115.643409][ C1] =====================================================
[ 115.650429][ C1] Disabling lock debugging due to kernel taint
[ 115.656718][ C1] Kernel panic - not syncing: kmsan.panic set ...
[ 115.663231][ C1] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G B 6.10.0-rc2-syzkaller-00366-g771ed66105de-dirty #0
[ 115.675047][ C1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
[ 115.685180][ C1] Call Trace:
[ 115.688511][ C1] <IRQ>
[ 115.691424][ C1] dump_stack_lvl+0x216/0x2d0
[ 115.696208][ C1] ? kmsan_get_shadow_origin_ptr+0x4d/0xb0
[ 115.702134][ C1] dump_stack+0x1e/0x30
[ 115.706380][ C1] panic+0x4e2/0xcd0
[ 115.710363][ C1] ? kmsan_get_metadata+0xb1/0x1d0
[ 115.715588][ C1] kmsan_report+0x2d5/0x2e0
[ 115.720193][ C1] ? kmsan_get_metadata+0x146/0x1d0
[ 115.725494][ C1] ? __msan_warning+0x95/0x120
[ 115.730524][ C1] ? receive_buf+0x25e3/0x5fd0
[ 115.735423][ C1] ? virtnet_poll+0xd1c/0x23c0
[ 115.740319][ C1] ? __napi_poll+0xe7/0x980
[ 115.744975][ C1] ? net_rx_action+0x82a/0x1850
[ 115.749951][ C1] ? handle_softirqs+0x1ce/0x800
[ 115.755021][ C1] ? __irq_exit_rcu+0x68/0x120
[ 115.759883][ C1] ? irq_exit_rcu+0x12/0x20
[ 115.764500][ C1] ? common_interrupt+0x94/0xa0
[ 115.769456][ C1] ? asm_common_interrupt+0x2b/0x40
[ 115.774754][ C1] ? acpi_safe_halt+0x25/0x30
[ 115.779534][ C1] ? acpi_idle_do_entry+0x22/0x40
[ 115.784738][ C1] ? acpi_idle_enter+0xa1/0xc0
[ 115.789603][ C1] ? cpuidle_enter_state+0xcb/0x250
[ 115.794891][ C1] ? cpuidle_enter+0x7f/0xf0
[ 115.799595][ C1] ? do_idle+0x551/0x750
[ 115.803909][ C1] ? cpu_startup_entry+0x65/0x80
[ 115.808953][ C1] ? start_secondary+0xcb/0xd0
[ 115.813810][ C1] ? common_startup_64+0x12c/0x137
[ 115.819068][ C1] ? kmsan_get_metadata+0x146/0x1d0
[ 115.824384][ C1] ? kmsan_internal_memmove_metadata+0x17b/0x230
[ 115.830861][ C1] ? __msan_memcpy+0x108/0x1c0
[ 115.835763][ C1] ? page_to_skb+0x1271/0x1620
[ 115.840612][ C1] ? kmsan_get_metadata+0x146/0x1d0
[ 115.845931][ C1] __msan_warning+0x95/0x120
[ 115.850618][ C1] receive_buf+0x25e3/0x5fd0
[ 115.855336][ C1] ? kmsan_get_metadata+0x146/0x1d0
[ 115.860641][ C1] ? kmsan_get_shadow_origin_ptr+0x4d/0xb0
[ 115.866572][ C1] virtnet_poll+0xd1c/0x23c0
[ 115.871299][ C1] ? __pfx_virtnet_poll+0x10/0x10
[ 115.876444][ C1] __napi_poll+0xe7/0x980
[ 115.880885][ C1] ? kmsan_get_metadata+0x146/0x1d0
[ 115.886199][ C1] net_rx_action+0x82a/0x1850
[ 115.891087][ C1] ? sched_clock_cpu+0x55/0x870
[ 115.896185][ C1] ? __pfx_net_rx_action+0x10/0x10
[ 115.901416][ C1] handle_softirqs+0x1ce/0x800
[ 115.906294][ C1] __irq_exit_rcu+0x68/0x120
[ 115.911007][ C1] irq_exit_rcu+0x12/0x20
[ 115.915429][ C1] common_interrupt+0x94/0xa0
[ 115.920232][ C1] </IRQ>
[ 115.923211][ C1] <TASK>
[ 115.926197][ C1] asm_common_interrupt+0x2b/0x40
[ 115.931326][ C1] RIP: 0010:acpi_safe_halt+0x25/0x30
[ 115.936807][ C1] Code: 90 90 90 90 90 55 48 89 e5 65 48 8b 04 25 80 5e 0a 00 48 f7 00 08 00 00 00 75 10 66 90 0f 00 2d eb a8 44 00 f3 0f 1e fa fb f4 <fa> 5d c3 cc cc cc cc 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90
[ 115.956643][ C1] RSP: 0018:ffff8881026ebdb0 EFLAGS: 00000246
[ 115.962829][ C1] RAX: ffff8881026d4180 RBX: ffffffff91286b50 RCX: 0000000000000001
[ 115.970895][ C1] RDX: ffff888103172864 RSI: ffffffff91286b50 RDI: ffff888103172864
[ 115.978952][ C1] RBP: ffff8881026ebdb0 R08: ffffea000000000f R09: 00000000000000ff
[ 115.987007][ C1] R10: ffff888101ed4182 R11: ffffffff8f78b590 R12: ffff888103dcf400
[ 115.995060][ C1] R13: ffffffff91286bd0 R14: 0000000000000001 R15: 0000000000000001
[ 116.003139][ C1] ? __pfx_acpi_idle_enter+0x10/0x10
[ 116.008538][ C1] acpi_idle_do_entry+0x22/0x40
[ 116.013513][ C1] acpi_idle_enter+0xa1/0xc0
[ 116.018199][ C1] cpuidle_enter_state+0xcb/0x250
[ 116.023340][ C1] cpuidle_enter+0x7f/0xf0
[ 116.027868][ C1] do_idle+0x551/0x750
[ 116.032019][ C1] cpu_startup_entry+0x65/0x80
[ 116.036863][ C1] ? __pfx_setup_secondary_APIC_clock+0x10/0x10
[ 116.043215][ C1] start_secondary+0xcb/0xd0
[ 116.047891][ C1] common_startup_64+0x12c/0x137
[ 116.052944][ C1] </TASK>
[ 116.056275][ C1] Kernel Offset: disabled
[ 116.060660][ C1] 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-2/linux/gopath/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/syzkaller/jobs-2/linux/gopath'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/syzkaller/jobs-2/linux/gopath/src/github.com/google/syzkaller/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1647276148=/tmp/go-build -gno-record-gcc-switches'

git status (err=<nil>)
HEAD detached at 25905f5d0a
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:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: 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
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
bin/syz-sysgen
touch .descriptions
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=25905f5d0a2a7883bd33491997556193582c6059 -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240301-171218'" "-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=25905f5d0a2a7883bd33491997556193582c6059 -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240301-171218'" "-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=25905f5d0a2a7883bd33491997556193582c6059 -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240301-171218'" "-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 -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w -DGOOS_linux=1 -DGOARCH_amd64=1 \
-DHOSTGOOS_linux=1 -DGIT_REVISION=\"25905f5d0a2a7883bd33491997556193582c6059\"


Error text is too large and was truncated, full error text is at:
https://syzkaller.appspot.com/x/error.txt?x=14f8680a980000


Tested on:

commit: 771ed661 Merge tag 'clk-fixes-for-linus' of git://git...
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel config: https://syzkaller.appspot.com/x/.config?x=b7d07bfd0c305fe4
dashboard link: https://syzkaller.appspot.com/bug?extid=3ae6be33a50b5aae4dab
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=16939696980000