An error occurred fetching the project authors.
  1. 28 Oct, 2022 1 commit
  2. 06 Apr, 2022 1 commit
  3. 18 Mar, 2022 1 commit
  4. 17 Nov, 2021 1 commit
    • Leon Romanovsky's avatar
      RDMA/nldev: Check stat attribute before accessing it · d821f7c1
      Leon Romanovsky authored
      The access to non-existent netlink attribute causes to the following
      kernel panic. Fix it by checking existence before trying to read it.
      
        general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
        KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
        CPU: 0 PID: 6744 Comm: syz-executor.0 Not tainted 5.15.0-syzkaller #0
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
        RIP: 0010:nla_get_u32 include/net/netlink.h:1554 [inline]
        RIP: 0010:nldev_stat_set_mode_doit drivers/infiniband/core/nldev.c:1909 [inline]
        RIP: 0010:nldev_stat_set_doit+0x578/0x10d0 drivers/infiniband/core/nldev.c:2040
        Code: fa 4c 8b a4 24 f8 02 00 00 48 b8 00 00 00 00 00 fc ff df c7 84 24 80 00 00 00 00 00 00 00 49 8d 7c 24 04 48 89
        fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 02
        RSP: 0018:ffffc90004acf2e8 EFLAGS: 00010247
        RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc90002b94000
        RDX: 0000000000000000 RSI: ffffffff8684c5ff RDI: 0000000000000004
        RBP: ffff88807cda4000 R08: 0000000000000000 R09: ffff888023fb8027
        R10: ffffffff8684c5d7 R11: 0000000000000000 R12: 0000000000000000
        R13: 0000000000000001 R14: ffff888041024280 R15: ffff888031ade780
        FS:  00007eff9dddd700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 0000001b2ef24000 CR3: 0000000036902000 CR4: 00000000003506f0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
        Call Trace:
         <TASK>
         rdma_nl_rcv_msg+0x36d/0x690 drivers/infiniband/core/netlink.c:195
         rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
         rdma_nl_rcv+0x2ee/0x430 drivers/infiniband/core/netlink.c:259
         netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
         netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1345
         netlink_sendmsg+0x86d/0xda0 net/netlink/af_netlink.c:1916
         sock_sendmsg_nosec net/socket.c:704 [inline]
         sock_sendmsg+0xcf/0x120 net/socket.c:724
         ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409
         ___sys_sendmsg+0xf3/0x170 net/socket.c:2463
         __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492
         do_syscall_x64 arch/x86/entry/common.c:50 [inline]
         do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
         entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: 822cf785 ("RDMA/nldev: Split nldev_stat_set_mode_doit out of nldev_stat_set_doit")
      Link: https://lore.kernel.org/r/b21967c366f076ff1988862f9c8a1aa0244c599f.1637151999.git.leonro@nvidia.com
      Reported-by: syzbot+9111d2255a9710e87562@syzkaller.appspotmail.com
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      d821f7c1
  5. 12 Oct, 2021 5 commits
  6. 16 Jun, 2021 2 commits
  7. 27 Apr, 2021 1 commit
  8. 22 Apr, 2021 3 commits
  9. 26 Mar, 2021 1 commit
    • Mark Bloch's avatar
      RDMA: Support more than 255 rdma ports · 1fb7f897
      Mark Bloch authored
      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: default avatarMark Bloch <mbloch@nvidia.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      1fb7f897
  10. 18 Jan, 2021 1 commit
  11. 16 Nov, 2020 1 commit
  12. 29 Jul, 2020 1 commit
  13. 10 Jul, 2020 1 commit
  14. 24 Jun, 2020 1 commit
  15. 23 Jun, 2020 5 commits
  16. 12 May, 2020 1 commit
  17. 13 Mar, 2020 1 commit
    • Jason Gunthorpe's avatar
      RDMA/nl: Do not permit empty devices names during RDMA_NLDEV_CMD_NEWLINK/SET · 7aefa623
      Jason Gunthorpe authored
      Empty device names cannot be added to sysfs and crash with:
      
        kobject: (00000000f9de3792): attempted to be registered with empty name!
        WARNING: CPU: 1 PID: 10856 at lib/kobject.c:234 kobject_add_internal+0x7ac/0x9a0 lib/kobject.c:234
        Kernel panic - not syncing: panic_on_warn set ...
        CPU: 1 PID: 10856 Comm: syz-executor459 Not tainted 5.6.0-rc3-syzkaller #0
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
        Call Trace:
         __dump_stack lib/dump_stack.c:77 [inline]
         dump_stack+0x197/0x210 lib/dump_stack.c:118
         panic+0x2e3/0x75c kernel/panic.c:221
         __warn.cold+0x2f/0x3e kernel/panic.c:582
         report_bug+0x289/0x300 lib/bug.c:195
         fixup_bug arch/x86/kernel/traps.c:174 [inline]
         fixup_bug arch/x86/kernel/traps.c:169 [inline]
         do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:267
         do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:286
         invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1027
        RIP: 0010:kobject_add_internal+0x7ac/0x9a0 lib/kobject.c:234
        Code: 7a ca ca f9 e9 f0 f8 ff ff 4c 89 f7 e8 cd ca ca f9 e9 95 f9 ff ff e8 13 25 8c f9 4c 89 e6 48 c7 c7 a0 08 1a 89 e8 a3 76 5c f9 <0f> 0b 41 bd ea ff ff ff e9 52 ff ff ff e8 f2 24 8c f9 0f 0b e8 eb
        RSP: 0018:ffffc90002006eb0 EFLAGS: 00010286
        RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
        RDX: 0000000000000000 RSI: ffffffff815eae46 RDI: fffff52000400dc8
        RBP: ffffc90002006f08 R08: ffff8880972ac500 R09: ffffed1015d26659
        R10: ffffed1015d26658 R11: ffff8880ae9332c7 R12: ffff888093034668
        R13: 0000000000000000 R14: ffff8880a69d7600 R15: 0000000000000001
         kobject_add_varg lib/kobject.c:390 [inline]
         kobject_add+0x150/0x1c0 lib/kobject.c:442
         device_add+0x3be/0x1d00 drivers/base/core.c:2412
         ib_register_device drivers/infiniband/core/device.c:1371 [inline]
         ib_register_device+0x93e/0xe40 drivers/infiniband/core/device.c:1343
         rxe_register_device+0x52e/0x655 drivers/infiniband/sw/rxe/rxe_verbs.c:1231
         rxe_add+0x122b/0x1661 drivers/infiniband/sw/rxe/rxe.c:302
         rxe_net_add+0x91/0xf0 drivers/infiniband/sw/rxe/rxe_net.c:539
         rxe_newlink+0x39/0x90 drivers/infiniband/sw/rxe/rxe.c:318
         nldev_newlink+0x28a/0x430 drivers/infiniband/core/nldev.c:1538
         rdma_nl_rcv_msg drivers/infiniband/core/netlink.c:195 [inline]
         rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
         rdma_nl_rcv+0x5d9/0x980 drivers/infiniband/core/netlink.c:259
         netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
         netlink_unicast+0x59e/0x7e0 net/netlink/af_netlink.c:1329
         netlink_sendmsg+0x91c/0xea0 net/netlink/af_netlink.c:1918
         sock_sendmsg_nosec net/socket.c:652 [inline]
         sock_sendmsg+0xd7/0x130 net/socket.c:672
         ____sys_sendmsg+0x753/0x880 net/socket.c:2343
         ___sys_sendmsg+0x100/0x170 net/socket.c:2397
         __sys_sendmsg+0x105/0x1d0 net/socket.c:2430
         __do_sys_sendmsg net/socket.c:2439 [inline]
         __se_sys_sendmsg net/socket.c:2437 [inline]
         __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2437
         do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Prevent empty names when checking the name provided from userspace during
      newlink and rename.
      
      Fixes: 3856ec4b ("RDMA/core: Add RDMA_NLDEV_CMD_NEWLINK/DELLINK support")
      Fixes: 05d940d3 ("RDMA/nldev: Allow IB device rename through RDMA netlink")
      Cc: stable@kernel.org
      Link: https://lore.kernel.org/r/20200309191648.GA30852@ziepe.ca
      Reported-and-tested-by: syzbot+da615ac67d4dbea32cbc@syzkaller.appspotmail.com
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      7aefa623
  18. 04 Mar, 2020 1 commit
    • Mark Zhang's avatar
      RDMA/nldev: Fix crash when set a QP to a new counter but QPN is missing · 78f34a16
      Mark Zhang authored
      This fixes the kernel crash when a RDMA_NLDEV_CMD_STAT_SET command is
      received, but the QP number parameter is not available.
      
        iwpm_register_pid: Unable to send a nlmsg (client = 2)
        infiniband syz1: RDMA CMA: cma_listen_on_dev, error -98
        general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
        KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
        CPU: 0 PID: 9754 Comm: syz-executor069 Not tainted 5.6.0-rc2-syzkaller #0
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
        RIP: 0010:nla_get_u32 include/net/netlink.h:1474 [inline]
        RIP: 0010:nldev_stat_set_doit+0x63c/0xb70 drivers/infiniband/core/nldev.c:1760
        Code: fc 01 0f 84 58 03 00 00 e8 41 83 bf fb 4c 8b a3 58 fd ff ff 48 b8 00 00 00 00 00 fc ff df 49 8d 7c 24 04 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 6d
        RSP: 0018:ffffc900068bf350 EFLAGS: 00010247
        RAX: dffffc0000000000 RBX: ffffc900068bf728 RCX: ffffffff85b60470
        RDX: 0000000000000000 RSI: ffffffff85b6047f RDI: 0000000000000004
        RBP: ffffc900068bf750 R08: ffff88808c3ee140 R09: ffff8880a25e6010
        R10: ffffed10144bcddc R11: ffff8880a25e6ee3 R12: 0000000000000000
        R13: ffff88809acb0000 R14: ffff888092a42c80 R15: 000000009ef2e29a
        FS:  0000000001ff0880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007f4733e34000 CR3: 00000000a9b27000 CR4: 00000000001406f0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
        Call Trace:
          rdma_nl_rcv_msg drivers/infiniband/core/netlink.c:195 [inline]
          rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
          rdma_nl_rcv+0x5d9/0x980 drivers/infiniband/core/netlink.c:259
          netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
          netlink_unicast+0x59e/0x7e0 net/netlink/af_netlink.c:1329
          netlink_sendmsg+0x91c/0xea0 net/netlink/af_netlink.c:1918
          sock_sendmsg_nosec net/socket.c:652 [inline]
          sock_sendmsg+0xd7/0x130 net/socket.c:672
          ____sys_sendmsg+0x753/0x880 net/socket.c:2343
          ___sys_sendmsg+0x100/0x170 net/socket.c:2397
          __sys_sendmsg+0x105/0x1d0 net/socket.c:2430
          __do_sys_sendmsg net/socket.c:2439 [inline]
          __se_sys_sendmsg net/socket.c:2437 [inline]
          __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2437
          do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
          entry_SYSCALL_64_after_hwframe+0x49/0xbe
        RIP: 0033:0x4403d9
        Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
        RSP: 002b:00007ffc0efbc5c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
        RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004403d9
        RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004
        RBP: 00000000006ca018 R08: 0000000000000008 R09: 00000000004002c8
        R10: 000000000000004a R11: 0000000000000246 R12: 0000000000401c60
        R13: 0000000000401cf0 R14: 0000000000000000 R15: 0000000000000000
      
      Fixes: b389327d ("RDMA/nldev: Allow counter manual mode configration through RDMA netlink")
      Link: https://lore.kernel.org/r/20200227125111.99142-1-leon@kernel.org
      Reported-by: syzbot+bd4af81bc51ee0283445@syzkaller.appspotmail.com
      Signed-off-by: default avatarMark Zhang <markz@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      78f34a16
  19. 13 Jan, 2020 1 commit
  20. 24 Oct, 2019 1 commit
  21. 23 Oct, 2019 2 commits
  22. 22 Oct, 2019 3 commits
  23. 04 Oct, 2019 2 commits
  24. 20 Aug, 2019 1 commit
  25. 12 Aug, 2019 1 commit