| 0/0 |
2026/07/01 00:23 |
flow |
assessment-security |
23m
Results: map[DenialOfService:true Explanation:**Analysis of the Bug:**
The bug is a deadlock in the JFS filesystem's metapage handling, specifically in
`__get_metapage()`.
When `__get_metapage()` is called to read an existing metadata block (with `new
= 0`), it first locks the folio associated with the block. If it finds that the
metapage has the `META_discard` flag set, it considers this an error condition.
This scenario typically occurs when interacting with a corrupted or maliciously
crafted filesystem image where a directory or tree pointer points to a
previously freed/discarded block.
In this error path, `__get_metapage()` calls `discard_metapage(mp)`, which in
turn calls `release_metapage(mp)`. However, `release_metapage(mp)` attempts to
acquire the folio lock (`folio_lock(folio)`) before unlocking the metapage.
Since `__get_metapage()` already holds the folio lock, this results in a
self-deadlock. The task hangs indefinitely in the `D` (uninterruptible sleep)
state waiting for the lock it already holds.
**Security Impact:**
* **Denial of Service (True):** The deadlock causes the task to hang
indefinitely. In the provided syzbot trace, the task doing `chdir` hangs while
holding the `inode_lock_shared` (read lock on the directory's `i_rwsem`). Any
other task attempting to modify or lock the directory (such as the other task in
the trace attempting a `mount` and waiting for the write lock) will also hang,
leading to a local denial of service.
* **Exploitable (False):** This is a pure locking issue (deadlock). It does not
lead to memory corruption, use-after-free, out-of-bounds access, or information
leaks. It cannot be used for privilege escalation.
* **Malicious Filesystem & Peripheral Trigger (True):** The bug is triggered by
mounting and accessing a maliciously crafted JFS filesystem image. This can
happen if a user plugs in an untrusted USB drive containing a corrupted JFS
image and the system auto-mounts it, or if an administrator is tricked into
mounting it.
* **Accessible From Unprivileged Processes / User Namespaces (False):** The JFS
filesystem does not have the `FS_USERNS_MOUNT` flag. This means it cannot be
mounted by unprivileged users, even within a user namespace. A user must have
`CAP_SYS_ADMIN` in the initial namespace to mount a JFS image. Therefore, an
unprivileged user cannot trigger this bug on their own without the help of an
administrator or an auto-mount daemon. Exploitable:false FilesystemTrigger:true NetworkTrigger:false PeripheralTrigger:true RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 1/1 |
2026/07/01 00:23 |
action |
syz-repro-to-c-repro |
0m
Results:
|
| 2/1 |
2026/07/01 00:23 |
action |
kernel-checkouter |
0m
Results: map[KernelSrc:/app/workdir/cache/src/7be5f73ee7b4d1978813accf8bb54cd892ccd800]
|
| 3/1 |
2026/07/01 00:23 |
action |
kernel-builder |
13m
Results: map[KernelObj:/app/workdir/cache/build/2ba2e838bc5bd125055e7f7b7f28b9592a389426]
|
| 4/1 |
2026/07/01 00:36 |
action |
codesearch-prepare |
9m
Results: map[Index:codesearch-index]
|
| 5/1 |
2026/07/01 00:46 |
agent |
expert |
1m
Model:
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:true NetworkTrigger:false PeripheralTrigger:true RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
Instruction: You are an experienced Linux kernel security engineer. Your task is to analyze given kernel bug report
and determine its security impact based on the following dimensions.
Use the provided tools to examine the source code, check for capability checks (e.g., capable(), ns_capable()),
and understand the nature of the bug. Analyze the given kernel build and configuration.
You can check the kernel config by grepping ".config" file; you can check kernel cmdline by grepping
".config" file for "CONFIG_CMDLINE=". Assume sysctl parameters have default values.
But analyze for the corresponding production build w/o debugging tools enabled (like KASAN, KMSAN, UBSAN).
Try different strategies when analyzing the bug:
- think of ways in which the vulnerable code is unreachable
- or the other way around: try to come up with different ideas of how an unprivileged user can reach the bug
If still unsure err on the side of the bug being non-exploitable/not-accessible.
In the final reply, provide a reasoning for your assessment.
Analysis dimensions:
* Exploitable:
Determine if the bug can result in memory corruption, elevated privileges, or an information leak.
Memory safety issues are almost always exploitable (KASAN or UBSAN reports for use-after-free, out-of-bounds;
refcounting issues, corrupted lists, etc). When kernel is crashing on a completely wild pointer access
(e.g. user-space address, or non-canonical address, but not on NULL or address corresponding to KASAN shadow
for NULL address), including both data accesses and control transfers, that also usually implies possibility
of exploitation. Such reports usually say "unable to handle kernel paging request".
Uses of uninitialized values detected by KMSAN may be exploitable b/c attacker frequently can affect uninit
values with spraying techniques. However, for these exploitability depends on how exactly the uninit value
is used in the code, and what it affects.
Information leaks are exploitable on their own and should be classified as such. A bug that copies kernel
memory contents to userspace (e.g. an out-of-bounds read whose result is returned to the caller, or
uninitialized stack/heap bytes written to a user buffer) is exploitable: it can reveal kernel pointer
values and defeat KASLR, expose sensitive data such as cryptographic keys or other processes' memory, and
serves as a necessary building block in most modern kernel privilege-escalation exploit chains. Do not classify
an information leak as non-exploitable solely because it does not directly cause a memory write or control-flow
hijack; the leak itself is the exploit primitive.
Think of what happens after the bug is triggered. Some bugs cause kernel panic and halt execution,
they are harder to exploit. For example, BUG reports halts the kernel. However, WARNING reports don't halt
execution in production builds. Debug bug detection tools (like KASAN, KMSAN, KCSAN, UBSAN) are also not enabled
in production builds, so attacker can freely exploit these bugs w/o being detected by these tools.
If you see an integer overflow, think how the overflowed value used later (if it's used as allocation size,
or an array index). If you see an out-of-bounds read, think if it's followed by an out-of-bounds write as well.
Some KCSAN data-races may be exploitable by skilled attackers as well. Think what data structures got corrupted
as the result of data races and how. However, note that kernel has lots of "benign" data races that don't lead
to any runtime misbehavior at all.
* Denial Of Service:
Determine if the bug can result in denial-of-service. Most bugs can, since they cause system crash,
hangs, deadlocks, or resource leaks. This is mostly applicable to WARNING bugs that won't cause system crash
in production. For these think what will be consequences of the violation of the kernel assumptions flagged
by the WARNING. In some cases the unexpected condition is also properly handled by the normal control flow
(e.g. with "if (WARN_ON(...))"), these won't cause denial-of-service. If the condition is not handled,
then it may or may not cause denial-of-service.
* Accessible From Unprivileged Processes:
Determine if the bug can be reached from a typical (non-root) user process that does NOT have any special capabilities
(like CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON) or access to device nodes restricted to root.
Assume that unprivileged_bpf_disabled=1, that is eBPF loading is not accessible. However, cBPF (classical BPF)
is still accessible to non-root processes.
Assume that user namespaces are not accessible, that is, the process cannot get the mentioned capabilities even
within a new user namespace (checked by ns_capable() function in the kernel sources).
* Accessible From User Namespaces:
Determine if the bug can be reached within a user-namespace where the process has all capabilities
(including CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON). Such capabilities are checked with ns_capable()
function in the kernel sources.
* VM Guest Trigger:
Determine if the bug can be triggered from the context of a typical KVM guest (e.g., set up by a QEMU VMM).
Consider accesses to standard Linux host paravirtualized features (virtio-blk, virtio-net, etc.),
and handling of VM exits in the KVM code.
* VM Host Trigger in The Confidential Computing Context:
Determine if the bug can be triggered in a confidential computing guest kernel from the context of a KVM host.
Consider access to standard Linux guest paravirtualized features (virtio-blk, virtio-net, etc.).
* Ethernet Network Trigger:
Determine if the bug can be triggered by processing ingress network Ethernet traffic, either directly (network stack)
or via drivers exposed to network data.
* Other Remote Trigger:
Determine if the bug can be triggered by processing remote traffic other than Ethernet (Wifi, Bluetooth, NFC, etc).
* Peripheral Trigger:
Determine if the bug can be triggered via an untrusted peripheral device that can be physically plugged
into a system, such as a USB device or a niche hardware driver handling external hardware inputs.
This is particularly important for mobile and desktop environments where users can plug in unknown devices.
* Malicious Filesystem Trigger:
Determine if the bug can be triggered by the kernel mounting and parsing a malicious filesystem image.
This is highly critical for Desktop and Mobile environments where external media or downloaded images
might be auto-mounted.
Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt:
The kernel bug report is:
INFO: task syz.3.49:6040 blocked for more than 143 seconds.
Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.3.49 state:D stack:25032 pid:6040 tgid:6037 ppid:5600 task_flags:0x400140 flags:0x00080002
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5510 [inline]
__schedule+0x16dc/0x5500 kernel/sched/core.c:7234
__schedule_loop kernel/sched/core.c:7311 [inline]
rt_mutex_schedule+0x76/0xf0 kernel/sched/core.c:7607
rwbase_write_lock+0x3cf/0x720 kernel/locking/rwbase_rt.c:279
inode_lock include/linux/fs.h:1024 [inline]
do_lock_mount+0x2a4/0x970 fs/namespace.c:2768
do_new_mount_fc fs/namespace.c:3783 [inline]
do_new_mount+0x478/0xdc0 fs/namespace.c:3841
do_mount fs/namespace.c:4174 [inline]
__do_sys_mount fs/namespace.c:4390 [inline]
__se_sys_mount+0x31d/0x420 fs/namespace.c:4367
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7fe2e0ce59
RSP: 002b:00007f7fe1066028 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f7fe3085fa0 RCX: 00007f7fe2e0ce59
RDX: 0000200000000180 RSI: 0000200000000080 RDI: 0000200000000300
RBP: 00007f7fe2ea2e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000002200cd0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7fe3086038 R14: 00007f7fe3085fa0 R15: 00007ffde34c74a8
</TASK>
INFO: task syz.3.49:6057 blocked in I/O wait for more than 143 seconds.
Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.3.49 state:D stack:25672 pid:6057 tgid:6037 ppid:5600 task_flags:0x400140 flags:0x00080002
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5510 [inline]
__schedule+0x16dc/0x5500 kernel/sched/core.c:7234
__schedule_loop kernel/sched/core.c:7311 [inline]
schedule+0x164/0x2b0 kernel/sched/core.c:7326
io_schedule+0x80/0xe0 kernel/sched/core.c:8154
folio_wait_bit_common+0x83c/0xbc0 mm/filemap.c:1323
folio_lock include/linux/pagemap.h:1157 [inline]
release_metapage+0x101/0xa50 fs/jfs/jfs_metapage.c:871
discard_metapage fs/jfs/jfs_metapage.h:88 [inline]
__get_metapage+0x9ac/0xdf0 fs/jfs/jfs_metapage.c:754
dtSearch+0x56c/0x2010 fs/jfs/jfs_dtree.c:621
jfs_lookup+0x1b0/0x420 fs/jfs/namei.c:1464
__lookup_slow+0x1fb/0x2f0 fs/namei.c:1919
lookup_slow+0x53/0x70 fs/namei.c:1936
walk_component fs/namei.c:2282 [inline]
lookup_last fs/namei.c:2789 [inline]
path_lookupat+0x3f5/0x8c0 fs/namei.c:2813
filename_lookup+0x265/0x5d0 fs/namei.c:2842
__do_sys_chdir fs/open.c:557 [inline]
__se_sys_chdir+0xa8/0x2a0 fs/open.c:550
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7fe2e0ce59
RSP: 002b:00007f7fe1045028 EFLAGS: 00000246 ORIG_RAX: 0000000000000050
RAX: ffffffffffffffda RBX: 00007f7fe3086090 RCX: 00007f7fe2e0ce59
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000140
RBP: 00007f7fe2ea2e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7fe3086128 R14: 00007f7fe3086090 R15: 00007ffde34c74a8
</TASK>
Showing all locks held in the system:
2 locks held by kworker/u8:1/14:
#0: ffff88801a084138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff88801a084138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffffc90000137c40 (connector_reaper_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#1: ffffc90000137c40 (connector_reaper_work){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
1 lock held by khungtaskd/38:
#0: ffffffff8dfc2fc0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:300 [inline]
#0: ffffffff8dfc2fc0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:840 [inline]
#0: ffffffff8dfc2fc0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180 kernel/locking/lockdep.c:6775
3 locks held by kworker/u8:6/146:
#0: ffff88801f287938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff88801f287938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffffc9000398fc40 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#1: ffffc9000398fc40 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#2: ffff8880320240d0 (&type->s_umount_key#59){++++}-{4:4}, at: super_trylock_shared+0x20/0xf0 fs/super.c:566
6 locks held by kworker/u8:8/175:
2 locks held by kworker/u8:16/3399:
#0: ffff88801a084138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff88801a084138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffffc9000f41fc40 ((reaper_work).work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#1: ffffc9000f41fc40 ((reaper_work).work){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
2 locks held by getty/5350:
#0: ffff88803561b0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
#1: ffffc90003cc62e0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x460/0x1360 drivers/tty/n_tty.c:2211
1 lock held by syz.3.49/6040:
#0: ffff88803f79d2f8 (&type->i_mutex_dir_key#9){++++}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline]
#0: ffff88803f79d2f8 (&type->i_mutex_dir_key#9){++++}-{4:4}, at: do_lock_mount+0x2a4/0x970 fs/namespace.c:2768
1 lock held by syz.3.49/6057:
#0: ffff88803f79d2f8 (&type->i_mutex_dir_key#9){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:1039 [inline]
#0: ffff88803f79d2f8 (&type->i_mutex_dir_key#9){++++}-{4:4}, at: lookup_slow+0x46/0x70 fs/namei.c:1935
4 locks held by udevd/6595:
1 lock held by udevd/6678:
#0: ffff88801a016d58 (&n->list_lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock_rt.h:45 [inline]
#0: ffff88801a016d58 (&n->list_lock){+.+.}-{3:3}, at: get_partial_node_bulk mm/slub.c:3772 [inline]
#0: ffff88801a016d58 (&n->list_lock){+.+.}-{3:3}, at: __refill_objects_node+0x89/0x5b0 mm/slub.c:7197
2 locks held by udevd/6844:
2 locks held by syz.7.165/7222:
#0: ffff8880320240d0 (&type->s_umount_key#59){++++}-{4:4}, at: __super_lock fs/super.c:60 [inline]
#0: ffff8880320240d0 (&type->s_umount_key#59){++++}-{4:4}, at: super_lock+0x2d6/0x3d0 fs/super.c:122
#1: ffff8880614a3150 (&(log)->loglock){+.+.}-{4:4}, at: jfs_syncpt+0x25/0x90 fs/jfs/jfs_logmgr.c:1037
2 locks held by syz.7.165/7226:
#0: ffff8880320240d0 (&type->s_umount_key#59){++++}-{4:4}, at: __super_lock fs/super.c:60 [inline]
#0: ffff8880320240d0 (&type->s_umount_key#59){++++}-{4:4}, at: super_lock+0x2d6/0x3d0 fs/super.c:122
#1: ffff8880614a3150 (&(log)->loglock){+.+.}-{4:4}, at: jfs_syncpt+0x25/0x90 fs/jfs/jfs_logmgr.c:1037
2 locks held by syz-executor/7434:
2 locks held by syz.9.229/7776:
1 lock held by syz.5.231/7802:
2 locks held by cmp/7806:
#0: ffffffff8e6fd498 (tomoyo_ss){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:187 [inline]
#0: ffffffff8e6fd498 (tomoyo_ss){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:294 [inline]
#0: ffffffff8e6fd498 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_read_lock security/tomoyo/common.h:1112 [inline]
#0: ffffffff8e6fd498 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_check_open_permission+0x1d3/0x470 security/tomoyo/file.c:772
#1: ffff88801a016d58 (&n->list_lock){+.+.}-{3:3}
, at: spin_lock include/linux/spinlock_rt.h:45 [inline]
, at: get_partial_node_bulk mm/slub.c:3772 [inline]
, at: __refill_objects_node+0x89/0x5b0 mm/slub.c:7197
1 lock held by syz.8.232/7808:
=============================================
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 38 Comm: khungtaskd Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
nmi_cpu_backtrace+0x274/0x2d0 lib/nmi_backtrace.c:122
nmi_trigger_cpumask_backtrace+0x17a/0x380 lib/nmi_backtrace.c:65
trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline]
__sys_info lib/sys_info.c:157 [inline]
sys_info+0x135/0x170 lib/sys_info.c:165
check_hung_uninterruptible_tasks kernel/hung_task.c:353 [inline]
watchdog+0xfd7/0x1030 kernel/hung_task.c:561
kthread+0x388/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 29 Comm: ktimers/1 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
RIP: 0010:arch_atomic_read arch/x86/include/asm/atomic.h:23 [inline]
RIP: 0010:raw_atomic_read include/linux/atomic/atomic-arch-fallback.h:457 [inline]
RIP: 0010:rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline]
RIP: 0010:rcu_is_watching+0x5a/0xb0 kernel/rcu/tree.c:752
Code: f0 48 c1 e8 03 42 80 3c 38 00 74 08 4c 89 f7 e8 7c 96 84 00 48 c7 c3 58 2d 72 92 49 03 1e 48 89 d8 48 c1 e8 03 42 0f b6 04 38 <84> c0 75 34 8b 03 65 ff 0d d9 f9 c6 10 74 11 83 e0 04 c1 e8 02 5b
RSP: 0000:ffffc90000a3f628 EFLAGS: 00000a02
RAX: 0000000000000000 RBX: ffff8880b8933d58 RCX: 0000000080000001
RDX: 0000000000000001 RSI: ffffffff8ba94360 RDI: ffffffff8ba94320
RBP: 0000000000000820 R08: ffffffff8b29e15c R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8dfc2fc0 R12: ffff8880b89464d0
R13: ffffffff8222d473 R14: ffffffff8d8eb7d8 R15: dffffc0000000000
FS: 0000000000000000(0000) GS:ffff888126211000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff98b080000 CR3: 000000006aa92000 CR4: 00000000003526f0
Call Trace:
<TASK>
trace_lock_release include/trace/events/lock.h:68 [inline]
lock_release+0x4b/0x3c0 kernel/locking/lockdep.c:5879
rt_spin_unlock+0x29/0x200 kernel/locking/spinlock_rt.c:80
spin_unlock include/linux/spinlock_rt.h:109 [inline]
alloc_from_pcs mm/slub.c:4823 [inline]
slab_alloc_node mm/slub.c:4933 [inline]
kmem_cache_alloc_node_noprof+0x293/0x670 mm/slub.c:5017
__alloc_skb+0x1d7/0x7a0 net/core/skbuff.c:704
skb_copy+0x19d/0x870 net/core/skbuff.c:2185
mac80211_hwsim_tx_frame_no_nl+0xfab/0x1760 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2009
mac80211_hwsim_tx_frame+0x199/0x1f0 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2406
mac80211_hwsim_beacon_tx+0x396/0x820 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2482
__iterate_interfaces+0x2af/0x5a0 net/mac80211/util.c:772
ieee80211_iterate_active_interfaces_atomic+0xdb/0x180 net/mac80211/util.c:808
mac80211_hwsim_beacon+0xb2/0x2b0 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2514
__run_hrtimer kernel/time/hrtimer.c:2032 [inline]
__hrtimer_run_queues+0x3eb/0xaf0 kernel/time/hrtimer.c:2096
hrtimer_run_softirq+0x18f/0x260 kernel/time/hrtimer.c:2113
handle_softirqs+0x1d9/0x6c0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
run_ktimerd+0x69/0x100 kernel/softirq.c:1151
smpboot_thread_fn+0x57c/0xa80 kernel/smpboot.c:160
kthread+0x388/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Reply: **Analysis of the Bug:**
The bug is a deadlock in the JFS filesystem's metapage handling, specifically in `__get_metapage()`.
When `__get_metapage()` is called to read an existing metadata block (with `new = 0`), it first locks the folio associated with the block. If it finds that the metapage has the `META_discard` flag set, it considers this an error condition. This scenario typically occurs when interacting with a corrupted or maliciously crafted filesystem image where a directory or tree pointer points to a previously freed/discarded block.
In this error path, `__get_metapage()` calls `discard_metapage(mp)`, which in turn calls `release_metapage(mp)`. However, `release_metapage(mp)` attempts to acquire the folio lock (`folio_lock(folio)`) before unlocking the metapage. Since `__get_metapage()` already holds the folio lock, this results in a self-deadlock. The task hangs indefinitely in the `D` (uninterruptible sleep) state waiting for the lock it already holds.
**Security Impact:**
* **Denial of Service (True):** The deadlock causes the task to hang indefinitely. In the provided syzbot trace, the task doing `chdir` hangs while holding the `inode_lock_shared` (read lock on the directory's `i_rwsem`). Any other task attempting to modify or lock the directory (such as the other task in the trace attempting a `mount` and waiting for the write lock) will also hang, leading to a local denial of service.
* **Exploitable (False):** This is a pure locking issue (deadlock). It does not lead to memory corruption, use-after-free, out-of-bounds access, or information leaks. It cannot be used for privilege escalation.
* **Malicious Filesystem & Peripheral Trigger (True):** The bug is triggered by mounting and accessing a maliciously crafted JFS filesystem image. This can happen if a user plugs in an untrusted USB drive containing a corrupted JFS image and the system auto-mounts it, or if an administrator is tricked into mounting it.
* **Accessible From Unprivileged Processes / User Namespaces (False):** The JFS filesystem does not have the `FS_USERNS_MOUNT` flag. This means it cannot be mounted by unprivileged users, even within a user namespace. A user must have `CAP_SYS_ADMIN` in the initial namespace to mount a JFS image. Therefore, an unprivileged user cannot trigger this bug on their own without the help of an administrator or an auto-mount daemon.
|
| 6/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 12313
output: 43
thoughts: 331
Thoughts: **Analyzing a Deeply Concerning Hung Task Report**
Okay, so I'm looking at this bug report and the first thing that jumps out is the "hung task" message: tasks `syz.3.49:6040` and `syz.3.49:6057` have been blocked for a significant amount of time, specifically over 143 seconds. That's a red flag immediately.
I'm starting to trace the stack traces. The first task is hung within a `do_lock_mount` sequence, leading to `inode_lock`, `rwbase_write_lock`, then `rt_mutex_schedule` and finally `__schedule`. This suggests the mount process is the first issue. The second task, it looks like, is blocked in an I/O wait, specifically within `folio_wait_bit_common` which leads to a long chain: `release_metapage`, `discard_metapage`, `__get_metapage`, through `dtSearch` and ultimately down to `__do_sys_chdir`. This one's related to JFS.
Now, my initial thought is, the first task is performing a mount operation and is blocked on getting an `inode_lock`. The second is calling `chdir`. This is a classic deadlock scenario or perhaps a very long I/O operation. The second task looks blocked on I/O, specifically waiting for a folio in JFS. This makes me suspect a more serious JFS problem: either JFS is hung, or there's an I/O operation that's not completing.
Wait a second. Going back to `release_metapage`, that calls `folio_lock`. I see a possible lock contention. I need to investigate further. It's waiting for the folio to be unlocked. Let me zero in on `__get_metapage` in `fs/jfs/jfs_metapage.c`.
|
| 7/2 |
2026/07/01 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/jfs/jfs_metapage.c Name:__get_metapage]
Results: map[SourceCode: 684: struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
685: unsigned int size, int absolute,
686: unsigned long new)
687: {
688: int l2BlocksPerPage;
689: int l2bsize;
690: struct address_space *mapping;
691: struct metapage *mp = NULL;
692: struct folio *folio;
693: unsigned long page_index;
694: unsigned long page_offset;
695:
696: jfs_info("__get_metapage: ino = %llu, lblock = 0x%lx, abs=%d",
697: inode->i_ino, lblock, absolute);
698:
699: l2bsize = inode->i_blkbits;
700: l2BlocksPerPage = PAGE_SHIFT - l2bsize;
701: page_index = lblock >> l2BlocksPerPage;
702: page_offset = (lblock - (page_index << l2BlocksPerPage)) << l2bsize;
703: if ((page_offset + size) > PAGE_SIZE) {
704: jfs_err("MetaData crosses page boundary!!");
705: jfs_err("lblock = %lx, size = %d", lblock, size);
706: dump_stack();
707: return NULL;
708: }
709: if (absolute)
710: mapping = JFS_SBI(inode->i_sb)->direct_inode->i_mapping;
711: else {
712: /*
713: * If an nfs client tries to read an inode that is larger
714: * than any existing inodes, we may try to read past the
715: * end of the inode map
716: */
717: if ((lblock << inode->i_blkbits) >= inode->i_size)
718: return NULL;
719: mapping = inode->i_mapping;
720: }
721:
722: if (new && (PSIZE == PAGE_SIZE)) {
723: folio = filemap_grab_folio(mapping, page_index);
724: if (IS_ERR(folio)) {
725: jfs_err("filemap_grab_folio failed!");
726: return NULL;
727: }
728: folio_mark_uptodate(folio);
729: } else {
730: folio = read_mapping_folio(mapping, page_index, NULL);
731: if (IS_ERR(folio)) {
732: jfs_err("read_mapping_page failed!");
733: return NULL;
734: }
735: folio_lock(folio);
736: }
737:
738: mp = folio_to_mp(folio, page_offset);
739: if (mp) {
740: if (mp->logical_size != size) {
741: jfs_error(inode->i_sb,
742: "get_mp->logical_size != size\n");
743: jfs_err("logical_size = %d, size = %d",
744: mp->logical_size, size);
745: dump_stack();
746: goto unlock;
747: }
748: mp->count++;
749: lock_metapage(mp);
750: if (test_bit(META_discard, &mp->flag)) {
751: if (!new) {
752: jfs_error(inode->i_sb,
753: "using a discarded metapage\n");
754: discard_metapage(mp);
755: goto unlock;
756: }
757: clear_bit(META_discard, &mp->flag);
758: }
759: } else {
760: INCREMENT(mpStat.pagealloc);
761: mp = alloc_metapage(GFP_NOFS);
762: if (!mp)
763: goto unlock;
764: mp->folio = folio;
765: mp->sb = inode->i_sb;
766: mp->flag = 0;
767: mp->xflag = COMMIT_PAGE;
768: mp->count = 1;
769: mp->nohomeok = 0;
770: mp->logical_size = size;
771: mp->data = folio_address(folio) + page_offset;
772: mp->index = lblock;
773: if (unlikely(insert_metapage(folio, mp))) {
774: free_metapage(mp);
775: goto unlock;
776: }
777: lock_metapage(mp);
778: }
779:
780: if (new) {
781: jfs_info("zeroing mp = 0x%p", mp);
782: memset(mp->data, 0, PSIZE);
783: }
784:
785: folio_unlock(folio);
786: jfs_info("__get_metapage: returning = 0x%p data = 0x%p", mp, mp->data);
787: return mp;
788:
789: unlock:
790: folio_unlock(folio);
791: return NULL;
792: }
SourceFile:fs/jfs/jfs_metapage.c]
|
| 8/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 14751
output: 42
thoughts: 137
Thoughts: **Deadlock Deep Dive**
Okay, here's what's running through my mind as I look at this kernel code. The task is getting hung up somewhere within `discard_metapage(mp)`. Specifically, it appears the bottleneck is happening when `discard_metapage` calls `release_metapage(mp)`, which in turn is calling `folio_lock(folio)`. But hang on a second... isn't `__get_metapage` also calling `folio_lock(folio)`? Let me check line 735... Yup, there it is! And then it calls `discard_metapage(mp)` at line 754.
So, if `__get_metapage` has already acquired the lock on the `folio` before calling `discard_metapage`, and then `discard_metapage` attempts to reacquire the same lock via `release_metapage`, we've got a classic deadlock scenario brewing. This is exactly the kind of circular dependency I'm always looking out for. It looks like `discard_metapage` is trying to release the lock that it already holds!
Now, the important part is to carefully examine `discard_metapage` and `release_metapage` to confirm the code flow and confirm the deadlock hypothesis. Time to dig in and confirm my suspicion.
|
| 9/2 |
2026/07/01 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/jfs/jfs_metapage.c Name:discard_metapage]
Results: map[SourceCode: 84: static inline void discard_metapage(struct metapage *mp)
85: {
86: clear_bit(META_dirty, &mp->flag);
87: set_bit(META_discard, &mp->flag);
88: release_metapage(mp);
89: }
SourceFile:fs/jfs/jfs_metapage.h]
|
| 10/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 15347
output: 42
thoughts: 11
Thoughts: Okay, here's my attempt at summarizing that thought process, keeping in mind I'm speaking to a fellow expert:
**Checking `release_metapage`**
Right, let's see. First things first, I need to take a look at `release_metapage`. It's the central hub for, well, the release metadata. Itβs the place where I keep a record of the release, how it behaves, its metrics, and how it is composed. This is where I go when debugging a release. I want to examine its structure, confirm the versions are correct, make sure everything is linking up as expected. I need to make sure the data there reflects reality and is well-formed. Anything I need to know about the current release, it's the place to look. Right, letβs get to it.
|
| 11/2 |
2026/07/01 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/jfs/jfs_metapage.c Name:release_metapage]
Results: map[SourceCode: 866: void release_metapage(struct metapage * mp)
867: {
868: struct folio *folio = mp->folio;
869: jfs_info("release_metapage: mp = 0x%p, flag = 0x%lx", mp, mp->flag);
870:
871: folio_lock(folio);
872: unlock_metapage(mp);
873:
874: assert(mp->count);
875: if (--mp->count || mp->nohomeok) {
876: folio_unlock(folio);
877: folio_put(folio);
878: return;
879: }
880:
881: if (test_bit(META_dirty, &mp->flag)) {
882: folio_mark_dirty(folio);
883: if (test_bit(META_sync, &mp->flag)) {
884: clear_bit(META_sync, &mp->flag);
885: if (metapage_write_one(folio))
886: jfs_error(mp->sb, "metapage_write_one() failed\n");
887: folio_lock(folio);
888: }
889: } else if (mp->lsn) /* discard_metapage doesn't remove it */
890: remove_from_logsync(mp);
891:
892: /* Try to keep metapages from using up too much memory */
893: drop_metapage(folio, mp);
894:
895: folio_unlock(folio);
896: folio_put(folio);
897: }
SourceFile:fs/jfs/jfs_metapage.c]
|
| 12/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 16104
output: 38
thoughts: 567
Thoughts: **Analyzing a Potential JFS Deadlock**
Okay, so I'm looking at this JFS code, specifically around metapage handling. I see that `release_metapage` is calling `folio_lock(folio)` at line 871. That seems fine on its own. However, I'm digging deeper and in `__get_metapage`, the folio is *already* locked at line 735. The code retrieves a folio with `read_mapping_folio`, locks it, and then at line 754, it checks if the metapage is discarded, calling `discard_metapage(mp)`. `discard_metapage` itself then calls `release_metapage`, which then... calls `folio_lock(folio)`. Hold on. This is a clear deadlock! The task is trying to re-acquire a lock it already possesses. It is literally waiting on itself.
But, a discarded metapage? How can a metapage even get `META_discard` set? Ah, yes, `discard_metapage` sets it. This happens when a metapage is no longer needed, maybe during a file deletion or truncation. It's still in the page cache until it's dropped. This means that if `__get_metapage` tries to access it again with `!new`, it'll hit this problematic branch. This is the root of the problem: a discarded metapage being accessed when it shouldn't.
Now, let's see if there's an existing fix for this. This is a classic deadlock scenario in JFS. Given its nature as a filesystem, exploiting this would likely involve mounting a malicious JFS image. The question is: can an unprivileged user trigger this? Mounting usually requires `CAP_SYS_ADMIN` in the initial user namespace. With user namespaces enabled, an unprivileged user *could* create a user namespace and get `CAP_SYS_ADMIN` there. And they can mount a filesystem if it's permitted to be mounted in a user namespace. So, is JFS one of those filesystems? We need to verify if JFS is flagged with `FS_USERNS_MOUNT`. If so, this could be a fairly serious security vulnerability.
|
| 13/2 |
2026/07/01 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/jfs/super.c Name:jfs_fs_type]
Results: map[SourceCode: 928: static struct file_system_type jfs_fs_type = {
929: .owner = THIS_MODULE,
930: .name = "jfs",
931: .kill_sb = kill_block_super,
932: .fs_flags = FS_REQUIRES_DEV,
933: .init_fs_context = jfs_init_fs_context,
934: .parameters = jfs_param_spec,
935: };
SourceFile:fs/jfs/super.c]
|
| 14/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 17359
output: 60
thoughts: 639
Thoughts: **Analyzing the JFS Bug's Attack Surface**
Okay, so the initial assessment is pretty clear: JFS doesn't support `FS_USERNS_MOUNT`. That immediately eliminates the possibility of an unprivileged user triggering this bug directly from within a user namespace. The fact that an unprivileged user can trigger this from a corrupted image *doesn't* mean it's easily exploitable, though. It also means it's still, fundamentally, a *malicious filesystem* trigger, and also a *peripheral* trigger (malicious JFS image on a USB drive, for example). The impact is a Denial of Service, causing a deadlock. Critically, itβs *not* exploitable in the traditional memory corruption sense. And itβs not something you can trigger remotely over a network.
Now, let's nail down what the real accessibility is. The initial thought process suggests that because an unprivileged user can't mount a corrupted filesystem and *then* trigger the bug, that makes the bug inaccessible to the unprivileged. But wait⦠the thought process went on to analyze the call path: `__do_sys_chdir` -> `filename_lookup` -> `path_lookupat` -> `lookup_last` -> `walk_component` -> `lookup_slow` -> `__lookup_slow` -> `jfs_lookup` -> `dtSearch` -> `__get_metapage`. *That* implies a simple `chdir` into a directory on a JFS filesystem is sufficient to trigger the deadlock.
So, if the malicious JFS image is *already mounted* (and therefore accessible), then *any* user who can access the filesystem can trigger it, even without privileges. This means that, after mounting, even an unprivileged user can trigger it through something like a `chdir` or `open`. But the root cause is still the corrupt filesystem. So, it *is* an unprivileged user trigger, but with the caveat that it requires a maliciously crafted filesystem. Therefore, if a system administrator mounts a shared disk with a corrupted JFS filesystem, an unprivileged user can exploit the bug.
Now, to make sure there are no other potential trigger vectors, I need to understand when `META_discard` is set. Where is `discard_metapage` called from? This will help understand the full scope of the bug.
|
| 15/2 |
2026/07/01 00:46 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:fs/jfs/jfs_metapage.c IncludeSnippetLines:0 Name:discard_metapage SourceTreePrefix:fs/jfs/]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__get_metapage SourceFile:fs/jfs/jfs_metapage.c SourceLine:754] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:dataLog SourceFile:fs/jfs/jfs_txnmgr.c SourceLine:1533] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:dtDeleteUp SourceFile:fs/jfs/jfs_dtree.c SourceLine:2289] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:dtDeleteUp SourceFile:fs/jfs/jfs_dtree.c SourceLine:2365] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:dtSplitPage SourceFile:fs/jfs/jfs_dtree.c SourceLine:1470] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ea_get SourceFile:fs/jfs/xattr.c SourceLine:542] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ea_put SourceFile:fs/jfs/xattr.c SourceLine:627] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:txUpdateMap SourceFile:fs/jfs/jfs_txnmgr.c SourceLine:2344] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:xtTruncate SourceFile:fs/jfs/jfs_xtree.c SourceLine:2502] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:xtTruncate SourceFile:fs/jfs/jfs_xtree.c SourceLine:2661]] TruncatedOutput:false]
|
| 16/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 19102
output: 34
thoughts: 684
Thoughts: **Analyzing a JFS Filesystem Corruption Bug**
Okay, so I'm looking at this `discard_metapage` function and the associated error condition. It looks like `discard_metapage` gets called in standard filesystem operations like `dtDeleteUp`, `dtSplitPage`, and `xtTruncate`. These are pretty common, normal operations. If a metapage is discarded, the `META_discard` flag is set. The problem arises when `__get_metapage` is called on the *same* block with the `!new` flag, triggering an error: "using a discarded metapage."
Right, `jfs_error` is called. That's a big red flag; it's an *error* condition! This implies some kind of filesystem corruption. A healthy filesystem shouldn't be attempting to read a metapage that's already been marked as discarded. So, this clearly points to a bug triggered by a corrupted filesystem image.
Now, the question is, can an unprivileged user trigger this on a "normal" filesystem? Probably not. A well-behaved system wouldn't even *try* to access a discarded metapage under normal circumstances.
But, a race condition? Maybe. JFS is old and not actively maintained. It's likely this is triggered by a fuzzed image.
Let's look at the syzbot report. I see that the crash report shows a `do_new_mount` call in the call trace of one task and `__get_metapage`, `dtSearch`, `jfs_lookup`, and `__do_sys_chdir` in the second task. So, the first task is *mounting* something, and the second is doing a `chdir`.
Aha! Syzbot is mounting a JFS image and then `chdir`ing into it. Since syzbot runs with root privileges (or within a user namespace with capabilities, but JFS doesn't use `FS_USERNS_MOUNT`), it must be running as root in the initial namespace to mount JFS. Syzkaller can inject a disk image and mount it via `syz_mount_image`.
Therefore, it's almost certainly a malicious filesystem image. Now, let's see if there have been any recent changes to `release_metapage` that might have introduced or exposed this vulnerability, or if this is an old, previously undiscovered issue.
|
| 17/2 |
2026/07/01 00:46 |
tool |
git-log |
0m
Args: map[Count:10 PathPrefix:fs/jfs/jfs_metapage.c]
Results: map[Output:3c778ec88208 jfs: fix corrupted list in dbUpdatePMap
0b2600f81cef treewide: change inode->i_ino from unsigned long to u64
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
fb49a4425cfa treewide: remove MIGRATEPAGE_SUCCESS
b89798e79cf7 jfs: stop using write_cache_pages
906d7ce3b59d jfs: implement migrate_folio for jfs_metapage_aops
ee6817e72d4e jfs: Remove use of folio error flag
ad6c19e5f932 jfs: Change metapage->page to metapage->folio
1252ad136e16 jfs: Convert force_metapage to use a folio
d9c36002d015 jfs: Convert inc_io to take a folio
]
|
| 18/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 20598
output: 42
thoughts: 35
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm already deep in the weeds of memory management, likely within a kernel context:
**Analyzing a Potential Memory Management Deadlock**
Alright, so a deadlock is happening. My initial thought is it's stemming from the interaction between `release_metapage` and `folio_lock(folio)`. That smells like a contention issue, and I immediately want to dig deeper into the sequence of events. The fact that the call to `folio_lock` happens within `release_metapage` is the key. Let's get back into the code for `release_metapage` and carefully examine the execution path to see why we're potentially running into a deadlock situation. Understanding the exact context and what's going on *before* the lock is acquired, and more importantly, *after* the lock is released will provide the necessary information.
|
| 19/2 |
2026/07/01 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/jfs/jfs_metapage.c Name:release_metapage]
Results: map[SourceCode: 866: void release_metapage(struct metapage * mp)
867: {
868: struct folio *folio = mp->folio;
869: jfs_info("release_metapage: mp = 0x%p, flag = 0x%lx", mp, mp->flag);
870:
871: folio_lock(folio);
872: unlock_metapage(mp);
873:
874: assert(mp->count);
875: if (--mp->count || mp->nohomeok) {
876: folio_unlock(folio);
877: folio_put(folio);
878: return;
879: }
880:
881: if (test_bit(META_dirty, &mp->flag)) {
882: folio_mark_dirty(folio);
883: if (test_bit(META_sync, &mp->flag)) {
884: clear_bit(META_sync, &mp->flag);
885: if (metapage_write_one(folio))
886: jfs_error(mp->sb, "metapage_write_one() failed\n");
887: folio_lock(folio);
888: }
889: } else if (mp->lsn) /* discard_metapage doesn't remove it */
890: remove_from_logsync(mp);
891:
892: /* Try to keep metapages from using up too much memory */
893: drop_metapage(folio, mp);
894:
895: folio_unlock(folio);
896: folio_put(folio);
897: }
SourceFile:fs/jfs/jfs_metapage.c]
|
| 20/2 |
2026/07/01 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 21393
output: 32
thoughts: 1657
Thoughts: **Analysis of a JFS Filesystem Deadlock**
Okay, so here's what's happening. I've been looking at a potential deadlock scenario within the JFS filesystem code. Initially, I noticed a problem with how `release_metapage` and `__get_metapage` interact, specifically related to folio and metapage locking and unlocking. My thought process is that `release_metapage` seems to assume the folio isn't locked, but `__get_metapage` *does* lock the folio.
Specifically, in `__get_metapage`, after reading a folio, it gets locked. Then the `folio_to_mp` function is called to obtain a metapage. If there is an error where the `mp` is discarded and we call `discard_metapage`, the current implementation looks like it could lead to a deadlock. The `discard_metapage` function will eventually call `release_metapage`, which *also* locks the folio before unlocking the metapage. The metapage is locked by a previous call to `lock_metapage(mp)`. This seems to create an unexpected locking order. This looks like a classic resource locking issue that I have seen many times over the years.
My immediate conclusion is that if `discard_metapage` is called here, it's going to deadlock. It seems like the correct fix is to unlock the folio *before* calling `discard_metapage`, or potentially to simply unlock the metapage, decrement the count, and return, or use a variant of `discard_metapage` that doesn't need to lock the folio.
Digging further, I realize that `discard_metapage` *expects* the metapage to be locked, and the folio unlocked when called from `release_metapage`, which is a key part of the flow. In `__get_metapage` the folio IS locked, so the fix is to `folio_unlock(folio)` before calling `discard_metapage(mp)`.
Now, considering the implications of this, it's going to cause a denial of service. The question becomes, can an unprivileged user exploit this or is it purely a malicious filesystem issue?
Could an unprivileged user trigger this without a malicious image? My thought is, if a file is truncated or deleted, `discard_metapage` is called, and then if the user tries to *re-read* that discarded metapage, would it trigger the error path? It turns out it won't trigger the error path, as the `new` flag will be set to `1` which will clear the discard bit. The error path that will lead to the deadlock will only occur if someone tries to access a discarded metapage without the `new` flag.
Now, that error path (`!new`) would be hit when reading existing metadata, like searching a directory. This suggests, if the block gets discarded, it's no longer part of the metadata. A normal operation wouldn't try to access this. If there's still a pointer to this metadata after the discard, it implies a corrupted filesystem.
Thus, this issue requires a *malicious filesystem* trigger and cannot be exploited by a regular user on a healthy filesystem.
Let's go back through the questions:
* **Exploitable:** False. It's a deadlock, not a memory corruption, so no direct exploitation.
* **Denial of Service:** True. A process hangs in a D-state, potentially holding locks that block others, so it's a denial-of-service condition. I see that the process holds the `inode_lock_shared` (read lock), and the other process (trying to `mount`) is blocked on the write lock, which causes the denial of service.
* **Accessible From Unprivileged Processes:** False.
* **Accessible From User Namespaces:** False.
* **VM Guest Trigger:** False.
* **VM Host Trigger in The Confidential Computing Context:** False.
* **Ethernet Network Trigger:** False.
* **Other Remote Trigger:** False.
* **Peripheral Trigger:** True (e.g., a malicious USB drive).
* **Malicious Filesystem Trigger:** True.
Now I need to verify that JFS can't be mounted by unprivileged users in user namespaces. And that's verified by checking if the `jfs_fs_type` has the `FS_USERNS_MOUNT` flag.
|
| 21/2 |
2026/07/01 00:47 |
tool |
grepper |
0m
Error:
Args: map[Expression:FS_USERNS_MOUNT PathPrefix:fs/jfs/]
Results:
|
| 22/2 |
2026/07/01 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 24064
output: 66
thoughts: 274
Thoughts: **Analyzing the JFS Vulnerability Report**
Okay, so I've been looking into this `syzbot` report about a potential vulnerability in JFS. First off, I quickly checked the `fs/jfs/` directory and, as expected, there's no support for `FS_USERNS_MOUNT` there. That means we're not dealing with a direct user namespace mounting issue.
Now, my mind is racing; is there another avenue to trigger `__get_metapage` with a discarded metapage in a way that is malicious? Could a race condition exist in JFS that lets a *healthy* filesystem momentarily reference a bad block? JFS does use a transaction manager, and I know it logs when blocks are freed. Honestly, it would be surprising if there was such a race condition. JFS is ancient and not getting actively developed. We mostly see fuzzing fixes these days. Given that the report involves mounting a JFS image, I'm already about 99.9% sure we're dealing with a crafted, malicious image.
Let me take another quick glance at the `syzbot` report itself. I'm seeing two blocked tasks: "INFO: task syz.3.49:6040 blocked for more than 143 seconds." and "INFO: task syz.3.49:6057 blocked in I/O wait for more than 143 seconds." The first task, seems to be doing a `mount`, while the second task is doing a `chdir`. Bingo! That perfectly fits the pattern: a crafted image is mounted, and then the user attempts to access it, causing the fault.
I think I've got a handle on this now. I'm ready to make a call on this one.
|
| 23/2 |
2026/07/01 00:47 |
tool |
set-results |
0m
Args: map[DenialOfService:true Exploitable:false FilesystemTrigger:true NetworkTrigger:false PeripheralTrigger:true RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:true NetworkTrigger:false PeripheralTrigger:true RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 24/2 |
2026/07/01 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 24852
output: 570
thoughts: 428
Thoughts: **My Analysis of the JFS Metapage Deadlock**
Alright, the data is in, time to synthesize this into a clear response. Here's what I've got:
It's a straightforward deadlock in the JFS filesystem, specifically within the metapage handling. When `__get_metapage()` attempts to read a metadata block, it first locks the relevant folio. Now, if it encounters a situation where the metapage has been marked for discard (`META_discard` flag set) and the caller *isn't* requesting a fresh block (`!new`), that's an error. Usually, this means we're dealing with a corrupted filesystem image, where a pointer is referencing something that's already been freed or discarded.
The problematic part is what happens in this error path. `discard_metapage(mp)` gets called, which in turn calls `release_metapage(mp)`. Here's where it bites us. `release_metapage(mp)` *tries* to grab the folio lock (`folio_lock(folio)`) *before* releasing the metapage. The issue? `__get_metapage()` is *already* holding that folio lock. That's a classic deadlock: the task gets stuck in the 'D' state, waiting for a lock it already possesses.
The impact is a local Denial of Service (DoS). The hung task essentially holds onto the `inode_lock_shared`, which is a read lock on the directory's `i_rwsem`. Any other task trying to change the directory β like the `mount` task in this syzbot report trying to acquire the write lock β will now also freeze.
The trigger is a bit limited. Because JFS lacks the `FS_USERNS_MOUNT` flag, unprivileged users can't mount it, even within user namespaces. So, we're talking about a Malicious Filesystem Trigger and a Peripheral Trigger. It would require a crafted JFS image to be mounted by a privileged user or through some auto-mount process, like plugging in a USB drive with the malicious image.
Thankfully, it appears to be limited to a DoS. It's a lock-ordering issue, a simple deadlock. No memory corruption, no info leaks. Just a system freeze.
|
| 25/1 |
2026/07/01 00:47 |
action |
format-explanation |
0m
Results: map[Explanation:**Analysis of the Bug:**
The bug is a deadlock in the JFS filesystem's metapage handling, specifically in
`__get_metapage()`.
When `__get_metapage()` is called to read an existing metadata block (with `new
= 0`), it first locks the folio associated with the block. If it finds that the
metapage has the `META_discard` flag set, it considers this an error condition.
This scenario typically occurs when interacting with a corrupted or maliciously
crafted filesystem image where a directory or tree pointer points to a
previously freed/discarded block.
In this error path, `__get_metapage()` calls `discard_metapage(mp)`, which in
turn calls `release_metapage(mp)`. However, `release_metapage(mp)` attempts to
acquire the folio lock (`folio_lock(folio)`) before unlocking the metapage.
Since `__get_metapage()` already holds the folio lock, this results in a
self-deadlock. The task hangs indefinitely in the `D` (uninterruptible sleep)
state waiting for the lock it already holds.
**Security Impact:**
* **Denial of Service (True):** The deadlock causes the task to hang
indefinitely. In the provided syzbot trace, the task doing `chdir` hangs while
holding the `inode_lock_shared` (read lock on the directory's `i_rwsem`). Any
other task attempting to modify or lock the directory (such as the other task in
the trace attempting a `mount` and waiting for the write lock) will also hang,
leading to a local denial of service.
* **Exploitable (False):** This is a pure locking issue (deadlock). It does not
lead to memory corruption, use-after-free, out-of-bounds access, or information
leaks. It cannot be used for privilege escalation.
* **Malicious Filesystem & Peripheral Trigger (True):** The bug is triggered by
mounting and accessing a maliciously crafted JFS filesystem image. This can
happen if a user plugs in an untrusted USB drive containing a corrupted JFS
image and the system auto-mounts it, or if an administrator is tricked into
mounting it.
* **Accessible From Unprivileged Processes / User Namespaces (False):** The JFS
filesystem does not have the `FS_USERNS_MOUNT` flag. This means it cannot be
mounted by unprivileged users, even within a user namespace. A user must have
`CAP_SYS_ADMIN` in the initial namespace to mount a JFS image. Therefore, an
unprivileged user cannot trigger this bug on their own without the help of an
administrator or an auto-mount daemon.]
|