linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: syzbot <syzbot+1c58afed1cfd2f57efee@syzkaller.appspotmail.com>
Cc: akpm@linux-foundation.org, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mingo@redhat.com, syzkaller-bugs@googlegroups.com,
	tglx@linutronix.de, x86@kernel.org
Subject: Re: [syzbot] [mm?] KASAN: slab-use-after-free Read in move_pages_pte
Date: Mon, 9 Dec 2024 15:58:31 +0800	[thread overview]
Message-ID: <e4f64f16-7b8c-4f77-beb3-336334a7d3ea@bytedance.com> (raw)
In-Reply-To: <6756a166.050a0220.2477f.0039.GAE@google.com>



On 2024/12/9 15:51, syzbot wrote:
> Hello,
> 
> syzbot has tested the proposed patch but the reproducer is still triggering an issue:
> WARNING in move_pages_pte
> 
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 6741 at mm/userfaultfd.c:1188 move_pages_pte+0x26bb/0x3400 mm/userfaultfd.c:1188

The code of triggering warning is as follows:

	/* Sanity checks before the operation */
	if (WARN_ON_ONCE(pmd_none(*dst_pmd)) ||	WARN_ON_ONCE(pmd_none(*src_pmd)) ||
	    WARN_ON_ONCE(pmd_trans_huge(*dst_pmd)) || 
WARN_ON_ONCE(pmd_trans_huge(*src_pmd))) {
		err = -EINVAL;
		goto out;
	}

This is expected, we can just remove these WARN_ON_ONCE().

> Modules linked in:
> CPU: 0 UID: 0 PID: 6741 Comm: syz.0.36 Not tainted 6.13.0-rc1-syzkaller-00172-g6e165f544379-dirty #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
> RIP: 0010:move_pages_pte+0x26bb/0x3400 mm/userfaultfd.c:1188
> Code: 8d ff b8 f5 ff ff ff e9 f9 f1 ff ff e8 de 41 8d ff 90 0f 0b 90 b8 ea ff ff ff 48 89 44 24 18 e9 9a fb ff ff e8 c6 41 8d ff 90 <0f> 0b 90 eb 14 e8 bb 41 8d ff 90 0f 0b 90 eb 09 e8 b0 41 8d ff 90
> RSP: 0018:ffffc900034871c0 EFLAGS: 00010293
> RAX: ffffffff8212016a RBX: 0000000000000000 RCX: ffff88801fbb9e00
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: ffffc90003487600 R08: ffffffff8211df31 R09: 1ffffffff2853d10
> R10: dffffc0000000000 R11: fffffbfff2853d11 R12: dffffc0000000000
> R13: 0000000000000000 R14: 00000000321be067 R15: 0000000000000000
> FS:  00007fd136ec86c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007fd136ea6fb8 CR3: 0000000031194000 CR4: 00000000003526f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>   <TASK>
>   move_pages+0xdd7/0x1600 mm/userfaultfd.c:1742
>   userfaultfd_move fs/userfaultfd.c:1899 [inline]
>   userfaultfd_ioctl+0x518b/0x6770 fs/userfaultfd.c:2022
>   vfs_ioctl fs/ioctl.c:51 [inline]
>   __do_sys_ioctl fs/ioctl.c:906 [inline]
>   __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
>   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
>   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
>   entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7fd13617ff19
> Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007fd136ec8058 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007fd136345fa0 RCX: 00007fd13617ff19
> RDX: 0000000020000080 RSI: 00000000c028aa05 RDI: 0000000000000003
> RBP: 00007fd1361f3986 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 0000000000000000 R14: 00007fd136345fa0 R15: 00007ffd06723498
>   </TASK>
> 
> 
> Tested on:
> 
> commit:         6e165f54 mm/page_isolation: fixup isolate_single_pageb..
> git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
> console output: https://syzkaller.appspot.com/x/log.txt?x=14142b30580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=3884fb5fa6f2533c
> dashboard link: https://syzkaller.appspot.com/bug?extid=1c58afed1cfd2f57efee
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> patch:          https://syzkaller.appspot.com/x/patch.diff?x=11245944580000
> 


  reply	other threads:[~2024-12-09  7:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 17:14 syzbot
2024-12-09  6:25 ` Qi Zheng
2024-12-09  6:48   ` Qi Zheng
2024-12-09  6:50     ` syzbot
2024-12-09  7:00   ` Qi Zheng
2024-12-09  7:02     ` syzbot
2024-12-09  7:56     ` Yu Zhao
2024-12-09  8:09       ` Qi Zheng
2024-12-09  9:20         ` Qi Zheng
2024-12-09  7:33 ` Qi Zheng
2024-12-09  7:51   ` syzbot
2024-12-09  7:58     ` Qi Zheng [this message]
2024-12-09  9:31 ` Qi Zheng
2024-12-09 11:39   ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e4f64f16-7b8c-4f77-beb3-336334a7d3ea@bytedance.com \
    --to=zhengqi.arch@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=syzbot+1c58afed1cfd2f57efee@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox