Re: loop: WARNING in sysfs_remove_group

From: Ming Lei
Date: Thu Mar 23 2017 - 12:03:07 EST


On Thu, Mar 23, 2017 at 03:09:44PM +0100, Dmitry Vyukov wrote:
> Hello,
>
> I've got the following WARNING while running syzkaller on
> 093b995e3b55a0ae0670226ddfcb05bfbf0099ae. Note the preceding injected
> kmalloc failure, most likely it's the root cause.
>
> FAULT_INJECTION: forcing a failure.
> name failslab, interval 1, probability 0, space 0, times 0
> CPU: 3 PID: 21172 Comm: syz-executor4 Not tainted 4.11.0-rc3+ #364
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> Call Trace:
> __dump_stack lib/dump_stack.c:16 [inline]
> dump_stack+0x1b8/0x28d lib/dump_stack.c:52
> fail_dump lib/fault-inject.c:45 [inline]
> should_fail+0x78a/0x870 lib/fault-inject.c:154
> should_failslab+0xec/0x120 mm/failslab.c:31
> slab_pre_alloc_hook mm/slab.h:434 [inline]
> slab_alloc mm/slab.c:3394 [inline]
> kmem_cache_alloc+0x200/0x720 mm/slab.c:3570
> kmem_cache_zalloc include/linux/slab.h:653 [inline]
> __kernfs_new_node+0xd1/0x430 fs/kernfs/dir.c:629
> kernfs_new_node+0x80/0xf0 fs/kernfs/dir.c:661
> kernfs_create_dir_ns+0x41/0x140 fs/kernfs/dir.c:933
> kernfs_create_dir include/linux/kernfs.h:477 [inline]
> internal_create_group+0xf7/0x8f0 fs/sysfs/group.c:124
> sysfs_create_group+0x1f/0x30 fs/sysfs/group.c:156
> loop_sysfs_init drivers/block/loop.c:802 [inline]

Looks we should have handled failure of loop_sys_init().

Thanks,
Ming