public inbox for [email protected]
 help / color / mirror / Atom feed
* [bug report] WARNING: CPU: 2 PID: 3445306 at drivers/block/ublk_drv.c:2633 ublk_ctrl_start_recovery.constprop.0+0x74/0x180
@ 2024-05-24  3:49 Changhui Zhong
  2024-05-24  9:45 ` Li Nan
  0 siblings, 1 reply; 4+ messages in thread
From: Changhui Zhong @ 2024-05-24  3:49 UTC (permalink / raw)
  To: Linux Block Devices, io-uring; +Cc: Ming Lei

Hello,

I hit the kernel panic when running test ubdsrv  generic/005,
please help check it and let me know if you need any info/testing for
it, thanks.

repo:https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
branch:for-next
commit: b785211c726fbe77ff559f0241aab8d3dadd9988

dmesg log:
[ 7203.196155] ------------[ cut here ]------------
[ 7203.200779] WARNING: CPU: 2 PID: 3445306 at
drivers/block/ublk_drv.c:2633
ublk_ctrl_start_recovery.constprop.0+0x74/0x180
[ 7203.211732] Modules linked in: ext4 mbcache jbd2 raid10 raid1 raid0
dm_raid raid456 async_raid6_recov async_memcpy async_pq async_xor xor
async_tx raid6_pq loop nf_tables nfnetlink tls rpcsec_gss_krb5
auth_rpcgss nfsv4 dns_resolver nfs lockd grace netfs rfkill sunrpc
vfat fat dm_multipath intel_rapl_msr intel_rapl_common
intel_uncore_frequency intel_uncore_frequency_common i10nm_edac nfit
libnvdimm x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel
ipmi_ssif kvm mgag200 dax_hmem iTCO_wdt i2c_algo_bit rapl
iTCO_vendor_support cxl_acpi drm_shmem_helper intel_cstate cxl_core
drm_kms_helper acpi_power_meter mei_me dcdbas dell_smbios i2c_i801
intel_uncore einj isst_if_mmio isst_if_mbox_pci ipmi_si
dell_wmi_descriptor wmi_bmof pcspkr mei i2c_smbus isst_if_common
acpi_ipmi intel_vsec intel_pch_thermal ipmi_devintf ipmi_msghandler
drm fuse xfs libcrc32c sd_mod t10_pi sg ahci libahci crct10dif_pclmul
crc32_pclmul crc32c_intel libata tg3 ghash_clmulni_intel wmi dm_mirror
dm_region_hash dm_log dm_mod
[ 7203.211779]  [last unloaded: null_blk]
[ 7203.303523] CPU: 2 PID: 3445306 Comm: iou-wrk-3445292 Not tainted 6.9.0+ #1
[ 7203.310482] Hardware name: Dell Inc. PowerEdge R650xs/0PPTY2, BIOS
1.4.4 10/07/2021
[ 7203.318135] RIP: 0010:ublk_ctrl_start_recovery.constprop.0+0x74/0x180
[ 7203.324573] Code: 00 0f 84 9e 00 00 00 45 31 f6 bd ff ff ff ff 44
89 f3 41 0f af 5d 10 49 03 5d 08 48 8b 7b 10 48 85 ff 74 06 f6 47 2c
04 75 02 <0f> 0b 31 d2 4c 8d 47 28 89 e8 66 89 53 38 f0 0f c1 47 28 83
f8 01
[ 7203.343319] RSP: 0018:ff59ae67453ffce0 EFLAGS: 00010246
[ 7203.348544] RAX: 0000000000000002 RBX: ff2fabb3b5682000 RCX: 0000000000000000
[ 7203.355678] RDX: ff2fabb261e18000 RSI: ffffffffa324ee00 RDI: 0000000000000000
[ 7203.362812] RBP: 00000000ffffffff R08: 0000000000000000 R09: ffffffffa36e33e0
[ 7203.369943] R10: 0000000000000000 R11: 0000000000000000 R12: ff2fabb3ae44a468
[ 7203.377078] R13: ff2fabb3ae44a000 R14: 0000000000000000 R15: ff2fabb3ce150080
[ 7203.384210] FS:  00007fbed107c740(0000) GS:ff2fabb5af700000(0000)
knlGS:0000000000000000
[ 7203.392294] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 7203.398041] CR2: 00007f4428078584 CR3: 000000011baa0004 CR4: 0000000000771ef0
[ 7203.405174] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 7203.412308] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 7203.419441] PKRU: 55555554
[ 7203.422151] Call Trace:
[ 7203.424605]  <TASK>
[ 7203.426713]  ? __warn+0x7f/0x120
[ 7203.429943]  ? ublk_ctrl_start_recovery.constprop.0+0x74/0x180
[ 7203.435778]  ? report_bug+0x18a/0x1a0
[ 7203.439445]  ? handle_bug+0x3c/0x70
[ 7203.442943]  ? exc_invalid_op+0x14/0x70
[ 7203.446782]  ? asm_exc_invalid_op+0x16/0x20
[ 7203.450970]  ? ublk_ctrl_start_recovery.constprop.0+0x74/0x180
[ 7203.456802]  ublk_ctrl_uring_cmd+0x4f7/0x6c0
[ 7203.461075]  ? pick_next_task_idle+0x26/0x40
[ 7203.465347]  io_uring_cmd+0x9a/0x1b0
[ 7203.468929]  io_issue_sqe+0x193/0x3f0
[ 7203.472602]  io_wq_submit_work+0x9b/0x390
[ 7203.476613]  io_worker_handle_work+0x165/0x360
[ 7203.481059]  io_wq_worker+0xcb/0x2f0
[ 7203.484640]  ? finish_task_switch.isra.0+0x203/0x290
[ 7203.489608]  ? finish_task_switch.isra.0+0x203/0x290
[ 7203.494572]  ? __pfx_io_wq_worker+0x10/0x10
[ 7203.498758]  ret_from_fork+0x2d/0x50
[ 7203.502338]  ? __pfx_io_wq_worker+0x10/0x10
[ 7203.506523]  ret_from_fork_asm+0x1a/0x30
[ 7203.510451]  </TASK>
[ 7203.512643] ---[ end trace 0000000000000000 ]---
[ 7203.517263] BUG: kernel NULL pointer dereference, address: 0000000000000028
[ 7203.524220] #PF: supervisor write access in kernel mode
[ 7203.529445] #PF: error_code(0x0002) - not-present page
[ 7203.534584] PGD 2761af067 P4D 442db4067 PUD 1727a2067 PMD 0
[ 7203.540244] Oops: Oops: 0002 [#1] PREEMPT SMP NOPTI
[ 7203.545123] CPU: 2 PID: 3445306 Comm: iou-wrk-3445292 Tainted: G
    W          6.9.0+ #1
[ 7203.553556] Hardware name: Dell Inc. PowerEdge R650xs/0PPTY2, BIOS
1.4.4 10/07/2021
[ 7203.561208] RIP: 0010:ublk_ctrl_start_recovery.constprop.0+0x82/0x180
[ 7203.567647] Code: ff 44 89 f3 41 0f af 5d 10 49 03 5d 08 48 8b 7b
10 48 85 ff 74 06 f6 47 2c 04 75 02 0f 0b 31 d2 4c 8d 47 28 89 e8 66
89 53 38 <f0> 0f c1 47 28 83 f8 01 0f 84 b5 00 00 00 85 c0 0f 8e b7 00
00 00
[ 7203.586395] RSP: 0018:ff59ae67453ffce0 EFLAGS: 00010246
[ 7203.591622] RAX: 00000000ffffffff RBX: ff2fabb3b5682000 RCX: 0000000000000000
[ 7203.598755] RDX: 0000000000000000 RSI: ffffffffa324ee00 RDI: 0000000000000000
[ 7203.605886] RBP: 00000000ffffffff R08: 0000000000000028 R09: ffffffffa36e33e0
[ 7203.613020] R10: 0000000000000000 R11: 0000000000000000 R12: ff2fabb3ae44a468
[ 7203.620153] R13: ff2fabb3ae44a000 R14: 0000000000000000 R15: ff2fabb3ce150080
[ 7203.627284] FS:  00007fbed107c740(0000) GS:ff2fabb5af700000(0000)
knlGS:0000000000000000
[ 7203.635371] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 7203.641117] CR2: 0000000000000028 CR3: 000000011baa0004 CR4: 0000000000771ef0
[ 7203.648248] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 7203.655383] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 7203.662514] PKRU: 55555554
[ 7203.665227] Call Trace:
[ 7203.667681]  <TASK>
[ 7203.669785]  ? __die+0x20/0x70
[ 7203.672845]  ? page_fault_oops+0x75/0x170
[ 7203.676860]  ? exc_page_fault+0x64/0x140
[ 7203.680785]  ? asm_exc_page_fault+0x22/0x30
[ 7203.684969]  ? ublk_ctrl_start_recovery.constprop.0+0x82/0x180
[ 7203.690804]  ublk_ctrl_uring_cmd+0x4f7/0x6c0
[ 7203.695076]  ? pick_next_task_idle+0x26/0x40
[ 7203.699350]  io_uring_cmd+0x9a/0x1b0
[ 7203.702927]  io_issue_sqe+0x193/0x3f0
[ 7203.706595]  io_wq_submit_work+0x9b/0x390
[ 7203.710607]  io_worker_handle_work+0x165/0x360
[ 7203.715054]  io_wq_worker+0xcb/0x2f0
[ 7203.718633]  ? finish_task_switch.isra.0+0x203/0x290
[ 7203.723597]  ? finish_task_switch.isra.0+0x203/0x290
[ 7203.728564]  ? __pfx_io_wq_worker+0x10/0x10
[ 7203.732749]  ret_from_fork+0x2d/0x50
[ 7203.736330]  ? __pfx_io_wq_worker+0x10/0x10
[ 7203.740514]  ret_from_fork_asm+0x1a/0x30
[ 7203.744441]  </TASK>
[ 7203.746634] Modules linked in: ext4 mbcache jbd2 raid10 raid1 raid0
dm_raid raid456 async_raid6_recov async_memcpy async_pq async_xor xor
async_tx raid6_pq loop nf_tables nfnetlink tls rpcsec_gss_krb5
auth_rpcgss nfsv4 dns_resolver nfs lockd grace netfs rfkill sunrpc
vfat fat dm_multipath intel_rapl_msr intel_rapl_common
intel_uncore_frequency intel_uncore_frequency_common i10nm_edac nfit
libnvdimm x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel
ipmi_ssif kvm mgag200 dax_hmem iTCO_wdt i2c_algo_bit rapl
iTCO_vendor_support cxl_acpi drm_shmem_helper intel_cstate cxl_core
drm_kms_helper acpi_power_meter mei_me dcdbas dell_smbios i2c_i801
intel_uncore einj isst_if_mmio isst_if_mbox_pci ipmi_si
dell_wmi_descriptor wmi_bmof pcspkr mei i2c_smbus isst_if_common
acpi_ipmi intel_vsec intel_pch_thermal ipmi_devintf ipmi_msghandler
drm fuse xfs libcrc32c sd_mod t10_pi sg ahci libahci crct10dif_pclmul
crc32_pclmul crc32c_intel libata tg3 ghash_clmulni_intel wmi dm_mirror
dm_region_hash dm_log dm_mod
[ 7203.746668]  [last unloaded: null_blk]
[ 7203.838416] CR2: 0000000000000028
[ 7203.841734] ---[ end trace 0000000000000000 ]---
[ 7203.919227] RIP: 0010:ublk_ctrl_start_recovery.constprop.0+0x82/0x180
[ 7203.925673] Code: ff 44 89 f3 41 0f af 5d 10 49 03 5d 08 48 8b 7b
10 48 85 ff 74 06 f6 47 2c 04 75 02 0f 0b 31 d2 4c 8d 47 28 89 e8 66
89 53 38 <f0> 0f c1 47 28 83 f8 01 0f 84 b5 00 00 00 85 c0 0f 8e b7 00
00 00
[ 7203.944417] RSP: 0018:ff59ae67453ffce0 EFLAGS: 00010246
[ 7203.949646] RAX: 00000000ffffffff RBX: ff2fabb3b5682000 RCX: 0000000000000000
[ 7203.956778] RDX: 0000000000000000 RSI: ffffffffa324ee00 RDI: 0000000000000000
[ 7203.963909] RBP: 00000000ffffffff R08: 0000000000000028 R09: ffffffffa36e33e0
[ 7203.971042] R10: 0000000000000000 R11: 0000000000000000 R12: ff2fabb3ae44a468
[ 7203.978174] R13: ff2fabb3ae44a000 R14: 0000000000000000 R15: ff2fabb3ce150080
[ 7203.985307] FS:  00007fbed107c740(0000) GS:ff2fabb5af700000(0000)
knlGS:0000000000000000
[ 7203.993395] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 7203.999139] CR2: 0000000000000028 CR3: 000000011baa0004 CR4: 0000000000771ef0
[ 7204.006274] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 7204.013405] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 7204.020537] PKRU: 55555554
[ 7204.023250] Kernel panic - not syncing: Fatal exception
[ 7204.028542] Kernel Offset: 0x20a00000 from 0xffffffff81000000
(relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 7204.110552] ---[ end Kernel panic - not syncing: Fatal exception ]---

--
Best Regards,
     Changhui


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bug report] WARNING: CPU: 2 PID: 3445306 at drivers/block/ublk_drv.c:2633 ublk_ctrl_start_recovery.constprop.0+0x74/0x180
  2024-05-24  3:49 [bug report] WARNING: CPU: 2 PID: 3445306 at drivers/block/ublk_drv.c:2633 ublk_ctrl_start_recovery.constprop.0+0x74/0x180 Changhui Zhong
@ 2024-05-24  9:45 ` Li Nan
  2024-05-25  7:19   ` Li Nan
  0 siblings, 1 reply; 4+ messages in thread
From: Li Nan @ 2024-05-24  9:45 UTC (permalink / raw)
  To: Changhui Zhong, Linux Block Devices, io-uring
  Cc: Ming Lei, [email protected], yukuai (C), [email protected],
	[email protected]



在 2024/5/24 11:49, Changhui Zhong 写道:
> Hello,
> 
> I hit the kernel panic when running test ubdsrv  generic/005,
> please help check it and let me know if you need any info/testing for
> it, thanks.
> 
> repo:https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
> branch:for-next
> commit: b785211c726fbe77ff559f0241aab8d3dadd9988
> 
> dmesg log:
> [ 7203.196155] ------------[ cut here ]------------
> [ 7203.200779] WARNING: CPU: 2 PID: 3445306 at
> drivers/block/ublk_drv.c:2633
> ublk_ctrl_start_recovery.constprop.0+0x74/0x180
> [ 7203.211732] Modules linked in: ext4 mbcache jbd2 raid10 raid1 raid0
> dm_raid raid456 async_raid6_recov async_memcpy async_pq async_xor xor
> async_tx raid6_pq loop nf_tables nfnetlink tls rpcsec_gss_krb5
> auth_rpcgss nfsv4 dns_resolver nfs lockd grace netfs rfkill sunrpc
> vfat fat dm_multipath intel_rapl_msr intel_rapl_common
> intel_uncore_frequency intel_uncore_frequency_common i10nm_edac nfit
> libnvdimm x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel
> ipmi_ssif kvm mgag200 dax_hmem iTCO_wdt i2c_algo_bit rapl
> iTCO_vendor_support cxl_acpi drm_shmem_helper intel_cstate cxl_core
> drm_kms_helper acpi_power_meter mei_me dcdbas dell_smbios i2c_i801
> intel_uncore einj isst_if_mmio isst_if_mbox_pci ipmi_si
> dell_wmi_descriptor wmi_bmof pcspkr mei i2c_smbus isst_if_common
> acpi_ipmi intel_vsec intel_pch_thermal ipmi_devintf ipmi_msghandler
> drm fuse xfs libcrc32c sd_mod t10_pi sg ahci libahci crct10dif_pclmul
> crc32_pclmul crc32c_intel libata tg3 ghash_clmulni_intel wmi dm_mirror
> dm_region_hash dm_log dm_mod
> [ 7203.211779]  [last unloaded: null_blk]
> [ 7203.303523] CPU: 2 PID: 3445306 Comm: iou-wrk-3445292 Not tainted 6.9.0+ #1
> [ 7203.310482] Hardware name: Dell Inc. PowerEdge R650xs/0PPTY2, BIOS
> 1.4.4 10/07/2021
> [ 7203.318135] RIP: 0010:ublk_ctrl_start_recovery.constprop.0+0x74/0x180
> [ 7203.324573] Code: 00 0f 84 9e 00 00 00 45 31 f6 bd ff ff ff ff 44
> 89 f3 41 0f af 5d 10 49 03 5d 08 48 8b 7b 10 48 85 ff 74 06 f6 47 2c
> 04 75 02 <0f> 0b 31 d2 4c 8d 47 28 89 e8 66 89 53 38 f0 0f c1 47 28 83
> f8 01
> [ 7203.343319] RSP: 0018:ff59ae67453ffce0 EFLAGS: 00010246
> [ 7203.348544] RAX: 0000000000000002 RBX: ff2fabb3b5682000 RCX: 0000000000000000
> [ 7203.355678] RDX: ff2fabb261e18000 RSI: ffffffffa324ee00 RDI: 0000000000000000
> [ 7203.362812] RBP: 00000000ffffffff R08: 0000000000000000 R09: ffffffffa36e33e0
> [ 7203.369943] R10: 0000000000000000 R11: 0000000000000000 R12: ff2fabb3ae44a468
> [ 7203.377078] R13: ff2fabb3ae44a000 R14: 0000000000000000 R15: ff2fabb3ce150080
> [ 7203.384210] FS:  00007fbed107c740(0000) GS:ff2fabb5af700000(0000)
> knlGS:0000000000000000
> [ 7203.392294] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 7203.398041] CR2: 00007f4428078584 CR3: 000000011baa0004 CR4: 0000000000771ef0
> [ 7203.405174] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 7203.412308] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [ 7203.419441] PKRU: 55555554
> [ 7203.422151] Call Trace:
> [ 7203.424605]  <TASK>
> [ 7203.426713]  ? __warn+0x7f/0x120
> [ 7203.429943]  ? ublk_ctrl_start_recovery.constprop.0+0x74/0x180
> [ 7203.435778]  ? report_bug+0x18a/0x1a0
> [ 7203.439445]  ? handle_bug+0x3c/0x70
> [ 7203.442943]  ? exc_invalid_op+0x14/0x70
> [ 7203.446782]  ? asm_exc_invalid_op+0x16/0x20
> [ 7203.450970]  ? ublk_ctrl_start_recovery.constprop.0+0x74/0x180
> [ 7203.456802]  ublk_ctrl_uring_cmd+0x4f7/0x6c0
> [ 7203.461075]  ? pick_next_task_idle+0x26/0x40
> [ 7203.465347]  io_uring_cmd+0x9a/0x1b0
> [ 7203.468929]  io_issue_sqe+0x193/0x3f0
> [ 7203.472602]  io_wq_submit_work+0x9b/0x390
> [ 7203.476613]  io_worker_handle_work+0x165/0x360
> [ 7203.481059]  io_wq_worker+0xcb/0x2f0
> [ 7203.484640]  ? finish_task_switch.isra.0+0x203/0x290
> [ 7203.489608]  ? finish_task_switch.isra.0+0x203/0x290
> [ 7203.494572]  ? __pfx_io_wq_worker+0x10/0x10
> [ 7203.498758]  ret_from_fork+0x2d/0x50
> [ 7203.502338]  ? __pfx_io_wq_worker+0x10/0x10
> [ 7203.506523]  ret_from_fork_asm+0x1a/0x30
> [ 7203.510451]  </TASK>
> [ 7203.512643] ---[ end trace 0000000000000000 ]---
> [ 7203.517263] BUG: kernel NULL pointer dereference, address: 0000000000000028
> [ 7203.524220] #PF: supervisor write access in kernel mode
> [ 7203.529445] #PF: error_code(0x0002) - not-present page
> [ 7203.534584] PGD 2761af067 P4D 442db4067 PUD 1727a2067 PMD 0
> [ 7203.540244] Oops: Oops: 0002 [#1] PREEMPT SMP NOPTI
> [ 7203.545123] CPU: 2 PID: 3445306 Comm: iou-wrk-3445292 Tainted: G
>      W          6.9.0+ #1
> [ 7203.553556] Hardware name: Dell Inc. PowerEdge R650xs/0PPTY2, BIOS
> 1.4.4 10/07/2021
> [ 7203.561208] RIP: 0010:ublk_ctrl_start_recovery.constprop.0+0x82/0x180
> [ 7203.567647] Code: ff 44 89 f3 41 0f af 5d 10 49 03 5d 08 48 8b 7b
> 10 48 85 ff 74 06 f6 47 2c 04 75 02 0f 0b 31 d2 4c 8d 47 28 89 e8 66
> 89 53 38 <f0> 0f c1 47 28 83 f8 01 0f 84 b5 00 00 00 85 c0 0f 8e b7 00
> 00 00
> [ 7203.586395] RSP: 0018:ff59ae67453ffce0 EFLAGS: 00010246
> [ 7203.591622] RAX: 00000000ffffffff RBX: ff2fabb3b5682000 RCX: 0000000000000000
> [ 7203.598755] RDX: 0000000000000000 RSI: ffffffffa324ee00 RDI: 0000000000000000
> [ 7203.605886] RBP: 00000000ffffffff R08: 0000000000000028 R09: ffffffffa36e33e0
> [ 7203.613020] R10: 0000000000000000 R11: 0000000000000000 R12: ff2fabb3ae44a468
> [ 7203.620153] R13: ff2fabb3ae44a000 R14: 0000000000000000 R15: ff2fabb3ce150080
> [ 7203.627284] FS:  00007fbed107c740(0000) GS:ff2fabb5af700000(0000)
> knlGS:0000000000000000
> [ 7203.635371] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 7203.641117] CR2: 0000000000000028 CR3: 000000011baa0004 CR4: 0000000000771ef0
> [ 7203.648248] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 7203.655383] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [ 7203.662514] PKRU: 55555554
> [ 7203.665227] Call Trace:
> [ 7203.667681]  <TASK>
> [ 7203.669785]  ? __die+0x20/0x70
> [ 7203.672845]  ? page_fault_oops+0x75/0x170
> [ 7203.676860]  ? exc_page_fault+0x64/0x140
> [ 7203.680785]  ? asm_exc_page_fault+0x22/0x30
> [ 7203.684969]  ? ublk_ctrl_start_recovery.constprop.0+0x82/0x180
> [ 7203.690804]  ublk_ctrl_uring_cmd+0x4f7/0x6c0
> [ 7203.695076]  ? pick_next_task_idle+0x26/0x40
> [ 7203.699350]  io_uring_cmd+0x9a/0x1b0
> [ 7203.702927]  io_issue_sqe+0x193/0x3f0
> [ 7203.706595]  io_wq_submit_work+0x9b/0x390
> [ 7203.710607]  io_worker_handle_work+0x165/0x360
> [ 7203.715054]  io_wq_worker+0xcb/0x2f0
> [ 7203.718633]  ? finish_task_switch.isra.0+0x203/0x290
> [ 7203.723597]  ? finish_task_switch.isra.0+0x203/0x290
> [ 7203.728564]  ? __pfx_io_wq_worker+0x10/0x10
> [ 7203.732749]  ret_from_fork+0x2d/0x50
> [ 7203.736330]  ? __pfx_io_wq_worker+0x10/0x10
> [ 7203.740514]  ret_from_fork_asm+0x1a/0x30
> [ 7203.744441]  </TASK>
> [ 7203.746634] Modules linked in: ext4 mbcache jbd2 raid10 raid1 raid0
> dm_raid raid456 async_raid6_recov async_memcpy async_pq async_xor xor
> async_tx raid6_pq loop nf_tables nfnetlink tls rpcsec_gss_krb5
> auth_rpcgss nfsv4 dns_resolver nfs lockd grace netfs rfkill sunrpc
> vfat fat dm_multipath intel_rapl_msr intel_rapl_common
> intel_uncore_frequency intel_uncore_frequency_common i10nm_edac nfit
> libnvdimm x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel
> ipmi_ssif kvm mgag200 dax_hmem iTCO_wdt i2c_algo_bit rapl
> iTCO_vendor_support cxl_acpi drm_shmem_helper intel_cstate cxl_core
> drm_kms_helper acpi_power_meter mei_me dcdbas dell_smbios i2c_i801
> intel_uncore einj isst_if_mmio isst_if_mbox_pci ipmi_si
> dell_wmi_descriptor wmi_bmof pcspkr mei i2c_smbus isst_if_common
> acpi_ipmi intel_vsec intel_pch_thermal ipmi_devintf ipmi_msghandler
> drm fuse xfs libcrc32c sd_mod t10_pi sg ahci libahci crct10dif_pclmul
> crc32_pclmul crc32c_intel libata tg3 ghash_clmulni_intel wmi dm_mirror
> dm_region_hash dm_log dm_mod
> [ 7203.746668]  [last unloaded: null_blk]
> [ 7203.838416] CR2: 0000000000000028
> [ 7203.841734] ---[ end trace 0000000000000000 ]---
> [ 7203.919227] RIP: 0010:ublk_ctrl_start_recovery.constprop.0+0x82/0x180
> [ 7203.925673] Code: ff 44 89 f3 41 0f af 5d 10 49 03 5d 08 48 8b 7b
> 10 48 85 ff 74 06 f6 47 2c 04 75 02 0f 0b 31 d2 4c 8d 47 28 89 e8 66
> 89 53 38 <f0> 0f c1 47 28 83 f8 01 0f 84 b5 00 00 00 85 c0 0f 8e b7 00
> 00 00
> [ 7203.944417] RSP: 0018:ff59ae67453ffce0 EFLAGS: 00010246
> [ 7203.949646] RAX: 00000000ffffffff RBX: ff2fabb3b5682000 RCX: 0000000000000000
> [ 7203.956778] RDX: 0000000000000000 RSI: ffffffffa324ee00 RDI: 0000000000000000
> [ 7203.963909] RBP: 00000000ffffffff R08: 0000000000000028 R09: ffffffffa36e33e0
> [ 7203.971042] R10: 0000000000000000 R11: 0000000000000000 R12: ff2fabb3ae44a468
> [ 7203.978174] R13: ff2fabb3ae44a000 R14: 0000000000000000 R15: ff2fabb3ce150080
> [ 7203.985307] FS:  00007fbed107c740(0000) GS:ff2fabb5af700000(0000)
> knlGS:0000000000000000
> [ 7203.993395] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 7203.999139] CR2: 0000000000000028 CR3: 000000011baa0004 CR4: 0000000000771ef0
> [ 7204.006274] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 7204.013405] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [ 7204.020537] PKRU: 55555554
> [ 7204.023250] Kernel panic - not syncing: Fatal exception
> [ 7204.028542] Kernel Offset: 0x20a00000 from 0xffffffff81000000
> (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
> [ 7204.110552] ---[ end Kernel panic - not syncing: Fatal exception ]---
> 
> --
> Best Regards,
>       Changhui
> 
> 
> .

If ubq->ubq_daemon is NULL, WARN in ublk_queue_reinit() is triggered, and 
later NULL pointer dereference is triggered by:
   put_task_struct(ubq->ubq_daemon)

This issue might be triggered by two consecutive 
UBLK_CMD_START_USER_RECOVERY. I will try fix it soon.

-- 
Thanks,
Nan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bug report] WARNING: CPU: 2 PID: 3445306 at drivers/block/ublk_drv.c:2633 ublk_ctrl_start_recovery.constprop.0+0x74/0x180
  2024-05-24  9:45 ` Li Nan
