On 6/19/20 5:57 PM, Bijan Mottahedeh wrote: > The liburing read-write test crashes with the strack trace below. > > The problem is NULL current->mm dereference in io_req_work_grab_env(). > > Sending this as RFC since I'm not sure about any personality implications > of unconditionally using sqo_mm, and the proper way of failing the > request if no valid mm is found. > > [ 227.308192] BUG: kernel NULL pointer dereference, address: 0000000000000060 > [ 227.310320] #PF: supervisor write access in kernel mode > [ 227.311789] #PF: error_code(0x0002) - not-present page > [ 227.313170] PGD 8000000f951e7067 P4D 8000000f951e7067 PUD f9768d067 PMD 0 > [ 227.314918] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC PTI > [ 227.316094] CPU: 4 PID: 6209 Comm: io_uring-sq Not tainted 5.8.0-rc1-next-203 > [ 227.318050] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-4 > [ 227.319964] RIP: 0010:__io_queue_sqe+0x503/0x790 > [ 227.320706] Code: 68 00 00 00 01 49 83 be c8 00 00 00 00 75 2d 42 f6 04 bd 60 > [ 227.323688] RSP: 0018:ffffc90001297db8 EFLAGS: 00010202 > [ 227.324520] RAX: ffff888f9aa90040 RBX: ffff888f98dc8af8 RCX: 0000000000000000 > [ 227.325644] RDX: 0000000000000000 RSI: 0000000000001000 RDI: ffff888f98dc8b28 > [ 227.326767] RBP: ffffc90001297e38 R08: ffffc90001297c18 R09: 0000000000000001 > [ 227.327929] R10: 00000000ffffffeb R11: ffff888facb3b800 R12: 0000000000000000 > [ 227.329042] R13: ffff888facb3b800 R14: ffff888f98dc8a40 R15: 0000000000000001 > [ 227.330155] FS: 0000000000000000(0000) GS:ffff888ff0e00000(0000) knlGS:00000 > [ 227.331419] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 227.332338] CR2: 0000000000000060 CR3: 0000000f97bbc002 CR4: 0000000000160ee0 > [ 227.333449] Call Trace: > [ 227.333864] ? kvm_sched_clock_read+0xd/0x20 > [ 227.334537] ? task_work_run+0x61/0x80 > [ 227.335151] io_async_buf_retry+0x3b/0x50 > [ 227.335760] task_work_run+0x6a/0x80 > [ 227.336356] io_sq_thread+0x14e/0x320 Ah I missed you're running for-next, the next update should work for you, the io_async_buf_retry() got fixed with the necessary mm grab for SQPOLL a few days ago: https://git.kernel.dk/cgit/linux-block/commit/?h=async-buffered.8&id=3ad1d68c04bf9555942b63b5aba31e446fdcf355 -- Jens Axboe