Re: [viro-vfs:more.configfs] [configfs] 2bbdcd7eab: BUG:kernel_NULL_pointer_dereference,address
Al Viro <[email protected]> Fri, 5 Jun 2026 08:11:12 +0100
| Newsgroups | dev.linux.lists.oe-lkp,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <20260605071112.GD2636677@ZenIV> |
On Fri, Jun 05, 2026 at 01:52:28PM +0800, kernel test robot wrote:
>
>
>
> Hello,
>
> kernel test robot noticed "BUG:kernel_NULL_pointer_dereference,address" on:
>
> commit: 2bbdcd7eabfcd3a5bd2614ab75ece19323d5f4c2 ("configfs: attach the subtree only when it's completely built")
> https://git.kernel.org/cgit/linux/kernel/git/viro/vfs.git more.configfs
>
> in testcase: boot
>
> config: i386-randconfig-013-20260604
> compiler: gcc-14
> test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 32G
>
> (please refer to attached dmesg/kmsg for entire log/backtrace)
D'oh... Minimal incremental to deal with that would probably be something like
the delta below, but it's probably better to have configfs_add_subtree() return
the resulting dentry instead...
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index dacf0187f814..da5e554de58f 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -1448,7 +1448,7 @@ int configfs_register_group(struct config_group *parent_group,
if (!IS_ERR(child)) {
ret = configfs_add_subtree(group, NULL, child, frag);
if (!ret) {
- sd = child->d_fsdata;
+ sd = group->cg_item.ci_dentry->d_fsdata;
sd->s_type |= CONFIGFS_USET_DEFAULT;
}
simple_done_creating(child);