Commit f5d4e04
nilfs2: fix use-after-free of timer for log writer thread
Patch series "nilfs2: fix log writer related issues".
This bug fix series covers three nilfs2 log writer-related issues,
including a timer use-after-free issue and potential deadlock issue on
unmount, and a potential freeze issue in event synchronization found
during their analysis. Details are described in each commit log.
This patch (of 3):
A use-after-free issue has been reported regarding the timer sc_timer on
the nilfs_sc_info structure.
The problem is that even though it is used to wake up a sleeping log
writer thread, sc_timer is not shut down until the nilfs_sc_info structure
is about to be freed, and is used regardless of the thread's lifetime.
Fix this issue by limiting the use of sc_timer only while the log writer
thread is alive.
Link: https://lkml.kernel.org/r/20240520132621.4054-1-konishi.ryusuke@gmail.com
Link: https://lkml.kernel.org/r/20240520132621.4054-2-konishi.ryusuke@gmail.com
Fixes: fdce895 ("nilfs2: change sc_timer from a pointer to an embedded one in struct nilfs_sc_info")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: "Bai, Shuangpeng" <sjb7183@psu.edu>
Closes: https://groups.google.com/g/syzkaller/c/MK_LYqtt8ko/m/8rgdWeseAwAJ
Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent 1901472 commit f5d4e04
1 file changed
+19
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2118 | 2118 | | |
2119 | 2119 | | |
2120 | 2120 | | |
2121 | | - | |
2122 | | - | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
2123 | 2125 | | |
2124 | 2126 | | |
2125 | 2127 | | |
| |||
2320 | 2322 | | |
2321 | 2323 | | |
2322 | 2324 | | |
| 2325 | + | |
| 2326 | + | |
2323 | 2327 | | |
2324 | 2328 | | |
| 2329 | + | |
2325 | 2330 | | |
2326 | | - | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
2327 | 2340 | | |
2328 | 2341 | | |
2329 | 2342 | | |
| |||
2349 | 2362 | | |
2350 | 2363 | | |
2351 | 2364 | | |
2352 | | - | |
| 2365 | + | |
2353 | 2366 | | |
2354 | 2367 | | |
2355 | 2368 | | |
| |||
2539 | 2552 | | |
2540 | 2553 | | |
2541 | 2554 | | |
| 2555 | + | |
2542 | 2556 | | |
2543 | 2557 | | |
2544 | 2558 | | |
| |||
2606 | 2620 | | |
2607 | 2621 | | |
2608 | 2622 | | |
| 2623 | + | |
2609 | 2624 | | |
2610 | 2625 | | |
2611 | 2626 | | |
| |||
2669 | 2684 | | |
2670 | 2685 | | |
2671 | 2686 | | |
2672 | | - | |
2673 | 2687 | | |
2674 | 2688 | | |
2675 | 2689 | | |
| |||
2748 | 2762 | | |
2749 | 2763 | | |
2750 | 2764 | | |
2751 | | - | |
2752 | 2765 | | |
2753 | 2766 | | |
2754 | 2767 | | |
| |||
0 commit comments