@ 2024-05-25  7:19   ` Li Nan
  2024-05-29  1:08     ` Changhui Zhong
  0 siblings, 1 reply; 4+ messages in thread
From: Li Nan @ 2024-05-25  7:19 UTC (permalink / raw)
  To: Changhui Zhong, Linux Block Devices, io-uring
  Cc: Ming Lei, [email protected], yukuai (C), [email protected],
	[email protected]



在 2024/5/24 17:45, Li Nan 写道:
> 
> 
> 在 2024/5/24 11:49, Changhui Zhong 写道:
>> Hello,
>>
>> I hit the kernel panic when running test ubdsrv  generic/005,
>> please help check it and let me know if you need any info/testing for
>> it, thanks.
>>

Can you test the following patch? WARN will still be triggered, but the
NULL pointer dereference will be fixed.

diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 4e159948c912..99b621b2d40f 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -2630,7 +2630,8 @@ static void ublk_queue_reinit(struct ublk_device *ub, 
struct ublk_queue *ubq)
  {
  	int i;

-	WARN_ON_ONCE(!(ubq->ubq_daemon && ubq_daemon_is_dying(ubq)));
+	if (WARN_ON_ONCE(!(ubq->ubq_daemon && ubq_daemon_is_dying(ubq))))
+		return;

  	/* All old ioucmds have to be completed */
  	ubq->nr_io_ready = 0;

-- 
Thanks,
Nan


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [bug report] WARNING: CPU: 2 PID: 3445306 at drivers/block/ublk_drv.c:2633 ublk_ctrl_start_recovery.constprop.0+0x74/0x180
  2024-05-25  7:19   ` Li Nan
@ 2024-05-29  1:08     ` Changhui Zhong
  0 siblings, 0 replies; 4+ messages in thread
From: Changhui Zhong @ 2024-05-29  1:08 UTC (permalink / raw)
  To: Li Nan
  Cc: Linux Block Devices, io-uring, Ming Lei, [email protected],
	yukuai (C), [email protected], [email protected]

On Sat, May 25, 2024 at 3:19 PM Li Nan <[email protected]> wrote:
>
>
>
> 在 2024/5/24 17:45, Li Nan 写道:
> >
> >
> > 在 2024/5/24 11:49, Changhui Zhong 写道:
> >> Hello,
> >>
> >> I hit the kernel panic when running test ubdsrv  generic/005,
> >> please help check it and let me know if you need any info/testing for
> >> it, thanks.
> >>
>
> Can you test the following patch? WARN will still be triggered, but the
> NULL pointer dereference will be fixed.
>
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 4e159948c912..99b621b2d40f 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -2630,7 +2630,8 @@ static void ublk_queue_reinit(struct ublk_device *ub,
> struct ublk_queue *ubq)
>   {
>         int i;
>
> -       WARN_ON_ONCE(!(ubq->ubq_daemon && ubq_daemon_is_dying(ubq)));
> +       if (WARN_ON_ONCE(!(ubq->ubq_daemon && ubq_daemon_is_dying(ubq))))
> +               return;
>
>         /* All old ioucmds have to be completed */
>         ubq->nr_io_ready = 0;
>
> --
> Thanks,
> Nan
>

Hi,Nan

Thanks for your patch,
as you said, after applying your patch,  the "NULL pointer
dereference" has been fixed, and only triggered the warning.

[ 6965.073785] ------------[ cut here ]------------
[ 6965.078414] WARNING: CPU: 0 PID: 86434 at
drivers/block/ublk_drv.c:2633
ublk_ctrl_start_recovery.constprop.0+0x60/0x1a0
[ 6965.089192] Modules linked in: ext4 mbcache jbd2 loop tls
rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace netfs
rfkill sunrpc vfat fat dm_multipath ipmi_ssif intel_rapl_msr
intel_rapl_common intel_uncore_frequency intel_uncore_frequency_common
i10nm_edac nfit libnvdimm x86_pkg_temp_thermal intel_powerclamp
coretemp kvm_intel kvm mgag200 rapl dax_hmem i2c_algo_bit cxl_acpi
intel_cstate drm_shmem_helper iTCO_wdt cxl_core iTCO_vendor_support
acpi_power_meter dcdbas mei_me drm_kms_helper dell_smbios intel_th_gth
intel_uncore pcspkr einj i2c_i801 ipmi_si dell_wmi_descriptor wmi_bmof
isst_if_mmio isst_if_mbox_pci mei intel_th_pci acpi_ipmi
isst_if_common intel_pch_thermal intel_vsec intel_th i2c_smbus
ipmi_devintf ipmi_msghandler drm fuse xfs libcrc32c sd_mod t10_pi sg
ahci crct10dif_pclmul crc32_pclmul libahci crc32c_intel libata tg3
ghash_clmulni_intel wmi dm_mirror dm_region_hash dm_log dm_mod [last
unloaded: null_blk]
[ 6965.171508] CPU: 0 PID: 86434 Comm: iou-wrk-86420 Not tainted 6.10.0-rc1+ #1
[ 6965.178555] Hardware name: Dell Inc. PowerEdge R650xs/0PPTY2, BIOS
1.4.4 10/07/2021
[ 6965.186206] RIP: 0010:ublk_ctrl_start_recovery.constprop.0+0x60/0x1a0
[ 6965.192645] Code: 85 48 01 00 00 66 41 83 7c 24 1c 02 0f 85 3b 01
00 00 66 41 83 7c 24 18 00 0f 84 b8 00 00 00 45 31 ed 41 be ff ff ff
ff eb 15 <0f> 0b 41 0f b7 44 24 18 41 83 c5 01 41 39 c5 0f 8d 98 00 00
00 44
[ 6965.211390] RSP: 0018:ff5798fa0e1f7ce0 EFLAGS: 00010246
[ 6965.216617] RAX: 0000000000000002 RBX: ff43a5a306a28000 RCX: 0000000000000000
[ 6965.223750] RDX: ff43a5a313e82040 RSI: ffffffff84c4ee00 RDI: 0000000000000000
[ 6965.230884] RBP: ff43a5a313956c68 R08: 0000000000000000 R09: ffffffff850e35e0
[ 6965.238016] R10: 0000000000000000 R11: 0000000000000000 R12: ff43a5a313956800
[ 6965.245149] R13: 0000000000000000 R14: 00000000ffffffff R15: ff43a5a30b9ec080
[ 6965.252281] FS:  00007fc05ee44740(0000) GS:ff43a5a66f600000(0000)
knlGS:0000000000000000
[ 6965.260366] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6965.266115] CR2: 00007f92f07fca50 CR3: 0000000113266006 CR4: 0000000000771ef0
[ 6965.273246] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 6965.280378] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 6965.287510] PKRU: 55555554
[ 6965.290225] Call Trace:
[ 6965.292678]  <TASK>
[ 6965.294783]  ? __warn+0x7f/0x120
[ 6965.298015]  ? ublk_ctrl_start_recovery.constprop.0+0x60/0x1a0
[ 6965.303850]  ? report_bug+0x18a/0x1a0
[ 6965.307514]  ? handle_bug+0x3c/0x70
[ 6965.311008]  ? exc_invalid_op+0x14/0x70
[ 6965.314846]  ? asm_exc_invalid_op+0x16/0x20
[ 6965.319032]  ? ublk_ctrl_start_recovery.constprop.0+0x60/0x1a0
[ 6965.324865]  ublk_ctrl_uring_cmd+0x4f7/0x6c0
[ 6965.329138]  ? pick_next_task_idle+0x26/0x40
[ 6965.333412]  io_uring_cmd+0x9a/0x1b0
[ 6965.336991]  io_issue_sqe+0x18f/0x3f0
[ 6965.340655]  io_wq_submit_work+0x9b/0x390
[ 6965.344671]  io_worker_handle_work+0x165/0x360
[ 6965.349114]  io_wq_worker+0xcb/0x2f0
[ 6965.352694]  ? finish_task_switch.isra.0+0x203/0x290
[ 6965.357659]  ? finish_task_switch.isra.0+0x203/0x290
[ 6965.362628]  ? __pfx_io_wq_worker+0x10/0x10
[ 6965.366814]  ret_from_fork+0x2d/0x50
[ 6965.370402]  ? __pfx_io_wq_worker+0x10/0x10
[ 6965.374587]  ret_from_fork_asm+0x1a/0x30
[ 6965.378513]  </TASK>
[ 6965.380704] ---[ end trace 0000000000000000 ]---

Thanks,
Changhui


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-29  1:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24  3:49 [bug report] WARNING: CPU: 2 PID: 3445306 at drivers/block/ublk_drv.c:2633 ublk_ctrl_start_recovery.constprop.0+0x74/0x180 Changhui Zhong
2024-05-24  9:45 ` Li Nan
2024-05-25  7:19   ` Li Nan
2024-05-29  1:08     ` Changhui Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox