Re: [PATCH rdma-rc] RDMA/cma: Protect bind_list and listen_list while finding matching cm id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 16, 2020 at 01:43:04PM +0300, Leon Romanovsky wrote:
> From: Mark Zhang <markz@xxxxxxxxxxxx>
> 
> Add missing lock when the bind_list and listen_list must be accessed
> with lock. In addition add lockdep asserts to verify that lock is held.
> 
> [14127.352448] general protection fault: 0000 [#1] SMP NOPTI
> [14127.356017] CPU: 226 PID: 126135 Comm: kworker/226:1 Tainted: G OE 4.12.14-150.47-default #1 SLE15
> [14127.363169] Hardware name: Cray Inc. Windom/Windom, BIOS 0.8.7 01-10-2020
> [14127.368545] Workqueue: ib_cm cm_work_handler [ib_cm]
> [14127.373185] task: ffff9c5a60a1d2c0 task.stack: ffffc1d91f554000
> [14127.379151] RIP: 0010:cma_ib_req_handler+0x3f1/0x11b0 [rdma_cm]
> [14127.382316] RSP: 0018:ffffc1d91f557b40 EFLAGS: 00010286
> [14127.385693] RAX: deacffffffffff30 RBX: 0000000000000001 RCX: ffff9c2af5bb6000
> [14127.391431] RDX: 00000000000000a9 RSI: ffff9c5aa4ed2f10 RDI: ffffc1d91f557b08
> [14127.396263] RBP: ffffc1d91f557d90 R08: ffff9c340cc80000 R09: ffff9c2c0f901900
> [14127.401531] R10: 0000000000000000 R11: 0000000000000001 R12: deacffffffffff30
> [14127.410279] R13: ffff9c5a48aeec00 R14: ffffc1d91f557c30 R15: ffff9c5c2eea3688
> [14127.418274] FS: 0000000000000000(0000) GS:ffff9c5c2fa80000(0000) knlGS:0000000000000000
> [14127.427259] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [14127.432108] CR2: 00002b5cc03fa320 CR3: 0000003f8500a000 CR4: 00000000003406e0
> [14127.438461] Call Trace:
> [14127.441557] ? rdma_addr_cancel+0xa0/0xa0 [ib_core]
> [14127.447922] ? cm_process_work+0x28/0x140 [ib_cm]
> [14127.454877] cm_process_work+0x28/0x140 [ib_cm]
> [14127.458933] ? cm_get_bth_pkey.isra.44+0x34/0xa0 [ib_cm]
> [14127.464246] cm_work_handler+0xa06/0x1a6f [ib_cm]
> [14127.470069] ? __switch_to_asm+0x34/0x70
> [14127.477089] ? __switch_to_asm+0x34/0x70
> [14127.484283] ? __switch_to_asm+0x40/0x70
> [14127.491010] ? __switch_to_asm+0x34/0x70
> [14127.495557] ? __switch_to_asm+0x40/0x70
> [14127.498530] ? __switch_to_asm+0x34/0x70
> [14127.502205] ? __switch_to_asm+0x40/0x70
> [14127.508609] ? __switch_to+0x7c/0x4b0
> [14127.512301] ? __switch_to_asm+0x40/0x70
> [14127.516245] ? __switch_to_asm+0x34/0x70
> [14127.518631] process_one_work+0x1da/0x400
> [14127.522672] worker_thread+0x2b/0x3f0
> [14127.527426] ? process_one_work+0x400/0x400
> [14127.534769] kthread+0x118/0x140
> [14127.538181] ? kthread_create_on_node+0x40/0x40
> [14127.544509] ret_from_fork+0x22/0x40
> [14127.548842] Code: 00 66 83 f8 02 0f 84 ca 05 00 00 49 8b 84 24 d0 01 00 00 48 85 c0 0f 84 68 07 00 00 48 2d d0 01
> 00 00 49 89 c4 0f 84 59 07 00 00 <41> 0f b7 44 24 20 49 8b 77 50 66 83 f8 0a 75 9e 49 8b 7c 24 28
> [14127.573512] Modules linked in: squashfs lz4_decompress loop rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc fscache 8021q garp mrp stp llc af_packet iscsi_ibft iscsi_boot_sysfs rdma_ucm(OEX) ib_ucm(OEX) rdma_cm(OEX) iw_cm(OEX) configfs ib_ipoib(OEX) ib_cm(OEX) ib_umad(OEX) mlx5_fpga_tools(OEX) mlx4_en(OEX) mlx4_ib(OEX) mlx4_core(OEX) mlx5_ib(OEX) ib_uverbs(OEX) edac_mce_amd kvm_amd ib_core(OEX) kvm irqbypass crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd glue_helper cryptd pcspkr mlx5_core(OEX) mlxfw(OEX) devlink vfio_mdev(OEX) igb vfio_iommu_type1 ptp vfio ahci mdev(OEX) libahci xhci_pci pps_core xhci_hcd i2c_algo_bit libata mlx_compat(OEX) ccp dca usbcore i2c_piix4 shpchp pcc_cpufreq acpi_cpufreq button sg scsi_mod efivarfs autofs4
> 
> Fixes: 4c21b5bcef73 ("IB/cma: Add net_dev and private data checks to RDMA CM")
> Signed-off-by: Mark Zhang <markz@xxxxxxxxxxxx>
> Reviewed-by: Maor Gottlieb <maorg@xxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> ---
>  drivers/infiniband/core/cma.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)

Applied to for-rc, thanks

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux