1. 02 Jan, 2022 7 commits
    • Thomas Toye's avatar
      rndis_host: support Hytera digital radios · 29262e1f
      Thomas Toye authored
      Hytera makes a range of digital (DMR) radios. These radios can be
      programmed to a allow a computer to control them over Ethernet over USB,
      either using NCM or RNDIS.
      
      This commit adds support for RNDIS for Hytera radios. I tested with a
      Hytera PD785 and a Hytera MD785G. When these radios are programmed to
      set up a Radio to PC Network using RNDIS, an USB interface will be added
      with class 2 (Communications), subclass 2 (Abstract Modem Control) and
      an interface protocol of 255 ("vendor specific" - lsusb even hints "MSFT
      RNDIS?").
      
      This patch is similar to the solution of this StackOverflow user, but
      that only works for the Hytera MD785:
      https://stackoverflow.com/a/53550858
      
      To use the "Radio to PC Network" functionality of Hytera DMR radios, the
      radios need to be programmed correctly in CPS (Hytera's Customer
      Programming Software). "Forward to PC" should be checked in "Network"
      (under "General Setting" in "Conventional") and the "USB Network
      Communication Protocol" should be set to RNDIS.
      Signed-off-by: default avatarThomas Toye <thomas@toye.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29262e1f
    • Xin Long's avatar
      sctp: hold endpoint before calling cb in sctp_transport_lookup_process · f9d31c4c
      Xin Long authored
      The same fix in commit 5ec7d18d ("sctp: use call_rcu to free endpoint")
      is also needed for dumping one asoc and sock after the lookup.
      
      Fixes: 86fdb344 ("sctp: ensure ep is not destroyed before doing the dump")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9d31c4c
    • David S. Miller's avatar
      Merge branch 'ena-fixes' · 5b40d10b
      David S. Miller authored
      Arthur Kiyanovski says:
      
      ====================
      ENA driver bug fixes
      
      Patchset V2 chages:
      -------------------
      Updated SHA1 of Fixes tag in patch 3/3 to be 12 digits long
      
      Original cover letter:
      ----------------------
      ENA driver bug fixes
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b40d10b
    • Arthur Kiyanovski's avatar
      net: ena: Fix error handling when calculating max IO queues number · 5055dc03
      Arthur Kiyanovski authored
      The role of ena_calc_max_io_queue_num() is to return the number
      of queues supported by the device, which means the return value
      should be >=0.
      
      The function that calls ena_calc_max_io_queue_num(), checks
      the return value. If it is 0, it means the device reported
      it supports 0 IO queues. This case is considered an error
      and is handled by the calling function accordingly.
      
      However the current implementation of ena_calc_max_io_queue_num()
      is wrong, since when it detects the device supports 0 IO queues,
      it returns -EFAULT.
      
      In such a case the calling function doesn't detect the error,
      and therefore doesn't handle it.
      
      This commit changes ena_calc_max_io_queue_num() to return 0
      in case the device reported it supports 0 queues, allowing the
      calling function to properly handle the error case.
      
      Fixes: 736ce3f4 ("net: ena: make ethtool -l show correct max number of queues")
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarArthur Kiyanovski <akiyano@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5055dc03
    • Arthur Kiyanovski's avatar
      net: ena: Fix wrong rx request id by resetting device · cb3d4f98
      Arthur Kiyanovski authored
      A wrong request id received from the device is a sign that
      something is wrong with it, therefore trigger a device reset.
      
      Also add some debug info to the "Page is NULL" print to make
      it easier to debug.
      
      Fixes: 1738cd3e ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
      Signed-off-by: default avatarArthur Kiyanovski <akiyano@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb3d4f98
    • Arthur Kiyanovski's avatar
      net: ena: Fix undefined state when tx request id is out of bounds · c255a34e
      Arthur Kiyanovski authored
      ena_com_tx_comp_req_id_get() checks the req_id of a received completion,
      and if it is out of bounds returns -EINVAL. This is a sign that
      something is wrong with the device and it needs to be reset.
      
      The current code does not reset the device in this case, which leaves
      the driver in an undefined state, where this completion is not properly
      handled.
      
      This commit adds a call to handle_invalid_req_id() in ena_clean_tx_irq()
      and ena_clean_xdp_irq() which resets the device to fix the issue.
      
      This commit also removes unnecessary request id checks from
      validate_tx_req_id() and validate_xdp_req_id(). This check is unneeded
      because it was already performed in ena_com_tx_comp_req_id_get(), which
      is called right before these functions.
      
      Fixes: 548c4940 ("net: ena: Implement XDP_TX action")
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarArthur Kiyanovski <akiyano@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c255a34e
    • Gagan Kumar's avatar
      mctp: Remove only static neighbour on RTM_DELNEIGH · ae81de73
      Gagan Kumar authored
      Add neighbour source flag in mctp_neigh_remove(...) to allow removal of
      only static neighbours.
      
      This should be a no-op change and might be useful later when mctp can
      have MCTP_NEIGH_DISCOVER neighbours.
      Signed-off-by: default avatarGagan Kumar <gagan1kumar.cs@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ae81de73
  2. 01 Jan, 2022 3 commits
    • Haimin Zhang's avatar
      net ticp:fix a kernel-infoleak in __tipc_sendmsg() · d6d86830
      Haimin Zhang authored
      struct tipc_socket_addr.ref has a 4-byte hole,and __tipc_getname() currently
      copying it to user space,causing kernel-infoleak.
      
      BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:121 [inline]
      BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:121 [inline] lib/usercopy.c:33
      BUG: KMSAN: kernel-infoleak in _copy_to_user+0x1c9/0x270 lib/usercopy.c:33 lib/usercopy.c:33
       instrument_copy_to_user include/linux/instrumented.h:121 [inline]
       instrument_copy_to_user include/linux/instrumented.h:121 [inline] lib/usercopy.c:33
       _copy_to_user+0x1c9/0x270 lib/usercopy.c:33 lib/usercopy.c:33
       copy_to_user include/linux/uaccess.h:209 [inline]
       copy_to_user include/linux/uaccess.h:209 [inline] net/socket.c:287
       move_addr_to_user+0x3f6/0x600 net/socket.c:287 net/socket.c:287
       __sys_getpeername+0x470/0x6b0 net/socket.c:1987 net/socket.c:1987
       __do_sys_getpeername net/socket.c:1997 [inline]
       __se_sys_getpeername net/socket.c:1994 [inline]
       __do_sys_getpeername net/socket.c:1997 [inline] net/socket.c:1994
       __se_sys_getpeername net/socket.c:1994 [inline] net/socket.c:1994
       __x64_sys_getpeername+0xda/0x120 net/socket.c:1994 net/socket.c:1994
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_x64 arch/x86/entry/common.c:51 [inline] arch/x86/entry/common.c:82
       do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Uninit was stored to memory at:
       tipc_getname+0x575/0x5e0 net/tipc/socket.c:757 net/tipc/socket.c:757
       __sys_getpeername+0x3b3/0x6b0 net/socket.c:1984 net/socket.c:1984
       __do_sys_getpeername net/socket.c:1997 [inline]
       __se_sys_getpeername net/socket.c:1994 [inline]
       __do_sys_getpeername net/socket.c:1997 [inline] net/socket.c:1994
       __se_sys_getpeername net/socket.c:1994 [inline] net/socket.c:1994
       __x64_sys_getpeername+0xda/0x120 net/socket.c:1994 net/socket.c:1994
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_x64 arch/x86/entry/common.c:51 [inline] arch/x86/entry/common.c:82
       do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Uninit was stored to memory at:
       msg_set_word net/tipc/msg.h:212 [inline]
       msg_set_destport net/tipc/msg.h:619 [inline]
       msg_set_word net/tipc/msg.h:212 [inline] net/tipc/socket.c:1486
       msg_set_destport net/tipc/msg.h:619 [inline] net/tipc/socket.c:1486
       __tipc_sendmsg+0x44fa/0x5890 net/tipc/socket.c:1486 net/tipc/socket.c:1486
       tipc_sendmsg+0xeb/0x140 net/tipc/socket.c:1402 net/tipc/socket.c:1402
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg net/socket.c:724 [inline]
       sock_sendmsg_nosec net/socket.c:704 [inline] net/socket.c:2409
       sock_sendmsg net/socket.c:724 [inline] net/socket.c:2409
       ____sys_sendmsg+0xe11/0x12c0 net/socket.c:2409 net/socket.c:2409
       ___sys_sendmsg net/socket.c:2463 [inline]
       ___sys_sendmsg net/socket.c:2463 [inline] net/socket.c:2492
       __sys_sendmsg+0x704/0x840 net/socket.c:2492 net/socket.c:2492
       __do_sys_sendmsg net/socket.c:2501 [inline]
       __se_sys_sendmsg net/socket.c:2499 [inline]
       __do_sys_sendmsg net/socket.c:2501 [inline] net/socket.c:2499
       __se_sys_sendmsg net/socket.c:2499 [inline] net/socket.c:2499
       __x64_sys_sendmsg+0xe2/0x120 net/socket.c:2499 net/socket.c:2499
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_x64 arch/x86/entry/common.c:51 [inline] arch/x86/entry/common.c:82
       do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Local variable skaddr created at:
       __tipc_sendmsg+0x2d0/0x5890 net/tipc/socket.c:1419 net/tipc/socket.c:1419
       tipc_sendmsg+0xeb/0x140 net/tipc/socket.c:1402 net/tipc/socket.c:1402
      
      Bytes 4-7 of 16 are uninitialized
      Memory access of size 16 starts at ffff888113753e00
      Data copied to user address 0000000020000280
      
      Reported-by: syzbot+cdbd40e0c3ca02cae3b7@syzkaller.appspotmail.com
      Signed-off-by: default avatarHaimin Zhang <tcs_kernel@tencent.com>
      Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
      Link: https://lore.kernel.org/r/1640918123-14547-1-git-send-email-tcs.kernel@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d6d86830
    • Jianguo Wu's avatar
      selftests: net: udpgro_fwd.sh: explicitly checking the available ping feature · 5e75d0b2
      Jianguo Wu authored
      As Paolo pointed out, the result of ping IPv6 address depends on
      the running distro. So explicitly checking the available ping feature,
      as e.g. do the bareudp.sh self-tests.
      
      Fixes: 8b3170e0 ("selftests: net: using ping6 for IPv6 in udpgro_fwd.sh")
      Signed-off-by: default avatarJianguo Wu <wujianguo@chinatelecom.cn>
      Link: https://lore.kernel.org/r/825ee22b-4245-dbf7-d2f7-a230770d6e21@163.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5e75d0b2
    • Jakub Kicinski's avatar
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 0f1fe7b8
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2021-12-31
      
      We've added 2 non-merge commits during the last 14 day(s) which contain
      a total of 2 files changed, 3 insertions(+), 3 deletions(-).
      
      The main changes are:
      
      1) Revert of an earlier attempt to fix xsk's poll() behavior where it
         turned out that the fix for a rare problem made it much worse in
         general, from Magnus Karlsson. (Fyi, Magnus mentioned that a proper
         fix is coming early next year, so the revert is mainly to avoid
         slipping the behavior into 5.16.)
      
      2) Minor misc spell fix in BPF selftests, from Colin Ian King.
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        bpf, selftests: Fix spelling mistake "tained" -> "tainted"
        Revert "xsk: Do not sleep in poll() when need_wakeup set"
      ====================
      
      Link: https://lore.kernel.org/r/20211231160050.16105-1-daniel@iogearbox.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0f1fe7b8
  3. 31 Dec, 2021 6 commits
  4. 30 Dec, 2021 12 commits
  5. 29 Dec, 2021 10 commits
  6. 28 Dec, 2021 2 commits