[PATCH v3] powerpc/kuap: Allow kernel thread to access userspace after kthread_use_mm

Michael Ellerman patch-notifications at ellerman.id.au
Thu Feb 11 00:02:02 AEDT 2021


On Sat, 6 Feb 2021 08:26:34 +0530, Aneesh Kumar K.V wrote:
> This fix the bad fault reported by KUAP when io_wqe_worker access userspace.
> 
>  Bug: Read fault blocked by KUAP!
>  WARNING: CPU: 1 PID: 101841 at arch/powerpc/mm/fault.c:229 __do_page_fault+0x6b4/0xcd0
>  NIP [c00000000009e7e4] __do_page_fault+0x6b4/0xcd0
>  LR [c00000000009e7e0] __do_page_fault+0x6b0/0xcd0
> ..........
>  Call Trace:
>  [c000000016367330] [c00000000009e7e0] __do_page_fault+0x6b0/0xcd0 (unreliable)
>  [c0000000163673e0] [c00000000009ee3c] do_page_fault+0x3c/0x120
>  [c000000016367430] [c00000000000c848] handle_page_fault+0x10/0x2c
>  --- interrupt: 300 at iov_iter_fault_in_readable+0x148/0x6f0
> ..........
>  NIP [c0000000008e8228] iov_iter_fault_in_readable+0x148/0x6f0
>  LR [c0000000008e834c] iov_iter_fault_in_readable+0x26c/0x6f0
>  interrupt: 300
>  [c0000000163677e0] [c0000000007154a0] iomap_write_actor+0xc0/0x280
>  [c000000016367880] [c00000000070fc94] iomap_apply+0x1c4/0x780
>  [c000000016367990] [c000000000710330] iomap_file_buffered_write+0xa0/0x120
>  [c0000000163679e0] [c00800000040791c] xfs_file_buffered_aio_write+0x314/0x5e0 [xfs]
>  [c000000016367a90] [c0000000006d74bc] io_write+0x10c/0x460
>  [c000000016367bb0] [c0000000006d80e4] io_issue_sqe+0x8d4/0x1200
>  [c000000016367c70] [c0000000006d8ad0] io_wq_submit_work+0xc0/0x250
>  [c000000016367cb0] [c0000000006e2578] io_worker_handle_work+0x498/0x800
>  [c000000016367d40] [c0000000006e2cdc] io_wqe_worker+0x3fc/0x4f0
>  [c000000016367da0] [c0000000001cb0a4] kthread+0x1c4/0x1d0
>  [c000000016367e10] [c00000000000dbf0] ret_from_kernel_thread+0x5c/0x6c
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/kuap: Allow kernel thread to access userspace after kthread_use_mm
      https://git.kernel.org/powerpc/c/8c511eff1827239f24ded212b1bcda7ca5b16203

cheers


More information about the Linuxppc-dev mailing list