On 2021/05/31 17:50, Dmitry Vyukov wrote:
>> On 2021/05/27 21:19, joey.jiaojg wrote:
>>> Or we can add glob code like
>>> /sys/**/*:-/sys/power/state to exclude.
>>
>> Well, since /sys/ includes mount points for other filesystems such as
>> securityfs ( /sys/kernel/security/ ), debugfs ( /sys/kernel/debug/ )
>> and cgroup ( /sys/fs/cgroup/ ), just excluding this specific file is not
>> sufficient. I think we have to start from removing glob["/sys/**/*"] .
>
> FTR, Joey is working on support for excluding specific patterns from globs:
>
https://github.com/google/syzkaller/pull/2602
>
> I agree /sys/**/* may be too broad. On my machine /sys contains 82501
> files. But it's also hard for me to tell what exactly should be
> included/excluded. Do we know any definitely bad files/dirs?
> Or alternatively, we can just wait for more reports from syzbot when
> it opens something we don't want it to open. The benefit of working on
> testing :)
Despite commit 0740de696b19a870 ("all: support exclude globs in descriptor") was
already merged, this problem is still happening and now became 8th top crasher.
(From
https://syzkaller.appspot.com/text?tag=CrashLog&x=16335400300000 on 2021/06/23 12:33)
12:33:16 executing program 4:
r0 = openat$sysfs(0xffffff9c, &(0x7f0000000080)='/sys/power/state', 0x2, 0x0)
socket$inet_tcp(0x2, 0x1, 0x0)
r1 = openat$uinput(0xffffffffffffff9c, &(0x7f00000000c0), 0x805, 0x0)
write$uinput_user_dev(0xffffffffffffffff, &(0x7f0000000d00)={'syz0\x00'}, 0x45c)
ioctl$UI_DEV_SETUP(r1, 0x5501, 0x0)
ioctl$DRM_IOCTL_MODE_CREATE_LEASE(r0, 0xc01864c6, &(0x7f0000000140)={0x0, 0x0, 0x80000})
sendfile(r0, r0, &(0x7f0000000000)=0x7, 0xe)
12:33:17 executing program 3:
r0 = openat(0xffffffffffffff9c, &(0x7f0000000000)='/proc/self/exe\x00', 0x0, 0x0)
mmap(&(0x7f0000000000/0x800000)=nil, 0x800000, 0x1800003, 0x12, r0, 0x0)
preadv(r0, &(0x7f0000000280), 0x18, 0xd9f, 0x0)
openat(0xffffffffffffff9c, 0x0, 0x0, 0x0)
r1 = openat$sysfs(0xffffff9c, &(0x7f0000000080)='/sys/power/state', 0x2, 0x0)
sendfile(r1, r1, &(0x7f0000000000)=0x7, 0x3)
[ 567.403517][T24642] Freezing user space processes ... (elapsed 0.005 seconds) done.
[ 567.417787][T24642] OOM killer disabled.
[ 567.421866][T24642] Freezing remaining freezable tasks ... (elapsed 0.003 seconds) done.
[ 567.435178][T24642] printk: Suspending console(s) (use no_console_suspend to debug)
Why is openat$sysfs still opening /sys/power/state ? I think we are missing something...