Re: [syzbot] [mm?] KASAN: slab-use-after-free Read in folio_evictable (3)

Hillf Danton
2024-12-14T00:45:41Z

On Fri, Dec 13, 2024 at 9:18
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: f932fb9b4074 Merge tag 'v6.13-rc2-ksmbd-server-fixes' of g..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14654730580000

#syz test

--- x/mm/filemap.c
+++ y/mm/filemap.c
@@ -871,6 +871,7 @@ noinline int __filemap_add_folio(struct
folio_ref_add(folio, nr);
folio->mapping = mapping;
folio->index = xas.xa_index;
+ BUG_ON(mapping_exiting(mapping));

for (;;) {
int order = -1, split_order = 0;
--- x/block/blk.h
+++ y/block/blk.h
@@ -72,8 +72,6 @@ static inline int bio_queue_enter(struct
struct request_queue *q = bdev_get_queue(bio->bi_bdev);

if (blk_try_enter_queue(q, false)) {
- rwsem_acquire_read(&q->io_lockdep_map, 0, 0, _RET_IP_);
- rwsem_release(&q->io_lockdep_map, _RET_IP_);
return 0;
}
return __bio_queue_enter(q, bio);
--