Linux IOMMU Development
 help / color / mirror / Atom feed
From: Pengfei Xu <pengfei.xu@intel.com>
To: <jgg@ziepe.ca>, <jgg@nvidia.com>
Cc: <iommu@lists.linux.dev>, <kevin.tian@intel.com>,
	<yi.l.liu@intel.com>, <heng.su@intel.com>, <lkp@intel.com>
Subject: Re: [Syzkaller & bisect] There is pfn_reader_user_pin related WARNING in v6.3-rc2 kernel
Date: Tue, 14 Mar 2023 09:40:33 +0800	[thread overview]
Message-ID: <ZA/QkW801jpfcYGJ@xpf.sh.intel.com> (raw)
In-Reply-To: <ZA/O6vGUfni158oK@xpf.sh.intel.com>

Sorry to resend the correct iommu mailing list.

On 2023-03-14 at 09:33:30 +0800, Pengfei Xu wrote:
> Hi Jason and iommu experts,
> 
> Greeting!
> 
> Platform: x86 platforms
> There is pfn_reader_user_pin related WARNING in v6.3-rc2 kernel:
> 
> All detailed info: https://github.com/xupengfe/syzkaller_logs/tree/main/230314_024214_pfn_reader_user_pin
> Reproduced code: https://github.com/xupengfe/syzkaller_logs/blob/main/230314_024214_pfn_reader_user_pin/repro.c
> Kconfig: https://github.com/xupengfe/syzkaller_logs/blob/main/230314_024214_pfn_reader_user_pin/kconfig_origin
> Issue dmesg: https://github.com/xupengfe/syzkaller_logs/blob/main/230314_024214_pfn_reader_user_pin/eeac8ede17557680855031c6f305ece2378af326_dmesg.log#L676
> Bisect info: https://github.com/xupengfe/syzkaller_logs/blob/main/230314_024214_pfn_reader_user_pin/bisect_info.log
> 
> "
> [   24.721671] memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=331 'systemd'
> [   28.878030] ------------[ cut here ]------------
> [   28.878512] WARNING: CPU: 0 PID: 518 at drivers/iommu/iommufd/pages.c:793 pfn_reader_user_pin+0x2e6/0x390
> [   28.879291] Modules linked in:
> [   28.879557] CPU: 0 PID: 518 Comm: repro Not tainted 6.3.0-rc2-eeac8ede1755+ #1
> [   28.880120] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
> [   28.880984] RIP: 0010:pfn_reader_user_pin+0x2e6/0x390
> [   28.881431] Code: b1 11 e9 25 fe ff ff e8 28 e4 0f ff 31 ff 48 89 de e8 2e e6 0f ff 48 85 db 74 0a e8 14 e4 0f ff e9 4d ff ff ff e8 0a e4 0f ff <0f> 0b bb f2 ff ff ff e9 3c ff ff ff e8 f9 e3 0f ff ba 01 00 00 00
> [   28.882819] RSP: 0018:ffffc90000f9fa30 EFLAGS: 00010246
> [   28.883230] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff821e2b72
> [   28.883786] RDX: 0000000000000000 RSI: ffff888014184680 RDI: 0000000000000002
> [   28.884335] RBP: ffffc90000f9fa78 R08: 00000000000000ff R09: 0000000079de6f4e
> [   28.884886] R10: ffffc90000f9f790 R11: ffff888014185418 R12: ffffc90000f9fc60
> [   28.885460] R13: 0000000000000002 R14: ffff888007879800 R15: 0000000000000000
> [   28.886018] FS:  00007f4227555740(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000
> [   28.886636] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   28.887084] CR2: 0000000020000043 CR3: 000000000e748005 CR4: 0000000000770ef0
> [   28.887670] PKRU: 55555554
> [   28.887902] Call Trace:
> [   28.888105]  <TASK>
> [   28.888291]  pfn_reader_next+0x14a/0x7b0
> [   28.888619]  ? interval_tree_double_span_iter_update+0x11a/0x140
> [   28.889140]  pfn_reader_first+0x140/0x1b0
> [   28.889484]  iopt_pages_rw_slow+0x71/0x280
> [   28.889830]  ? __this_cpu_preempt_check+0x20/0x30
> [   28.890287]  iopt_pages_rw_access+0x2b2/0x5b0
> [   28.890679]  iommufd_access_rw+0x19f/0x2f0
> [   28.891025]  iommufd_test+0xd11/0x16f0
> [   28.891342]  ? write_comp_data+0x2f/0x90
> [   28.891697]  iommufd_fops_ioctl+0x206/0x330
> [   28.892053]  __x64_sys_ioctl+0x10e/0x160
> [   28.892391]  ? __pfx_iommufd_fops_ioctl+0x10/0x10
> [   28.892784]  do_syscall_64+0x3b/0x90
> [   28.893124]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
> [   28.893553] RIP: 0033:0x7f422767a59d
> [   28.893850] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 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 8b 0d d3 08 0d 00 f7 d8 64 89 01 48
> [   28.895247] RSP: 002b:00007ffeeb8f6638 EFLAGS: 00000206 ORIG_RAX: 0000000000000010
> [   28.895852] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f422767a59d
> [   28.896403] RDX: 00000000200001c0 RSI: 0000000000003ba0 RDI: 0000000000000006
> [   28.896952] RBP: 00007ffeeb8f6650 R08: 00007ffeeb8f6730 R09: 00007ffeeb8f6730
> [   28.897530] R10: 00007ffeeb8f6730 R11: 0000000000000206 R12: 0000000000401060
> [   28.898098] R13: 00007ffeeb8f6730 R14: 0000000000000000 R15: 0000000000000000
> [   28.898659]  </TASK>
> [   28.898845] irq event stamp: 4555
> [   28.899111] hardirqs last  enabled at (4563): [<ffffffff811eac21>] __up_console_sem+0x91/0xb0
> [   28.899769] hardirqs last disabled at (4570): [<ffffffff811eac06>] __up_console_sem+0x76/0xb0
> [   28.900156] softirqs last  enabled at (3896): [<ffffffff83024a4c>] __do_softirq+0x31c/0x49c
> [   28.900541] softirqs last disabled at (3783): [<ffffffff8112b5a4>] irq_exit_rcu+0xc4/0x100
> [   28.900924] ---[ end trace 0000000000000000 ]---
> "
> 
> Bisected and found the first bad commit:
> "
> f4b20bb34c83dceade5470288f48f94ce3598ada
> iommufd: Add kernel support for testing iommufd
> "
> 
> There is no this issue's report yet in syzbot link:
> https://syzkaller.appspot.com/upstream
> 
> I hope it's helpful.
> 
> Thanks!
> 
> ---
> 
> If you don't need the following environment to reproduce the problem or if you
> already have one, please ignore the following information.
> 
> How to reproduce:
> git clone https://gitlab.com/xupengfe/repro_vm_env.git
> cd repro_vm_env
> tar -xvf repro_vm_env.tar.gz
> cd repro_vm_env; ./start3.sh  // it needs qemu-system-x86_64 and I used v7.1.0
>    // start3.sh will load bzImage_2241ab53cbb5cdb08a6b2d4688feb13971058f65 v6.2-rc5 kernel
>    // You could change the bzImage_xxx as you want
> You could use below command to log in, there is no password for root.
> ssh -p 10023 root@localhost
> 
> After login vm(virtual machine) successfully, you could transfer reproduced
> binary to the vm by below way, and reproduce the problem in vm:
> gcc -pthread -o repro repro.c
> scp -P 10023 repro root@localhost:/root/
> 
> Get the bzImage for target kernel:
> Please use target kconfig and copy it to kernel_src/.config
> make olddefconfig
> make -jx bzImage           //x should equal or less than cpu num your pc has
> 
> Fill the bzImage file into above start3.sh to load the target kernel in vm.
> 
> 
> Tips:
> If you already have qemu-system-x86_64, please ignore below info.
> If you want to install qemu v7.1.0 version:
> git clone https://github.com/qemu/qemu.git
> cd qemu
> git checkout -f v7.1.0
> mkdir build
> cd build
> yum install -y ninja-build.x86_64
> ../configure --target-list=x86_64-softmmu --enable-kvm --enable-vnc --enable-gtk --enable-sdl
> make
> make install
> 
> Thanks!
> BR.

           reply	other threads:[~2023-03-14  1:39 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <ZA/O6vGUfni158oK@xpf.sh.intel.com>]

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=ZA/QkW801jpfcYGJ@xpf.sh.intel.com \
    --to=pengfei.xu@intel.com \
    --cc=heng.su@intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=lkp@intel.com \
    --cc=yi.l.liu@intel.com \
    /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