diff options
| author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2026-06-29 20:41:17 +0900 |
|---|---|---|
| committer | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2026-06-29 20:41:17 +0900 |
| commit | 3ae78a69d3a9a4ad1d3b267324bd742654f40965 (patch) | |
| tree | 0096693986663ba1547662eb6320bdfe01f8c3de /include/linux/mman.h | |
| parent | 736de390972c25b87fe194540d18cab1cb0d58dc (diff) | |
| download | linux-next-3ae78a69d3a9a4ad1d3b267324bd742654f40965.tar.gz linux-next-3ae78a69d3a9a4ad1d3b267324bd742654f40965.zip | |
loop: Fix NULL pointer dereference in lo_rw_aio()
This is an experimental patch for testing.
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 65565ca5f99b
("block: unify the synchronous bi_end_io callbacks"), along with helper
refactorings like commit 92c3737a2473 ("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, this patch introduces a grace period for flushing pending I/O
requests (which should be a good thing from the perspective of defensive
programming) so that we won't hit NULL pointer dereference problem, and
also emits BUG: message in order to help filesystem developers identify
the caller of an I/O request that failed to wait for completion so that
filesystem developers can fix such caller to wait for completion.
Note that emitting BUG: message is enabled only if CONFIG_KCOV=y, for
this check is a waste of computation resources for almost all users.
Since Al Viro is reporting a problem with xfs/259 [4], this time
also emit debug messages when unmount fails with -EBUSY.
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]
Link: https://lkml.kernel.org/r/20260609175013.GH2636677@ZenIV [4]
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Diffstat (limited to 'include/linux/mman.h')
0 files changed, 0 insertions, 0 deletions
