Skip to contentSkip to conversation

configfs: fix refcount warning in configfs_get_config_item()

PATCH In review Joshua Crofts 3 participants 8 messages Jul 29 – Jul 30 configfs

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configfs: fix refcount warning in configfs_get_config_item()

syzbot reported a "refcount_t: addition on 0; use-after-free" warning in configfs_get_config_item().

This occurs when configfs_get_config_item() races with a concurrent teardown (e.g. rmdir). When the target config_item's refcount drops to 0, configfs_get_config_item() calls config_item_get(), which unconditionally increments the refcount via kref_get(), triggering the refcount warning.

Fix this by using config_item_get_unless_zero(), which safely returns NULL if the refcount is already 0.

---
 fs/configfs/configfs_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/configfs/configfs_internal.h +1 -1
index acdeea8e2..5448af3a8 100644
@@ -124,7 +124,7 @@ static inline struct config_item *configfs_get_config_item(struct dentry *dentry
 	spin_lock(&dentry->d_lock);
 	if (!d_unhashed(dentry)) {
 		struct configfs_dirent * sd = dentry->d_fsdata;
-		item = config_item_get(sd->s_element);
+		item = config_item_get_unless_zero(sd->s_element);
 	}
 	spin_unlock(&dentry->d_lock);
 
Signature · 1 line
2.47.3
#1 lore raw
Quoted 24 lines · On Wed, 29 Jul 2026 08:55:05 +0000 Joshua Crofts <[email protected]>…

syzbot reported a "refcount_t: addition on 0; use-after-free" warning in configfs_get_config_item().

This occurs when configfs_get_config_item() races with a concurrent teardown (e.g. rmdir). When the target config_item's refcount drops to 0, configfs_get_config_item() calls config_item_get(), which unconditionally increments the refcount via kref_get(), triggering the refcount warning.

Fix this by using config_item_get_unless_zero(), which safely returns NULL if the refcount is already 0.

---
 fs/configfs/configfs_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/configfs/configfs_internal.h +0 -0
index acdeea8e2..5448af3a8 100644

fs/configfs/configfs_internal.h static inline struct config_item *configfs_get_config_item(struct dentry *dentry · line 130

Quoted 8 lines
fs/configfs/configfs_internal.h +1 -1
@@ -124,7 +124,7 @@ static inline struct config_item *configfs_get_config_item(struct dentry *dentry
 	spin_lock(&dentry->d_lock);
 	if (!d_unhashed(dentry)) {
 		struct configfs_dirent * sd = dentry->d_fsdata;
-		item = config_item_get(sd->s_element);
+		item = config_item_get_unless_zero(sd->s_element);
 	}
 	spin_unlock(&dentry->d_lock);
 

Forgot to add a Fixes: tag so here it is, will respin if necessary:

Fixes e9c03af21cc7 ("configfs: calculate the symlink target only once")
Signature · 2 lines
Kind regards,
Joshua Crofts
#2 lore raw
Quoted 21 lines · On Wed, 29 Jul 2026 09:00 +0000 Joshua Crofts <[email protected]> wrote:
Quoted 18 lines · On Wed, 29 Jul 2026 08:55:05 +0000 Joshua Crofts <[email protected]>…

syzbot reported a "refcount_t: addition on 0; use-after-free" warning in configfs_get_config_item().

This occurs when configfs_get_config_item() races with a concurrent teardown (e.g. rmdir). When the target config_item's refcount drops to 0, configfs_get_config_item() calls config_item_get(), which unconditionally increments the refcount via kref_get(), triggering the refcount warning.

Fix this by using config_item_get_unless_zero(), which safely returns NULL if the refcount is already 0.

---
 fs/configfs/configfs_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

fs/configfs/configfs_internal.h static inline struct config_item *configfs_get_config_item(struct dentry *dentry · line 129

Quoted 12 lines
fs/configfs/configfs_internal.h +1 -1
index acdeea8e2..5448af3a8 100644
@@ -124,7 +124,7 @@ static inline struct config_item *configfs_get_config_item(struct dentry *dentry
 	spin_lock(&dentry->d_lock);
 	if (!d_unhashed(dentry)) {
 		struct configfs_dirent * sd = dentry->d_fsdata;
-		item = config_item_get(sd->s_element);
+		item = config_item_get_unless_zero(sd->s_element);
 	}
 	spin_unlock(&dentry->d_lock);

I tested this solution first on syzbot and well, it errored out. But on testing it on a local build, it seems to trigger a different warning in configfs_get() regarding atomic count. Could you please look into it?

Thanks,
Jeffin.

#3 lore raw
Quoted 24 lines · On Wed, 29 Jul 2026 15:21:25 +0530 Jeffin Philip <[email protected]>…
Quoted 21 lines · On Wed, 29 Jul 2026 09:00 +0000 Joshua Crofts <[email protected]> wrote:
Quoted 18 lines · On Wed, 29 Jul 2026 08:55:05 +0000 Joshua Crofts <[email protected]>…

syzbot reported a "refcount_t: addition on 0; use-after-free" warning in configfs_get_config_item().

This occurs when configfs_get_config_item() races with a concurrent teardown (e.g. rmdir). When the target config_item's refcount drops to 0, configfs_get_config_item() calls config_item_get(), which unconditionally increments the refcount via kref_get(), triggering the refcount warning.

Fix this by using config_item_get_unless_zero(), which safely returns NULL if the refcount is already 0.

---
 fs/configfs/configfs_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
fs/configfs/configfs_internal.h +0 -0
index acdeea8e2..5448af3a8 100644
Quoted 8 lines

fs/configfs/configfs_internal.h static inline struct config_item *configfs_get_config_item(struct dentry *dentry · line 129

Quoted 8 lines
fs/configfs/configfs_internal.h +1 -1
@@ -124,7 +124,7 @@ static inline struct config_item *configfs_get_config_item(struct dentry *dentry
 	spin_lock(&dentry->d_lock);
 	if (!d_unhashed(dentry)) {
 		struct configfs_dirent * sd = dentry->d_fsdata;
-		item = config_item_get(sd->s_element);
+		item = config_item_get_unless_zero(sd->s_element);
 	}
 	spin_unlock(&dentry->d_lock);  

I tested this solution first on syzbot and well, it errored out. But on testing it on a local build, it seems to trigger a different warning in configfs_get() regarding atomic count. Could you please look into it?

Yeah, I've no idea why syzbot keeps failing on "FATAL: Kernel too old", especially when testing against upstream. As for the different warning, that's odd, because when I booted the kernel with the patch in QEMU and ran the reproducer nothing happened. Could you please send the warning in it's entirety?

Signature · 2 lines
Kind regards,
Joshua Crofts
maintainer
#4 lore raw
In reply to Joshua Crofts
Quoted 8 lines · Joshua Crofts

syzbot reported a "refcount_t: addition on 0; use-after-free" warning in configfs_get_config_item().

This occurs when configfs_get_config_item() races with a concurrent teardown (e.g. rmdir). When the target config_item's refcount drops to 0, configfs_get_config_item() calls config_item_get(), which unconditionally increments the refcount via kref_get(), triggering the refcount warning.

Shouldn't be this the fix we are interested in fixing?

Quoted 2 lines

Fix this by using config_item_get_unless_zero(), which safely returns NULL if the refcount is already 0.

This looks like more a workaround than a proper fix, no?

I got the impression that we have a UAF behind this refcount issue, and this is not being solved by this patch.

#5 lore raw
Quoted 12 lines · On Wed, 29 Jul 2026 03:06:09 -0700 Breno Leitao <[email protected]> wrote:
Quoted 8 lines · Joshua Crofts

syzbot reported a "refcount_t: addition on 0; use-after-free" warning in configfs_get_config_item().

This occurs when configfs_get_config_item() races with a concurrent teardown (e.g. rmdir). When the target config_item's refcount drops to 0, configfs_get_config_item() calls config_item_get(), which unconditionally increments the refcount via kref_get(), triggering the refcount warning.

Shouldn't be this the fix we are interested in fixing?

Quoted 7 lines
Quoted 2 lines

Fix this by using config_item_get_unless_zero(), which safely returns NULL if the refcount is already 0.

This looks like more a workaround than a proper fix, no?

I got the impression that we have a UAF behind this refcount issue, and this is not being solved by this patch.

Okay, so my interpretation was that this is a concurrency issue that's causing the UAF by incrementing a 0 refcount. Isn't this exactly the reason that config_item_get_unless_zero() was implemented? If the refcount is 0 then it just returns -ENOENT.

Signature · 2 lines
Kind regards,
Joshua Crofts
#6 lore raw
Quoted 44 lines · On Wed, 29 Jul 2026 15:50:00 +0200 Joshua Crofts <[email protected]>…
Quoted 24 lines · On Wed, 29 Jul 2026 15:21:25 +0530 Jeffin Philip <[email protected]>…
Quoted 21 lines · On Wed, 29 Jul 2026 09:00 +0000 Joshua Crofts <[email protected]> wrote:
Quoted 18 lines · On Wed, 29 Jul 2026 08:55:05 +0000 Joshua Crofts <[email protected]>…

syzbot reported a "refcount_t: addition on 0; use-after-free" warning in configfs_get_config_item().

This occurs when configfs_get_config_item() races with a concurrent teardown (e.g. rmdir). When the target config_item's refcount drops to 0, configfs_get_config_item() calls config_item_get(), which unconditionally increments the refcount via kref_get(), triggering the refcount warning.

Fix this by using config_item_get_unless_zero(), which safely returns NULL if the refcount is already 0.

---
 fs/configfs/configfs_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
fs/configfs/configfs_internal.h +0 -0
index acdeea8e2..5448af3a8 100644
Quoted 8 lines

fs/configfs/configfs_internal.h static inline struct config_item *configfs_get_config_item(struct dentry *dentry · line 129

Quoted 8 lines
fs/configfs/configfs_internal.h +1 -1
@@ -124,7 +124,7 @@ static inline struct config_item *configfs_get_config_item(struct dentry *dentry
 	spin_lock(&dentry->d_lock);
 	if (!d_unhashed(dentry)) {
 		struct configfs_dirent * sd = dentry->d_fsdata;
-		item = config_item_get(sd->s_element);
+		item = config_item_get_unless_zero(sd->s_element);
 	}
 	spin_unlock(&dentry->d_lock);  

I tested this solution first on syzbot and well, it errored out. But on testing it on a local build, it seems to trigger a different warning in configfs_get() regarding atomic count. Could you please look into it?

Quoted 5 lines

Yeah, I've no idea why syzbot keeps failing on "FATAL: Kernel too old", especially when testing against upstream. As for the different warning, that's odd, because when I booted the kernel with the patch in QEMU and ran the reproducer nothing happened. Could you please send the warning in it's entirety?

I assume you did not set panic_on_warn to 1. Try setting it first and re-run the reproducer. I would also encourage you to copy the .config file from syzbot and build the kernel yourself to test apart from using the prebuilt bzImage. Also as Breno said, this is more of a workaround, you could attempt to drop the dentry immediately after unlinking the group and then attempt to hold an extra reference(?) to the path and then safely free it later.

Anyway, here is the warning and call trace:

[   44.009410][ T9943] ------------[ cut here ]------------
[   44.009414][ T9943] !atomic_read(&sd->s_count)
[   44.009417][ T9943] WARNING: fs/configfs/configfs_internal.h:147 at configfs_symlink+0xe1c/0x1030, CPU#1: refcount/9943
[   44.009429][ T9943] Modules linked in:
[   44.009437][ T9943] CPU: 1 UID: 0 PID: 9943 Comm: refcount Tainted: G    B   W           7.2.0-rc4-00365-g48a5a7ab8d6a-dirty #16 PREEMPT_{RT,(full)} 
[   44.009445][ T9943] Tainted: [B]=BAD_PAGE, [W]=WARN
[   44.009447][ T9943] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.17.0-10.fc44 06/10/2025
[   44.009450][ T9943] RIP: 0010:configfs_symlink+0xe1c/0x1030
[   44.009455][ T9943] Code: ba bb 5b ff e9 0b f6 ff ff e8 b0 bb 5b ff 48 c7 c7 e0 54 18 8e e8 24 0f bf 08 e9 f0 f5 ff ff e8 0a c9 bc 08 e8 95 bb 5b ff 90 <0f> 0b 90 e9 8d f8 ff ff e8 87 bb 5b ff 90 0f 0b 90 e9 f
[   44.009460][ T9943] RSP: 0018:ffffc90021e1fc80 EFLAGS: 00010293
[   44.009465][ T9943] RAX: ffffffff82683b0b RBX: 0000000000000000 RCX: ffff888028f11f40
[   44.009469][ T9943] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[   44.009473][ T9943] RBP: ffffc90021e1fd88 R08: 0000000000000000 R09: 0000000000000000
[   44.009476][ T9943] R10: dffffc0000000000 R11: ffffed1004074d31 R12: dffffc0000000000
[   44.009480][ T9943] R13: ffff8880203a6980 R14: ffffffff8bff9748 R15: 1ffff920043c3fa0
[   44.009484][ T9943] FS:  00007fbc46816780(0000) GS:ffff8881db474000(0000) knlGS:0000000000000000
[   44.009488][ T9943] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   44.009492][ T9943] CR2: 0000200000000000 CR3: 000000010e746000 CR4: 0000000000752ef0
[   44.009498][ T9943] PKRU: 55555554
[   44.009500][ T9943] Call Trace:
[   44.009502][ T9943]  <TASK>
[   44.009506][ T9943]  ? __pfx_configfs_symlink+0x10/0x10
[   44.009511][ T9943]  ? bpf_lsm_inode_symlink+0x9/0x20
[   44.009518][ T9943]  vfs_symlink+0x18b/0x330
[   44.009523][ T9943]  ? security_path_symlink+0xfd/0x360
[   44.009529][ T9943]  filename_symlinkat+0x1cd/0x420
[   44.009534][ T9943]  ? __might_fault+0xcb/0x130
[   44.009540][ T9943]  ? __pfx_filename_symlinkat+0x10/0x10
[   44.009544][ T9943]  ? do_getname+0x151/0x250
[   44.009549][ T9943]  ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   44.009555][ T9943]  __se_sys_symlinkat+0x4e/0x2b0
[   44.009559][ T9943]  ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   44.009562][ T9944] Mass Storage Function, version: 2009/09/11
[   44.009564][ T9943]  do_syscall_64+0x174/0x580
[   44.009569][ T9944] LUN: removable file: (no medium)
[   44.009572][ T9943]  ? trace_irq_disable+0x3b/0x140
[   44.009579][ T9943]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   44.009583][ T9943] RIP: 0033:0x7fbc46917fa9
[   44.009588][ T9943] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f 1e 0d 00 f7 d8 8
[   44.009592][ T9943] RSP: 002b:00007ffcb1d8ec68 EFLAGS: 00000287 ORIG_RAX: 000000000000010a
[   44.009598][ T9943] RAX: ffffffffffffffda RBX: 00007ffcb1d8edc8 RCX: 00007fbc46917fa9
[   44.009601][ T9943] RDX: 0000200000000300 RSI: 00000000ffffff9c RDI: 0000200000000200
[   44.009605][ T9943] RBP: 00007ffcb1d8ec70 R08: 00007ffcb1d8eca0 R09: 00007ffcb1d8eca0
[   44.009616][ T9943] R10: 00007ffcb1d8eca0 R11: 0000000000000287 R12: 0000000000000000
[   44.009620][ T9943] R13: 00007ffcb1d8edd8 R14: 00007fbc46a38000 R15: 0000000000402e00
[   44.009625][ T9943]  </TASK>
[   44.009628][ T9943] Kernel panic - not syncing: kernel: panic_on_warn set ...
[   44.009632][ T9943] CPU: 1 UID: 0 PID: 9943 Comm: refcount Tainted: G    B   W           7.2.0-rc4-00365-g48a5a7ab8d6a-dirty #16 PREEMPT_{RT,(full)} 
[   44.009640][ T9943] Tainted: [B]=BAD_PAGE, [W]=WARN
[   44.009642][ T9943] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.17.0-10.fc44 06/10/2025
[   44.009644][ T9943] Call Trace:
[   44.009646][ T9943]  <TASK>
[   44.009648][ T9943]  vpanic+0x56c/0xa60
[   44.009653][ T9943]  ? __pfx__printk+0x10/0x10
[   44.009659][ T9943]  ? __pfx_vpanic+0x10/0x10
[   44.009663][ T9943]  ? is_bpf_text_address+0x292/0x2b0
[   44.009670][ T9943]  ? is_bpf_text_address+0x26/0x2b0
[   44.009678][ T9943]  panic+0xc5/0xd0
[   44.009682][ T9943]  ? __pfx_panic+0x10/0x10
[   44.009688][ T9943]  __warn+0x315/0x4c0
[   44.009692][ T9943]  ? configfs_symlink+0xe1c/0x1030
[   44.009698][ T9943]  ? configfs_symlink+0xe1c/0x1030
[   44.009703][ T9943]  __report_bug+0x276/0x570
[   44.009709][ T9943]  ? configfs_symlink+0xe1c/0x1030
[   44.009715][ T9943]  ? __pfx___report_bug+0x10/0x10
[   44.009722][ T9943]  ? configfs_symlink+0xe1c/0x1030
[   44.009727][ T9943]  report_bug+0x16a/0x220
[   44.009734][ T9943]  ? configfs_symlink+0xe1c/0x1030
[   44.009739][ T9943]  ? configfs_symlink+0xe1e/0x1030
[   44.009743][ T9943]  handle_bug+0x9c/0x200
[   44.009748][ T9943]  exc_invalid_op+0x1a/0x50
[   44.009753][ T9943]  asm_exc_invalid_op+0x1a/0x20
[   44.009757][ T9943] RIP: 0010:configfs_symlink+0xe1c/0x1030
[   44.009763][ T9943] Code: ba bb 5b ff e9 0b f6 ff ff e8 b0 bb 5b ff 48 c7 c7 e0 54 18 8e e8 24 0f bf 08 e9 f0 f5 ff ff e8 0a c9 bc 08 e8 95 bb 5b ff 90 <0f> 0b 90 e9 8d f8 ff ff e8 87 bb 5b ff 90 0f 0b 90 e9 f
[   44.009767][ T9943] RSP: 0018:ffffc90021e1fc80 EFLAGS: 00010293
[   44.009771][ T9943] RAX: ffffffff82683b0b RBX: 0000000000000000 RCX: ffff888028f11f40
[   44.009775][ T9943] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[   44.009778][ T9943] RBP: ffffc90021e1fd88 R08: 0000000000000000 R09: 0000000000000000
[   44.009781][ T9943] R10: dffffc0000000000 R11: ffffed1004074d31 R12: dffffc0000000000
[   44.009785][ T9943] R13: ffff8880203a6980 R14: ffffffff8bff9748 R15: 1ffff920043c3fa0
[   44.009790][ T9943]  ? configfs_symlink+0xe1b/0x1030
[   44.009796][ T9943]  ? __pfx_configfs_symlink+0x10/0x10
[   44.009801][ T9943]  ? bpf_lsm_inode_symlink+0x9/0x20
[   44.009807][ T9943]  vfs_symlink+0x18b/0x330
[   44.009811][ T9943]  ? security_path_symlink+0xfd/0x360
[   44.009817][ T9943]  filename_symlinkat+0x1cd/0x420
[   44.009821][ T9943]  ? __might_fault+0xcb/0x130
[   44.009827][ T9943]  ? __pfx_filename_symlinkat+0x10/0x10
[   44.009832][ T9943]  ? do_getname+0x151/0x250
[   44.009836][ T9943]  ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   44.009841][ T9943]  __se_sys_symlinkat+0x4e/0x2b0
[   44.009846][ T9943]  ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   44.009851][ T9943]  do_syscall_64+0x174/0x580
[   44.009857][ T9943]  ? trace_irq_disable+0x3b/0x140
[   44.009863][ T9943]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   44.009868][ T9943] RIP: 0033:0x7fbc46917fa9
[   44.009871][ T9943] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f 1e 0d 00 f7 d8 8
[   44.009875][ T9943] RSP: 002b:00007ffcb1d8ec68 EFLAGS: 00000287 ORIG_RAX: 000000000000010a
[   44.009880][ T9943] RAX: ffffffffffffffda RBX: 00007ffcb1d8edc8 RCX: 00007fbc46917fa9
[   44.009884][ T9943] RDX: 0000200000000300 RSI: 00000000ffffff9c RDI: 0000200000000200
[   44.009888][ T9943] RBP: 00007ffcb1d8ec70 R08: 00007ffcb1d8eca0 R09: 00007ffcb1d8eca0
[   44.009891][ T9943] R10: 00007ffcb1d8eca0 R11: 0000000000000287 R12: 0000000000000000
[   44.009895][ T9943] R13: 00007ffcb1d8edd8 R14: 00007fbc46a38000 R15: 0000000000402e00
[   44.009900][ T9943]  </TASK>
[   44.010148][ T9943] Kernel Offset: disabled

Let me know about your approach to fixing this.

Thanks,
Jeffin.

#7 lore raw
Quoted 10 lines · On Wed, 29 Jul 2026 20:35:25 +0530 Jeffin Philip <[email protected]>…
Quoted 9 lines
Quoted 3 lines

I tested this solution first on syzbot and well, it errored out. But on testing it on a local build, it seems to trigger a different warning in configfs_get() regarding atomic count. Could you please look into it?

Yeah, I've no idea why syzbot keeps failing on "FATAL: Kernel too old", especially when testing against upstream. As for the different warning, that's odd, because when I booted the kernel with the patch in QEMU and ran the reproducer nothing happened. Could you please send the warning in it's entirety?

Quoted 8 lines

I assume you did not set panic_on_warn to 1. Try setting it first and re-run the reproducer. I would also encourage you to copy the .config file from syzbot and build the kernel yourself to test apart from using the prebuilt bzImage. Also as Breno said, this is more of a workaround, you could attempt to drop the dentry immediately after unlinking the group and then attempt to hold an extra reference(?) to the path and then safely free it later.

Yes, the kernel was build with the .config from syzbot but my script had panic_on_warn set to zero. Anyhow - ran the reproducer and got a slab-use-after-free instead :(

[   42.758574][ T5767] BUG: KASAN: slab-use-after-free in configfs_dirent_is_ready+0x6b/0x70
[   42.758655][ T5767] Read of size 4 at addr ffff88804b241fb8 b[   42.758655][ T5767] Read of size 4 at addr ffff88804b241fb8 by task repro/5767
[   42.758661][ T5767] 
[   42.758695][ T5767] CPU: 0 UID: 0 PID: 5767 Comm: repro Not tainted 7.2.0-rc3-g6291aad4984e #8 PREEMPT_{RT,(full)} 
[   42.758705][ T5767] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   42.758710][ T5767] Call Trace:
[   42.758714][ T5767]  <TASK>
[   42.758717][ T5767]  dump_stack_lvl+0x100/0x190
[   42.758727][ T5767]  print_report+0x13d/0x4b0
[   42.758738][ T5767]  ? __virt_addr_valid+0x239/0x430
[   42.758748][ T5767]  ? configfs_dirent_is_ready+0x6b/0x70
[   42.758755][ T5767]  kasan_report+0xdf/0x1c0
[   42.758765][ T5767]  ? configfs_dirent_is_ready+0x6b/0x70
[   42.758773][ T5767]  configfs_dirent_is_ready+0x6b/0x70
[   42.758832][ T5767]  configfs_symlink+0x5c4/0x11f0
[   42.758840][ T5767]  ? bpf_lsm_inode_permission+0x9/0x10
[   42.758849][ T5767]  ? security_inode_permission+0xbf/0x250
[   42.758857][ T5767]  ? __pfx_configfs_symlink+0x10/0x10
[   42.758866][ T5767]  vfs_symlink+0x178/0x4e0
[   42.758875][ T5767]  filename_symlinkat+0x2a6/0x570
[   42.758888][ T5767]  ? __pfx_filename_symlinkat+0x10/0x10
[   42.758901][ T5767]  ? strncpy_from_user+0x19d/0x2d0
[   42.758911][ T5767]  ? do_getname+0x191/0x390
[   42.758918][ T5767]  __x64_sys_symlinkat+0x9c/0xe0
[   42.758931][ T5767]  do_syscall_64+0x115/0x840
[   42.758958][ T5767]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   42.758967][ T5767] RIP: 0033:0x416df9
[   42.758973][ T5767] Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 f0 ff ff ff f7 d8 64 89 01 48
[   42.759021][ T5767] RSP: 002b:00007ffe2756add8 EFLAGS: 00000287 ORIG_RAX: 000000000000010a
[   42.759030][ T5767] RAX: ffffffffffffffda RBX: 00007ffe2756af48 RCX: 0000000000416df9
[   42.759035][ T5767] RDX: 0000200000000300 RSI: 00000000ffffff9c RDI: 0000200000000200
[   42.759040][ T5767] RBP: 00007ffe2756ade0 R08: 00007ffe2756ae10 R09: 00007ffe2756ae10
[   42.759045][ T5767] R10: 00007ffe2756ae10 R11: 0000000000000287 R12: 00007ffe2756af38
[   42.759050][ T5767] R13: 0000000000000002 R14: 00000000004a3de0 R15: 0000000000000002
[   42.759058][ T5767]  </TASK>
[   42.759060][ T5767] 
[   42.759062][ T5767] Allocated by task 5764:
[   42.759068][ T5767]  kasan_save_stack+0x30/0x50
[   42.759075][ T5767]  kasan_save_track+0x14/0x30
[   42.759081][ T5767]  __kasan_slab_alloc+0x89/0x90
[   42.759088][ T5767]  kmem_cache_alloc_noprof+0x20e/0x6c0
[   42.759095][ T5767]  configfs_new_dirent+0x52/0x570
[   42.759105][ T5767]  configfs_make_dirent+0x36/0x1a0
[   42.759116][ T5767]  configfs_create_dir+0xbd/0x5c0
[   42.759127][ T5767]  configfs_attach_group+0x2a/0x440
[   42.759138][ T5767]  configfs_mkdir+0x65c/0xb70
[   42.759149][ T5767]  vfs_mkdir+0x361/0x860
[   42.759156][ T5767]  filename_mkdirat+0x491/0x5f0
[   42.759167][ T5767]  __x64_sys_mkdirat+0x89/0xc0
[   42.759177][ T5767]  do_syscall_64+0x115/0x840
[   42.759184][ T5767]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   42.759191][ T5767] 
[   42.759192][ T5767] Freed by task 5764:
[   42.759195][ T5767]  kasan_save_stack+0x30/0x50
[   42.759201][ T5767]  kasan_save_track+0x14/0x30
[   42.759207][ T5767]  kasan_save_free_info+0x3b/0x70
[   42.759216][ T5767]  __kasan_slab_free+0x5f/0x80
[   42.759223][ T5767]  kmem_cache_free+0x123/0x6a0
[   42.759245][ T5767]  configfs_d_iput+0x20d/0x290
[   42.759254][ T5767]  dentry_unlink_inode+0x265/0x470
[   42.759265][ T5767]  d_delete+0x213/0x280
[   42.759270][ T5767]  vfs_rmdir+0x4ab/0x8b0
[   42.759278][ T5767]  filename_rmdir+0x31a/0x5d0
[   42.759288][ T5767]  __x64_sys_rmdir+0x46/0x70
[   42.759298][ T5767]  do_syscall_64+0x115/0x840
[   42.759305][ T5767]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   42.759312][ T5767] 
[   42.759313][ T5767] The buggy address belongs to the object at ffff88804b241f80
[   42.759313][ T5767]  which belongs to the cache configfs_dir_cache of size 96
[   42.759319][ T5767] The buggy address is located 56 bytes inside of
[   42.759319][ T5767]  freed 96-byte region [ffff88804b241f80, ffff88804b241fe0)
[   42.759326][ T5767] 
[   42.759327][ T5767] The buggy address belongs to the physical page:
[   42.759331][ T5767] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4b241
[   42.759339][ T5767] flags: 0x480000000000000(node=1|zone=1)
[   42.759344][ T5767] page_type: f5(slab)
[   42.759351][ T5767] raw: 0480000000000000 ffff888040417780 dead000000000122 0000000000000000
[   42.759393][ T5767] raw: 0000000000000000 0000000800200020 00000000f5000000 0000000000000000
[   42.759397][ T5767] page dumped because: kasan: bad access detected
[   42.759401][ T5767] page_owner tracks the page as allocated
[   42.759403][ T5767] page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5755, tgid 5755 (repro), ts 42727601277, free_ts 42589616669
[   42.759416][ T5767]  post_alloc_hook+0xfd/0x120
[   42.759426][ T5767]  get_page_from_freelist+0xcb6/0x3400
[   42.759436][ T5767]  __alloc_frozen_pages_noprof+0x299/0x2f60
[   42.759446][ T5767]  new_slab+0xa2/0x660
[   42.759455][ T5767]  refill_objects+0xe3/0x460
[   42.759465][ T5767]  __pcs_replace_empty_main+0x17a/0x6d0
[   42.759483][ T5767]  kmem_cache_alloc_noprof+0x4fd/0x6c0
[   42.759490][ T5767]  configfs_new_dirent+0x52/0x570
[   42.759499][ T5767]  configfs_make_dirent+0x36/0x1a0
[   42.759509][ T5767]  configfs_create_file+0xfe/0x180
[   42.759518][ T5767]  configfs_attach_item.part.0+0x147/0x4f0
[   42.759529][ T5767]  configfs_attach_group+0x63/0x440
[   42.759540][ T5767]  create_default_group+0x75/0x180
[   42.759550][ T5767]  configfs_attach_group+0x212/0x440
[   42.759561][ T5767]  configfs_mkdir+0x65c/0xb70
[   42.759571][ T5767]  vfs_mkdir+0x361/0x860
[   42.759578][ T5767] page last free pid 20 tgid 20 stack trace:
[   42.759581][ T5767]  __free_frozen_pages+0x95e/0x1600
[   42.759590][ T5767]  rcu_core+0x5ef/0x1170
[   42.759599][ T5767]  rcu_cpu_kthread+0x1fa/0x410
[   42.759608][ T5767]  smpboot_thread_fn+0x3d3/0xaa0
[   42.759616][ T5767]  kthread+0x370/0x450
[   42.759625][ T5767]  ret_from_fork+0x72b/0xd50
[   42.759634][ T5767]  ret_from_fork_asm+0x1a/0x30
[   42.759644][ T5767] 
[   42.759645][ T5767] Memory state around the buggy address:
[   42.759649][ T5767]  ffff88804b241e80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
[   42.759653][ T5767]  ffff88804b241f00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
[   42.759672][ T5767] >ffff88804b241f80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
[   42.759675][ T5767]                                         ^
[   42.759679][ T5767]  ffff88804b242000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   42.759684][ T5767]  ffff88804b242080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   42.759687][ T5767] ==================================================================
[   42.763360][ T5767] Kernel panic - not syncing: KASAN: panic_on_warn set ...
Signature · 2 lines
Kind regards,
Joshua Crofts