1. 19 4月, 2021 1 次提交
  2. 13 4月, 2021 4 次提交
  3. 02 4月, 2021 1 次提交
  4. 26 3月, 2021 1 次提交
    • M
      RDMA: Support more than 255 rdma ports · 1fb7f897
      Mark Bloch 提交于
      Current code uses many different types when dealing with a port of a RDMA
      device: u8, unsigned int and u32. Switch to u32 to clean up the logic.
      
      This allows us to make (at least) the core view consistent and use the
      same type. Unfortunately not all places can be converted. Many uverbs
      functions expect port to be u8 so keep those places in order not to break
      UAPIs.  HW/Spec defined values must also not be changed.
      
      With the switch to u32 we now can support devices with more than 255
      ports. U32_MAX is reserved to make control logic a bit easier to deal
      with. As a device with U32_MAX ports probably isn't going to happen any
      time soon this seems like a non issue.
      
      When a device with more than 255 ports is created uverbs will report the
      RDMA device as having 255 ports as this is the max currently supported.
      
      The verbs interface is not changed yet because the IBTA spec limits the
      port size in too many places to be u8 and all applications that relies in
      verbs won't be able to cope with this change. At this stage, we are
      extending the interfaces that are using vendor channel solely
      
      Once the limitation is lifted mlx5 in switchdev mode will be able to have
      thousands of SFs created by the device. As the only instance of an RDMA
      device that reports more than 255 ports will be a representor device and
      it exposes itself as a RAW Ethernet only device CM/MAD/IPoIB and other
      ULPs aren't effected by this change and their sysfs/interfaces that are
      exposes to userspace can remain unchanged.
      
      While here cleanup some alignment issues and remove unneeded sanity
      checks (mainly in rdmavt),
      
      Link: https://lore.kernel.org/r/20210301070420.439400-1-leon@kernel.orgSigned-off-by: NMark Bloch <mbloch@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      1fb7f897
  5. 02 3月, 2021 1 次提交
    • S
      RDMA/cm: Fix IRQ restore in ib_send_cm_sidr_rep · 221384df
      Saeed Mahameed 提交于
      ib_send_cm_sidr_rep() {
      	spin_lock_irqsave()
              cm_send_sidr_rep_locked() {
                      ...
              	spin_lock_irq()
                      ....
                      spin_unlock_irq() <--- this will enable interrupts
              }
              spin_unlock_irqrestore()
      }
      
      spin_unlock_irqrestore() expects interrupts to be disabled but the
      internal spin_unlock_irq() will always enable hard interrupts.
      
      Fix this by replacing the internal spin_{lock,unlock}_irq() with
      irqsave/restore variants.
      
      It fixes the following kernel trace:
      
       raw_local_irq_restore() called with IRQs enabled
       WARNING: CPU: 2 PID: 20001 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x1d/0x20
      
       Call Trace:
        _raw_spin_unlock_irqrestore+0x4e/0x50
        ib_send_cm_sidr_rep+0x3a/0x50 [ib_cm]
        cma_send_sidr_rep+0xa1/0x160 [rdma_cm]
        rdma_accept+0x25e/0x350 [rdma_cm]
        ucma_accept+0x132/0x1cc [rdma_ucm]
        ucma_write+0xbf/0x140 [rdma_ucm]
        vfs_write+0xc1/0x340
        ksys_write+0xb3/0xe0
        do_syscall_64+0x2d/0x40
        entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: 87c4c774 ("RDMA/cm: Protect access to remote_sidr_table")
      Link: https://lore.kernel.org/r/20210301081844.445823-1-leon@kernel.orgSigned-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      Reviewed-by: NJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      221384df
  6. 03 2月, 2021 1 次提交
  7. 10 12月, 2020 1 次提交
    • L
      RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait · 340b940e
      Leon Romanovsky 提交于
      If cm_create_timewait_info() fails, the timewait_info pointer will contain
      an error value and will be used in cm_remove_remote() later.
      
        general protection fault, probably for non-canonical address 0xdffffc0000000024: 0000 [#1] SMP KASAN PTI
        KASAN: null-ptr-deref in range [0×0000000000000120-0×0000000000000127]
        CPU: 2 PID: 12446 Comm: syz-executor.3 Not tainted 5.10.0-rc5-5d4c0742a60e #27
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
        RIP: 0010:cm_remove_remote.isra.0+0x24/0×170 drivers/infiniband/core/cm.c:978
        Code: 84 00 00 00 00 00 41 54 55 53 48 89 fb 48 8d ab 2d 01 00 00 e8 7d bf 4b fe 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <0f> b6 04 02 48 89 ea 83 e2 07 38 d0 7f 08 84 c0 0f 85 fc 00 00 00
        RSP: 0018:ffff888013127918 EFLAGS: 00010006
        RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: ffffc9000a18b000
        RDX: 0000000000000024 RSI: ffffffff82edc573 RDI: fffffffffffffff4
        RBP: 0000000000000121 R08: 0000000000000001 R09: ffffed1002624f1d
        R10: 0000000000000003 R11: ffffed1002624f1c R12: ffff888107760c70
        R13: ffff888107760c40 R14: fffffffffffffff4 R15: ffff888107760c9c
        FS:  00007fe1ffcc1700(0000) GS:ffff88811a600000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 0000001b2ff21000 CR3: 000000010f504001 CR4: 0000000000370ee0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
        Call Trace:
         cm_destroy_id+0x189/0×15b0 drivers/infiniband/core/cm.c:1155
         cma_connect_ib drivers/infiniband/core/cma.c:4029 [inline]
         rdma_connect_locked+0x1100/0×17c0 drivers/infiniband/core/cma.c:4107
         rdma_connect+0x2a/0×40 drivers/infiniband/core/cma.c:4140
         ucma_connect+0x277/0×340 drivers/infiniband/core/ucma.c:1069
         ucma_write+0x236/0×2f0 drivers/infiniband/core/ucma.c:1724
         vfs_write+0x220/0×830 fs/read_write.c:603
         ksys_write+0x1df/0×240 fs/read_write.c:658
         do_syscall_64+0x33/0×40 arch/x86/entry/common.c:46
         entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: a977049d ("[PATCH] IB: Add the kernel CM implementation")
      Link: https://lore.kernel.org/r/20201204064205.145795-1-leon@kernel.orgReviewed-by: NMaor Gottlieb <maorg@nvidia.com>
      Reported-by: NAmit Matityahu <mitm@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      340b940e
  8. 08 12月, 2020 1 次提交
  9. 13 11月, 2020 1 次提交
  10. 31 10月, 2020 1 次提交
  11. 25 8月, 2020 2 次提交
  12. 24 8月, 2020 1 次提交
  13. 19 8月, 2020 1 次提交
  14. 16 7月, 2020 1 次提交
    • M
      RDMA/cm: Protect access to remote_sidr_table · 87c4c774
      Maor Gottlieb 提交于
      cm.lock must be held while accessing remote_sidr_table. This fixes the
      below NULL pointer dereference.
      
        BUG: kernel NULL pointer dereference, address: 0000000000000000
        #PF: supervisor write access in kernel mode
        #PF: error_code(0x0002) - not-present page
        PGD 0 P4D 0
        Oops: 0002 [#1] SMP PTI
        CPU: 2 PID: 7288 Comm: udaddy Not tainted 5.7.0_for_upstream_perf_2020_06_09_15_14_20_38 #1
        Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
        RIP: 0010:rb_erase+0x10d/0x360
        Code: 00 00 00 48 89 c1 48 89 d0 48 8b 50 08 48 39 ca 74 48 f6 02 01 75 af 48 8b 7a 10 48 89 c1 48 83 c9 01 48 89 78 08 48 89 42 10 <48> 89 0f 48 8b 08 48 89 0a 48 83 e1 fc 48 89 10 0f 84 b1 00 00 00
        RSP: 0018:ffffc90000f77c30 EFLAGS: 00010086
        RAX: ffff8883df27d458 RBX: ffff8883df27da58 RCX: ffff8883df27d459
        RDX: ffff8883d183fa58 RSI: ffffffffa01e8d00 RDI: 0000000000000000
        RBP: ffff8883d62ac800 R08: 0000000000000000 R09: 00000000000000ce
        R10: 000000000000000a R11: 0000000000000000 R12: ffff8883df27da00
        R13: ffffc90000f77c98 R14: 0000000000000130 R15: 0000000000000000
        FS:  00007f009f877740(0000) GS:ffff8883f1a00000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 0000000000000000 CR3: 00000003d467e003 CR4: 0000000000160ee0
        Call Trace:
         cm_send_sidr_rep_locked+0x15a/0x1a0 [ib_cm]
         ib_send_cm_sidr_rep+0x2b/0x50 [ib_cm]
         cma_send_sidr_rep+0x8b/0xe0 [rdma_cm]
         __rdma_accept+0x21d/0x2b0 [rdma_cm]
         ? ucma_get_ctx+0x2b/0xe0 [rdma_ucm]
         ? _copy_from_user+0x30/0x60
         ucma_accept+0x13e/0x1e0 [rdma_ucm]
         ucma_write+0xb4/0x130 [rdma_ucm]
         vfs_write+0xad/0x1a0
         ksys_write+0x9d/0xb0
         do_syscall_64+0x48/0x130
         entry_SYSCALL_64_after_hwframe+0x44/0xa9
        RIP: 0033:0x7f009ef60924
        Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 80 00 00 00 00 8b 05 2a ef 2c 00 48 63 ff 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 f3 c3 66 90 55 53 48 89 d5 48 89 f3 48 83
        RSP: 002b:00007fff843edf38 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
        RAX: ffffffffffffffda RBX: 000055743042e1d0 RCX: 00007f009ef60924
        RDX: 0000000000000130 RSI: 00007fff843edf40 RDI: 0000000000000003
        RBP: 00007fff843ee0e0 R08: 0000000000000000 R09: 0000557430433090
        R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000
        R13: 00007fff843edf40 R14: 000000000000038c R15: 00000000ffffff00
        CR2: 0000000000000000
      
      Fixes: 6a8824a7 ("RDMA/cm: Allow ib_send_cm_sidr_rep() to be done under lock")
      Link: https://lore.kernel.org/r/20200716105519.1424266-1-leon@kernel.orgSigned-off-by: NMaor Gottlieb <maorg@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      87c4c774
  15. 18 6月, 2020 1 次提交
  16. 04 6月, 2020 1 次提交
  17. 28 5月, 2020 1 次提交
  18. 13 5月, 2020 9 次提交
  19. 06 5月, 2020 1 次提交
  20. 15 4月, 2020 2 次提交
  21. 18 3月, 2020 7 次提交