Re: [syzbot] [mm?] KASAN: slab-use-after-free Read in __mmap_region
From: Jann Horn
Date: Fri Dec 06 2024 - 16:30:55 EST
On Fri, Dec 6, 2024 at 10:18 PM syzbot
<syzbot+91cf8da9401355f946c3@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: e70140ba0d2b Get rid of 'remove_new' relic from platform d..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=13300330580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=50c7a61469ce77e7
> dashboard link: https://syzkaller.appspot.com/bug?extid=91cf8da9401355f946c3
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=124130df980000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10a280f8580000
>
> Downloadable assets:
> disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7feb34a89c2a/non_bootable_disk-e70140ba.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/91f313d8125b/vmlinux-e70140ba.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/a9bdf286943a/bzImage-e70140ba.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+91cf8da9401355f946c3@xxxxxxxxxxxxxxxxxxxxxxxxx
>
> ==================================================================
> BUG: KASAN: slab-use-after-free in __mmap_complete mm/vma.c:2408 [inline]
> BUG: KASAN: slab-use-after-free in __mmap_region+0x1802/0x2cd0 mm/vma.c:2469
> Read of size 8 at addr ffff8880403a6118 by task syz-executor239/5461
This looks like it was introduced by commit 5ac87a885aec ("mm: defer
second attempt at merge on mmap()"), which went into 6.13-rc1? From a
glance it seems like the "vma_merge_existing_range(&vmg)" in
__mmap_region() needs a "vma = " at the start of the line.