Repository navigation
Conversation
|
Upstream branch: 3857c2f |
|
Upstream branch: 3857c2f |
0a00ab7 to
c8bf380
Compare
|
Upstream branch: 3857c2f |
c8bf380 to
5c744d9
Compare
17720b8 to
ec9266e
Compare
|
Upstream branch: d5b6dc3 |
5c744d9 to
998d57f
Compare
ec9266e to
2e69118
Compare
|
Upstream branch: 24a19b9 |
998d57f to
6521ad2
Compare
2e69118 to
3cdd51f
Compare
|
Upstream branch: 4056b3c |
6521ad2 to
2f6a961
Compare
3cdd51f to
e6ca2c1
Compare
|
Upstream branch: 0fcb05b |
2f6a961 to
674de93
Compare
e6ca2c1 to
3d027d5
Compare
|
Upstream branch: 58161ea |
674de93 to
72f21fe
Compare
3d027d5 to
90ea7e4
Compare
|
Upstream branch: c03c1a1 |
|
Upstream branch: d135ab4 |
e19b77d to
3f3e177
Compare
b3a1abc to
712496f
Compare
|
Upstream branch: c339f40 |
3f3e177 to
16a462a
Compare
712496f to
a186880
Compare
|
Upstream branch: d89e1d1 |
16a462a to
a4b33ee
Compare
a186880 to
46206a3
Compare
|
Upstream branch: 6628e7d |
a4b33ee to
1a20ef5
Compare
46206a3 to
220bd96
Compare
|
Upstream branch: 05441d6 |
1a20ef5 to
ab92030
Compare
220bd96 to
6c4625e
Compare
|
Upstream branch: f66469d |
ab92030 to
c867c0f
Compare
6c4625e to
c7f678d
Compare
|
Upstream branch: d487237 |
c867c0f to
ffc151b
Compare
c7f678d to
6aa6cd1
Compare
This is a debug patch which will be reverted after we observed what is happening. This patch does not attempt to fix the problem itself. syzbot is reporting NULL pointer dereference in lo_rw_aio() [1][2]. An analysis by the Gemini AI collaborator [3] considers that this problem is caused by a timing shift primarily exposed by commit 65565ca ("block: unify the synchronous bi_end_io callbacks"), along with helper refactorings like commit 92c3737 ("block: add a bio_submit_or_kill helper"). But due to difficulty of reproducing this race, discussion about what is happening and how to fix this problem is stalling. Also, we haven't identified how many filesystems are subjected to this problem. Therefore, we need to proceed to debug printk() approach, for syzbot cannot find a reproducer for this problem. Another analysis by the Gemini AI collaborator found possibility of sync_blockdev() not waiting for write requests due to skipping __filemap_fdatawait_range() when filemap_fdatawrite_range() returned -EIO. Step 1: A test process is created and calls unshare(). Step 2: That process extracts a crafted JFS image to a memfd storage. Step 3: That process binds that image to a loop device. Step 4: That process mounts that loop device as read-write. Step 5: That process issues some buffered write requests. Step 6: That process is killed before writeback for Step 5 starts. Step 7: Automatic unmount operation starts due to teardown of a mount namespace. Step 8: jfs_umount() calls filemap_write_and_wait() (directly or via sync_blockdev()). Step 9: filemap_fdatawrite_range() returns -EIO due to filesystem errors after several submit_bio() have been already issued. Step 10: jfs_umount() completes without calling __filemap_fdatawait_range() which should wait for completion of I/O requests issued by Step 5 due to Step 9. Step 11: fput() is called from __loop_clr_fd() from lo_release(), and destruction of "struct file" starts after returning from lo_release(). Step 12: The in-flight I/O request issued by Step 9 is finally processed by the loop backend kworker. However, since the backing "struct file" (and its associated structures) is already under destruction, the kworker attempts to dereference now-invalid fields, leading to WARN_ON_ONCE(). In order to check whether the steps described above is actually happening, add debug code to the loop module for reporting I/O requests that are processed after __loop_clr_fd() started. Note that this debug code is enabled only if CONFIG_KCOV=y, for this check is a waste of computation resources for almost all users. Link: https://syzkaller.appspot.com/bug?extid=cd8a9a308e879a4e2c28 [1] Link: https://syzkaller.appspot.com/bug?extid=bc273027d5643e48e5b3 [2] Link: https://lkml.kernel.org/r/fbb3edda-f108-4e5b-acf2-266f043f8125@I-love.SAKURA.ne.jp [3] Assisted-by: Gemini-Pro Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
|
Upstream branch: b3dfbde |
ffc151b to
3421db9
Compare
|
Upstream branch: b3dfbde |
1 similar comment
|
Upstream branch: b3dfbde |
|
Github failed to update this PR after force push. Close it. |
Pull request for series with
subject: loop: Detect write requests that failed to wait for completion.
version: 1
url: https://patchwork.kernel.org/series/1183273/