Skip to content
  1. Nov 10, 2022
  2. Nov 09, 2022
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · 27c064ae
      David S. Miller authored
      
      
      Pablo Neira Ayuso says:
      
      ====================
      The following patchset contains Netfilter fixes for net:
      
      1) Fix deadlock in nfnetlink due to missing mutex release in error path,
         from Ziyang Xuan.
      
      2) Clean up pending autoload module list from nf_tables_exit_net() path,
         from Shigeru Yoshida.
      
      3) Fixes for the netfilter's reverse path selftest, from Phil Sutter.
      
      All of these bugs have been around for several releases.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      27c064ae
    • David S. Miller's avatar
      Merge branch 'wwan-iosm-fixes' · 5d041588
      David S. Miller authored
      
      
      M Chetan Kumar says:
      
      ====================
      net: wwan: iosm: fixes
      
      This patch series contains iosm fixes.
      
      PATCH1: Fix memory leak in ipc_pcie_read_bios_cfg.
      
      PATCH2: Fix driver not working with INTEL_IOMMU disabled config.
      
      PATCH3: Fix invalid mux header type.
      
      PATCH4: Fix kernel build robot reported errors.
      
      Please refer to individual commit message for details.
      
      --
      v2:
       * PATCH1: No Change
       * PATCH2: Kconfig change
                 - Add dependency on PCI to resolve kernel build robot errors.
       * PATCH3: No Change
       * PATCH4: New (Fix kernel build robot errors)
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5d041588
    • M Chetan Kumar's avatar
      net: wwan: iosm: fix kernel test robot reported errors · 980ec04a
      M Chetan Kumar authored
      
      
      Include linux/vmalloc.h in iosm_ipc_coredump.c &
      iosm_ipc_devlink.c to resolve kernel test robot errors.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      980ec04a
    • M Chetan Kumar's avatar
      net: wwan: iosm: fix invalid mux header type · 02d2d2ea
      M Chetan Kumar authored
      Data stall seen during peak DL throughput test & packets are
      dropped by mux layer due to invalid header type in datagram.
      
      During initlization Mux aggregration protocol is set to default
      UL/DL size and TD count of Mux lite protocol. This configuration
      mismatch between device and driver is resulting in data stall/packet
      drops.
      
      Override the UL/DL size and TD count for Mux aggregation protocol.
      
      Fixes: 1f52d7b6
      
       ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02d2d2ea
    • M Chetan Kumar's avatar
      net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled · 035e3bef
      M Chetan Kumar authored
      With INTEL_IOMMU disable config or by forcing intel_iommu=off from
      grub some of the features of IOSM driver like browsing, flashing &
      coredump collection is not working.
      
      When driver calls DMA API - dma_map_single() for tx transfers. It is
      resulting in dma mapping error.
      
      Set the device DMA addressing capabilities using dma_set_mask() and
      remove the INTEL_IOMMU dependency in kconfig so that driver follows
      the platform config either INTEL_IOMMU enable or disable.
      
      Fixes: f7af616c
      
       ("net: iosm: infrastructure")
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      035e3bef
    • M Chetan Kumar's avatar
      net: wwan: iosm: fix memory leak in ipc_pcie_read_bios_cfg · d38a648d
      M Chetan Kumar authored
      ipc_pcie_read_bios_cfg() is using the acpi_evaluate_dsm() to
      obtain the wwan power state configuration from BIOS but is
      not freeing the acpi_object. The acpi_evaluate_dsm() returned
      acpi_object to be freed.
      
      Free the acpi_object after use.
      
      Fixes: 7e98d785
      
       ("net: iosm: entry point")
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d38a648d
    • Phil Sutter's avatar
      selftests: netfilter: Fix and review rpath.sh · 58bb78ce
      Phil Sutter authored
      Address a few problems with the initial test script version:
      
      * On systems with ip6tables but no ip6tables-legacy, testing for
        ip6tables was disabled by accident.
      * Firewall setup phase did not respect possibly unavailable tools.
      * Consistently call nft via '$nft'.
      
      Fixes: 6e31ce83
      
       ("selftests: netfilter: Test reverse path filtering")
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      58bb78ce
    • Nick Child's avatar
      ibmveth: Reduce default tx queues to 8 · 742c60e1
      Nick Child authored
      Previously, the default number of transmit queues was 16. Due to
      resource concerns, set to 8 queues instead. Still allow the user
      to set more queues (max 16) if they like.
      
      Since the driver is virtualized away from the physical NIC, the purpose
      of multiple queues is purely to allow for parallel calls to the
      hypervisor. Therefore, there is no noticeable effect on performance by
      reducing queue count to 8.
      
      Fixes: d926793c
      
       ("ibmveth: Implement multi queue on xmit")
      Reported-by: default avatarDave Taht <dave.taht@gmail.com>
      Signed-off-by: default avatarNick Child <nnac123@linux.ibm.com>
      Link: https://lore.kernel.org/r/20221107203215.58206-1-nnac123@linux.ibm.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      742c60e1
    • Zhengchao Shao's avatar
      net: nixge: disable napi when enable interrupts failed in nixge_open() · b0633491
      Zhengchao Shao authored
      When failed to enable interrupts in nixge_open() for opening device,
      napi isn't disabled. When open nixge device next time, it will reports
      a invalid opcode issue. Fix it. Only be compiled, not be tested.
      
      Fixes: 492caffa
      
       ("net: ethernet: nixge: Add support for National Instruments XGE netdev")
      Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
      Link: https://lore.kernel.org/r/20221107101443.120205-1-shaozhengchao@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b0633491
    • Eric Dumazet's avatar
      net: tun: call napi_schedule_prep() to ensure we own a napi · 07d120aa
      Eric Dumazet authored
      A recent patch exposed another issue in napi_get_frags()
      caught by syzbot [1]
      
      Before feeding packets to GRO, and calling napi_complete()
      we must first grab NAPI_STATE_SCHED.
      
      [1]
      WARNING: CPU: 0 PID: 3612 at net/core/dev.c:6076 napi_complete_done+0x45b/0x880 net/core/dev.c:6076
      Modules linked in:
      CPU: 0 PID: 3612 Comm: syz-executor408 Not tainted 6.1.0-rc3-syzkaller-00175-g1118b2049d77 #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
      RIP: 0010:napi_complete_done+0x45b/0x880 net/core/dev.c:6076
      Code: c1 ea 03 0f b6 14 02 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 24 04 00 00 41 89 5d 1c e9 73 fc ff ff e8 b5 53 22 fa <0f> 0b e9 82 fe ff ff e8 a9 53 22 fa 48 8b 5c 24 08 31 ff 48 89 de
      RSP: 0018:ffffc90003c4f920 EFLAGS: 00010293
      RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000000
      RDX: ffff8880251c0000 RSI: ffffffff875a58db RDI: 0000000000000007
      RBP: 0000000000000001 R08: 0000000000000007 R09: 0000000000000000
      R10: 0000000000000001 R11: 0000000000000001 R12: ffff888072d02628
      R13: ffff888072d02618 R14: ffff888072d02634 R15: 0000000000000000
      FS: 0000555555f13300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
      CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000055c44d3892b8 CR3: 00000000172d2000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
      <TASK>
      napi_complete include/linux/netdevice.h:510 [inline]
      tun_get_user+0x206d/0x3a60 drivers/net/tun.c:1980
      tun_chr_write_iter+0xdb/0x200 drivers/net/tun.c:2027
      call_write_iter include/linux/fs.h:2191 [inline]
      do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735
      do_iter_write+0x182/0x700 fs/read_write.c:861
      vfs_writev+0x1aa/0x630 fs/read_write.c:934
      do_writev+0x133/0x2f0 fs/read_write.c:977
      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+0x63/0xcd
      RIP: 0033:0x7f37021a3c19
      
      Fixes: 1118b204
      
       ("net: tun: Fix memory leaks of napi_get_frags")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Wang Yufen <wangyufen@huawei.com>
      Link: https://lore.kernel.org/r/20221107180011.188437-1-edumazet@google.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      07d120aa
    • Zhengchao Shao's avatar
      net: marvell: prestera: fix memory leak in prestera_rxtx_switch_init() · 519b58bb
      Zhengchao Shao authored
      When prestera_sdma_switch_init() failed, the memory pointed to by
      sw->rxtx isn't released. Fix it. Only be compiled, not be tested.
      
      Fixes: 501ef306
      
       ("net: marvell: prestera: Add driver for Prestera family ASIC devices")
      Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
      Reviewed-by: default avatarVadym Kochan <vadym.kochan@plvision.eu>
      Link: https://lore.kernel.org/r/20221108025607.338450-1-shaozhengchao@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      519b58bb
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-6.1-20221107' of... · 2b014503
      Jakub Kicinski authored
      
      Merge tag 'linux-can-fixes-for-6.1-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      can 2022-11-07
      
      The first patch is by Chen Zhongjin and adds a missing
      dev_remove_pack() to the AF_CAN protocol.
      
      Zhengchao Shao's patch fixes a potential NULL pointer deref in
      AF_CAN's can_rx_register().
      
      The next patch is by Oliver Hartkopp and targets the CAN ISO-TP
      protocol, and fixes the state handling for echo TX processing.
      
      Oliver Hartkopp's patch for the j1939 protocol adds a missing
      initialization of the CAN headers inside outgoing skbs.
      
      Another patch by Oliver Hartkopp fixes an out of bounds read in the
      check for invalid CAN frames in the xmit callback of virtual CAN
      devices. This touches all non virtual device drivers as we decided to
      rename the function requiring that netdev_priv points to a struct
      can_priv.
      (Note: This patch will create a merge conflict with net-next where the
       pch_can driver has removed.)
      
      The last patch is by Geert Uytterhoeven and adds the missing ECC error
      checks for the channels 2-7 in the rcar_canfd driver.
      
      * tag 'linux-can-fixes-for-6.1-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: rcar_canfd: Add missing ECC error checks for channels 2-7
        can: dev: fix skb drop check
        can: j1939: j1939_send_one(): fix missing CAN header initialization
        can: isotp: fix tx state handling for echo tx processing
        can: af_can: fix NULL pointer dereference in can_rx_register()
        can: af_can: can_exit(): add missing dev_remove_pack() of canxl_packet
      ====================
      
      Link: https://lore.kernel.org/r/20221107133217.59861-1-mkl@pengutronix.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2b014503
    • Shigeru Yoshida's avatar
      netfilter: Cleanup nft_net->module_list from nf_tables_exit_net() · 03c1f1ef
      Shigeru Yoshida authored
      syzbot reported a warning like below [1]:
      
      WARNING: CPU: 3 PID: 9 at net/netfilter/nf_tables_api.c:10096 nf_tables_exit_net+0x71c/0x840
      Modules linked in:
      CPU: 2 PID: 9 Comm: kworker/u8:0 Tainted: G        W          6.1.0-rc3-00072-g8e5423e991e8 #47
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014
      Workqueue: netns cleanup_net
      RIP: 0010:nf_tables_exit_net+0x71c/0x840
      ...
      Call Trace:
       <TASK>
       ? __nft_release_table+0xfc0/0xfc0
       ops_exit_list+0xb5/0x180
       cleanup_net+0x506/0xb10
       ? unregister_pernet_device+0x80/0x80
       process_one_work+0xa38/0x1730
       ? pwq_dec_nr_in_flight+0x2b0/0x2b0
       ? rwlock_bug.part.0+0x90/0x90
       ? _raw_spin_lock_irq+0x46/0x50
       worker_thread+0x67e/0x10e0
       ? process_one_work+0x1730/0x1730
       kthread+0x2e5/0x3a0
       ? kthread_complete_and_exit+0x40/0x40
       ret_from_fork+0x1f/0x30
       </TASK>
      
      In nf_tables_exit_net(), there is a case where nft_net->commit_list is
      empty but nft_net->module_list is not empty.  Such a case occurs with
      the following scenario:
      
      1. nfnetlink_rcv_batch() is called
      2. nf_tables_newset() returns -EAGAIN and NFNL_BATCH_FAILURE bit is
         set to status
      3. nf_tables_abort() is called with NFNL_ABORT_AUTOLOAD
         (nft_net->commit_list is released, but nft_net->module_list is not
         because of NFNL_ABORT_AUTOLOAD flag)
      4. Jump to replay label
      5. netlink_skb_clone() fails and returns from the function (this is
         caused by fault injection in the reproducer of syzbot)
      
      This patch fixes this issue by calling __nf_tables_abort() when
      nft_net->module_list is not empty in nf_tables_exit_net().
      
      Fixes: eb014de4
      
       ("netfilter: nf_tables: autoload modules from the abort path")
      Link: https://syzkaller.appspot.com/bug?id=802aba2422de4218ad0c01b46c9525cc9d4e4aa3 [1]
      Reported-by: default avatar <syzbot+178efee9e2d7f87f5103@syzkaller.appspotmail.com>
      Signed-off-by: default avatarShigeru Yoshida <syoshida@redhat.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      03c1f1ef
    • Ziyang Xuan's avatar
      netfilter: nfnetlink: fix potential dead lock in nfnetlink_rcv_msg() · 03832a32
      Ziyang Xuan authored
      When type is NFNL_CB_MUTEX and -EAGAIN error occur in nfnetlink_rcv_msg(),
      it does not execute nfnl_unlock(). That would trigger potential dead lock.
      
      Fixes: 50f2db9e
      
       ("netfilter: nfnetlink: consolidate callback types")
      Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      03832a32
  3. Nov 08, 2022
    • Zhengchao Shao's avatar
      drivers: net: xgene: disable napi when register irq failed in xgene_enet_open() · ce9e57fe
      Zhengchao Shao authored
      When failed to register irq in xgene_enet_open() for opening device,
      napi isn't disabled. When open xgene device next time, it will reports
      a invalid opcode issue. Fix it. Only be compiled, not be tested.
      
      Fixes: aeb20b6b
      
       ("drivers: net: xgene: fix: ifconfig up/down crash")
      Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
      Link: https://lore.kernel.org/r/20221107043032.357673-1-shaozhengchao@huawei.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      ce9e57fe
    • Ratheesh Kannoth's avatar
      octeontx2-pf: Fix SQE threshold checking · f0dfc4c8
      Ratheesh Kannoth authored
      Current way of checking available SQE count which is based on
      HW updated SQB count could result in driver submitting an SQE
      even before CQE for the previously transmitted SQE at the same
      index is processed in NAPI resulting losing SKB pointers,
      hence a leak. Fix this by checking a consumer index which
      is updated once CQE is processed.
      
      Fixes: 3ca6c4c8
      
       ("octeontx2-pf: Add packet transmission support")
      Signed-off-by: default avatarRatheesh Kannoth <rkannoth@marvell.com>
      Reviewed-by: default avatarSunil Kovvuri Goutham <sgoutham@marvell.com>
      Link: https://lore.kernel.org/r/20221107033505.2491464-1-rkannoth@marvell.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f0dfc4c8
    • Zhengchao Shao's avatar
      net: ethernet: mtk-star-emac: disable napi when connect and start PHY failed in mtk_star_enable() · b0c09c7f
      Zhengchao Shao authored
      When failed to connect to and start PHY in mtk_star_enable() for opening
      device, napi isn't disabled. When open mtk star device next time, it will
      reports a invalid opcode issue. Fix it. Only be compiled, not be tested.
      
      Fixes: 8c7bd5a4
      
       ("net: ethernet: mtk-star-emac: new driver")
      Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Link: https://lore.kernel.org/r/20221107012159.211387-1-shaozhengchao@huawei.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b0c09c7f
    • Zhengchao Shao's avatar
      net: lapbether: fix issue of invalid opcode in lapbeth_open() · 3faf7e14
      Zhengchao Shao authored
      If lapb_register() failed when lapb device goes to up for the first time,
      the NAPI is not disabled. As a result, the invalid opcode issue is
      reported when the lapb device goes to up for the second time.
      
      The stack info is as follows:
      [ 1958.311422][T11356] kernel BUG at net/core/dev.c:6442!
      [ 1958.312206][T11356] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
      [ 1958.315979][T11356] RIP: 0010:napi_enable+0x16a/0x1f0
      [ 1958.332310][T11356] Call Trace:
      [ 1958.332817][T11356]  <TASK>
      [ 1958.336135][T11356]  lapbeth_open+0x18/0x90
      [ 1958.337446][T11356]  __dev_open+0x258/0x490
      [ 1958.341672][T11356]  __dev_change_flags+0x4d4/0x6a0
      [ 1958.345325][T11356]  dev_change_flags+0x93/0x160
      [ 1958.346027][T11356]  devinet_ioctl+0x1276/0x1bf0
      [ 1958.346738][T11356]  inet_ioctl+0x1c8/0x2d0
      [ 1958.349638][T11356]  sock_ioctl+0x5d1/0x750
      [ 1958.356059][T11356]  __x64_sys_ioctl+0x3ec/0x1790
      [ 1958.365594][T11356]  do_syscall_64+0x35/0x80
      [ 1958.366239][T11356]  entry_SYSCALL_64_after_hwframe+0x46/0xb0
      [ 1958.377381][T11356]  </TASK>
      
      Fixes: 514e1150
      
       ("net: x25: Queue received packets in the drivers instead of per-CPU queues")
      Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
      Link: https://lore.kernel.org/r/20221107011445.207372-1-shaozhengchao@huawei.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      3faf7e14
    • Jakub Kicinski's avatar
      Merge branch 'sctp-fix-a-null-pointer-dereference-in-sctp_sched_dequeue_common' · 89bbe785
      Jakub Kicinski authored
      
      
      Xin Long says:
      
      ====================
      sctp: fix a NULL pointer dereference in sctp_sched_dequeue_common
      
      This issue was triggered with SCTP_PR_SCTP_PRIO in sctp,
      and caused by not checking and fixing stream->out_curr
      after removing a chunk from this stream.
      
      Patch 1 removes an unnecessary check and makes the real
      fix easier to add in Patch 2.
      ====================
      
      Link: https://lore.kernel.org/r/cover.1667598261.git.lucien.xin@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      89bbe785
    • Xin Long's avatar
      sctp: clear out_curr if all frag chunks of current msg are pruned · 2f201ae1
      Xin Long authored
      A crash was reported by Zhen Chen:
      
        list_del corruption, ffffa035ddf01c18->next is NULL
        WARNING: CPU: 1 PID: 250682 at lib/list_debug.c:49 __list_del_entry_valid+0x59/0xe0
        RIP: 0010:__list_del_entry_valid+0x59/0xe0
        Call Trace:
         sctp_sched_dequeue_common+0x17/0x70 [sctp]
         sctp_sched_fcfs_dequeue+0x37/0x50 [sctp]
         sctp_outq_flush_data+0x85/0x360 [sctp]
         sctp_outq_uncork+0x77/0xa0 [sctp]
         sctp_cmd_interpreter.constprop.0+0x164/0x1450 [sctp]
         sctp_side_effects+0x37/0xe0 [sctp]
         sctp_do_sm+0xd0/0x230 [sctp]
         sctp_primitive_SEND+0x2f/0x40 [sctp]
         sctp_sendmsg_to_asoc+0x3fa/0x5c0 [sctp]
         sctp_sendmsg+0x3d5/0x440 [sctp]
         sock_sendmsg+0x5b/0x70
      
      and in sctp_sched_fcfs_dequeue() it dequeued a chunk from stream
      out_curr outq while this outq was empty.
      
      Normally stream->out_curr must be set to NULL once all frag chunks of
      current msg are dequeued, as we can see in sctp_sched_dequeue_done().
      However, in sctp_prsctp_prune_unsent() as it is not a proper dequeue,
      sctp_sched_dequeue_done() is not called to do this.
      
      This patch is to fix it by simply setting out_curr to NULL when the
      last frag chunk of current msg is dequeued from out_curr stream in
      sctp_prsctp_prune_unsent().
      
      Fixes: 5bbbbe32
      
       ("sctp: introduce stream scheduler foundations")
      Reported-by: default avatarZhen Chen <chenzhen126@huawei.com>
      Tested-by: default avatarCaowangbao <caowangbao@huawei.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2f201ae1
    • Xin Long's avatar
      sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent · 9f0b7732
      Xin Long authored
      Since commit 5bbbbe32
      
       ("sctp: introduce stream scheduler foundations"),
      sctp_stream_outq_migrate() has been called in sctp_stream_init/update to
      removes those chunks to streams higher than the new max. There is no longer
      need to do such check in sctp_prsctp_prune_unsent().
      
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9f0b7732
    • Xin Long's avatar
      tipc: fix the msg->req tlv len check in tipc_nl_compat_name_table_dump_header · 1c075b19
      Xin Long authored
      This is a follow-up for commit 974cb0e3
      
       ("tipc: fix uninit-value
      in tipc_nl_compat_name_table_dump") where it should have type casted
      sizeof(..) to int to work when TLV_GET_DATA_LEN() returns a negative
      value.
      
      syzbot reported a call trace because of it:
      
        BUG: KMSAN: uninit-value in ...
         tipc_nl_compat_name_table_dump+0x841/0xea0 net/tipc/netlink_compat.c:934
         __tipc_nl_compat_dumpit+0xab2/0x1320 net/tipc/netlink_compat.c:238
         tipc_nl_compat_dumpit+0x991/0xb50 net/tipc/netlink_compat.c:321
         tipc_nl_compat_recv+0xb6e/0x1640 net/tipc/netlink_compat.c:1324
         genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline]
         genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
         genl_rcv_msg+0x103f/0x1260 net/netlink/genetlink.c:792
         netlink_rcv_skb+0x3a5/0x6c0 net/netlink/af_netlink.c:2501
         genl_rcv+0x3c/0x50 net/netlink/genetlink.c:803
         netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
         netlink_unicast+0xf3b/0x1270 net/netlink/af_netlink.c:1345
         netlink_sendmsg+0x1288/0x1440 net/netlink/af_netlink.c:1921
         sock_sendmsg_nosec net/socket.c:714 [inline]
         sock_sendmsg net/socket.c:734 [inline]
      
      Reported-by: default avatar <syzbot+e5dbaaa238680ce206ea@syzkaller.appspotmail.com>
      Fixes: 974cb0e3
      
       ("tipc: fix uninit-value in tipc_nl_compat_name_table_dump")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Link: https://lore.kernel.org/r/ccd6a7ea801b15aec092c3b532a883b4c5708695.1667594933.git.lucien.xin@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1c075b19
    • YueHaibing's avatar
      net: broadcom: Fix BCMGENET Kconfig · 8d820bc9
      YueHaibing authored
      While BCMGENET select BROADCOM_PHY as y, but PTP_1588_CLOCK_OPTIONAL is m,
      kconfig warning and build errors:
      
      WARNING: unmet direct dependencies detected for BROADCOM_PHY
        Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && PTP_1588_CLOCK_OPTIONAL [=m]
        Selected by [y]:
        - BCMGENET [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_BROADCOM [=y] && HAS_IOMEM [=y] && ARCH_BCM2835 [=y]
      
      drivers/net/phy/broadcom.o: In function `bcm54xx_suspend':
      broadcom.c:(.text+0x6ac): undefined reference to `bcm_ptp_stop'
      drivers/net/phy/broadcom.o: In function `bcm54xx_phy_probe':
      broadcom.c:(.text+0x784): undefined reference to `bcm_ptp_probe'
      drivers/net/phy/broadcom.o: In function `bcm54xx_config_init':
      broadcom.c:(.text+0xd4c): undefined reference to `bcm_ptp_config_init'
      
      Fixes: 99addbe3
      
       ("net: broadcom: Select BROADCOM_PHY for BCMGENET")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@broadcom.com>
      Link: https://lore.kernel.org/r/20221105090245.8508-1-yuehaibing@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8d820bc9
    • Yang Yingliang's avatar
      octeontx2-pf: fix build error when CONFIG_OCTEONTX2_PF=y · 02f5999e
      Yang Yingliang authored
      If CONFIG_MACSEC=m and CONFIG_OCTEONTX2_PF=y, it leads a build error:
      
        ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_pfaf_mbox_up_handler':
        otx2_pf.c:(.text+0x181c): undefined reference to `cn10k_handle_mcs_event'
        ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_probe':
        otx2_pf.c:(.text+0x437e): undefined reference to `cn10k_mcs_init'
        ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_remove':
        otx2_pf.c:(.text+0x5031): undefined reference to `cn10k_mcs_free'
        ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_mbox_up_handler_mcs_intr_notify':
        otx2_pf.c:(.text+0x5f11): undefined reference to `cn10k_handle_mcs_event'
      
      Make CONFIG_OCTEONTX2_PF depends on CONFIG_MACSEC to fix it. Because
      it has empty stub functions of cn10k, CONFIG_OCTEONTX2_PF can be enabled
      if CONFIG_MACSEC is disabled
      
      Fixes: c54ffc73
      
       ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Link: https://lore.kernel.org/r/20221105063442.2013981-1-yangyingliang@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      02f5999e
    • Miquel Raynal's avatar
      dt-bindings: net: tsnep: Fix typo on generic nvmem property · ec683f02
      Miquel Raynal authored
      While working on the nvmem description I figured out this file had the
      "nvmem-cell-names" property name misspelled. Fix the typo, as
      "nvmem-cells-names" has never existed.
      
      Fixes: 603094b2
      
       ("dt-bindings: net: Add tsnep Ethernet controller")
      Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Reviewed-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20221104162147.1288230-1-miquel.raynal@bootlin.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ec683f02
    • Rasmus Villemoes's avatar
      net: stmmac: dwmac-meson8b: fix meson8b_devm_clk_prepare_enable() · ed4314f7
      Rasmus Villemoes authored
      There are two problems with meson8b_devm_clk_prepare_enable(),
      introduced in commit a54dc4a4 ("net: stmmac: dwmac-meson8b:
      Make the clock enabling code re-usable"):
      
      - It doesn't pass the clk argument, but instead always the
        rgmii_tx_clk of the device.
      
      - It silently ignores the return value of devm_add_action_or_reset().
      
      The former didn't become an actual bug until another user showed up in
      the next commit 9308c476 ("net: stmmac: dwmac-meson8b: add support
      for the RX delay configuration"). The latter means the callers could
      end up with the clock not actually prepared/enabled.
      
      Fixes: a54dc4a4
      
       ("net: stmmac: dwmac-meson8b: Make the clock enabling code re-usable")
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Reviewed-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Link: https://lore.kernel.org/r/20221104083004.2212520-1-linux@rasmusvillemoes.dk
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ed4314f7
  4. Nov 07, 2022
    • Geert Uytterhoeven's avatar
      can: rcar_canfd: Add missing ECC error checks for channels 2-7 · 8b043dfb
      Geert Uytterhoeven authored
      When introducing support for R-Car V3U, which has 8 instead of 2
      channels, the ECC error bitmask was extended to take into account the
      extra channels, but rcar_canfd_global_error() was not updated to act
      upon the extra bits.
      
      Replace the RCANFD_GERFL_EEF[01] macros by a new macro that takes the
      channel number, fixing R-Car V3U while simplifying the code.
      
      Fixes: 45721c40
      
       ("can: rcar_canfd: Add support for r8a779a0 SoC")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
      Link: https://lore.kernel.org/all/4edb2ea46cc64d0532a08a924179827481e14b4f.1666951503.git.geert+renesas@glider.be
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      8b043dfb
    • Oliver Hartkopp's avatar
      can: dev: fix skb drop check · ae64438b
      Oliver Hartkopp authored
      In commit a6d190f8 ("can: skb: drop tx skb if in listen only
      mode") the priv->ctrlmode element is read even on virtual CAN
      interfaces that do not create the struct can_priv at startup. This
      out-of-bounds read may lead to CAN frame drops for virtual CAN
      interfaces like vcan and vxcan.
      
      This patch mainly reverts the original commit and adds a new helper
      for CAN interface drivers that provide the required information in
      struct can_priv.
      
      Fixes: a6d190f8
      
       ("can: skb: drop tx skb if in listen only mode")
      Reported-by: default avatarDariusz Stojaczyk <Dariusz.Stojaczyk@opensynergy.com>
      Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
      Cc: Max Staudt <max@enpas.org>
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Acked-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
      Link: https://lore.kernel.org/all/20221102095431.36831-1-socketcan@hartkopp.net
      Cc: stable@vger.kernel.org # 6.0.x
      [mkl: patch pch_can, too]
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      ae64438b
    • Oliver Hartkopp's avatar
      can: j1939: j1939_send_one(): fix missing CAN header initialization · 3eb3d283
      Oliver Hartkopp authored
      The read access to struct canxl_frame::len inside of a j1939 created
      skbuff revealed a missing initialization of reserved and later filled
      elements in struct can_frame.
      
      This patch initializes the 8 byte CAN header with zero.
      
      Fixes: 9d71dd0c
      
       ("can: add support of SAE J1939 protocol")
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Link: https://lore.kernel.org/linux-can/20221104052235.GA6474@pengutronix.de
      Reported-by: default avatar <syzbot+d168ec0caca4697e03b1@syzkaller.appspotmail.com>
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Link: https://lore.kernel.org/all/20221104075000.105414-1-socketcan@hartkopp.net
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      3eb3d283
    • Oliver Hartkopp's avatar
      can: isotp: fix tx state handling for echo tx processing · 86633786
      Oliver Hartkopp authored
      In commit 4b7fe92c ("can: isotp: add local echo tx processing for
      consecutive frames") the data flow for consecutive frames (CF) has been
      reworked to improve the reliability of long data transfers.
      
      This rework did not touch the transmission and the tx state changes of
      single frame (SF) transfers which likely led to the WARN in the
      isotp_tx_timer_handler() catching a wrong tx state. This patch makes use
      of the improved frame processing for SF frames and sets the ISOTP_SENDING
      state in isotp_sendmsg() within the cmpxchg() condition handling.
      
      A review of the state machine and the timer handling additionally revealed
      a missing echo timeout handling in the case of the burst mode in
      isotp_rcv_echo() and removes a potential timer configuration uncertainty
      in isotp_rcv_fc() when the receiver requests consecutive frames.
      
      Fixes: 4b7fe92c
      
       ("can: isotp: add local echo tx processing for consecutive frames")
      Link: https://lore.kernel.org/linux-can/CAO4mrfe3dG7cMP1V5FLUkw7s+50c9vichigUMQwsxX4M=45QEw@mail.gmail.com/T/#u
      Reported-by: default avatarWei Chen <harperchen1110@gmail.com>
      Cc: stable@vger.kernel.org # v6.0
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Link: https://lore.kernel.org/all/20221104142551.16924-1-socketcan@hartkopp.net
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      86633786
    • Zhengchao Shao's avatar
      can: af_can: fix NULL pointer dereference in can_rx_register() · 8aa59e35
      Zhengchao Shao authored
      It causes NULL pointer dereference when testing as following:
      (a) use syscall(__NR_socket, 0x10ul, 3ul, 0) to create netlink socket.
      (b) use syscall(__NR_sendmsg, ...) to create bond link device and vxcan
          link device, and bind vxcan device to bond device (can also use
          ifenslave command to bind vxcan device to bond device).
      (c) use syscall(__NR_socket, 0x1dul, 3ul, 1) to create CAN socket.
      (d) use syscall(__NR_bind, ...) to bind the bond device to CAN socket.
      
      The bond device invokes the can-raw protocol registration interface to
      receive CAN packets. However, ml_priv is not allocated to the dev,
      dev_rcv_lists is assigned to NULL in can_rx_register(). In this case,
      it will occur the NULL pointer dereference issue.
      
      The following is the stack information:
      BUG: kernel NULL pointer dereference, address: 0000000000000008
      PGD 122a4067 P4D 122a4067 PUD 1223c067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP
      RIP: 0010:can_rx_register+0x12d/0x1e0
      Call Trace:
      <TASK>
      raw_enable_filters+0x8d/0x120
      raw_enable_allfilters+0x3b/0x130
      raw_bind+0x118/0x4f0
      __sys_bind+0x163/0x1a0
      __x64_sys_bind+0x1e/0x30
      do_syscall_64+0x35/0x80
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
      </TASK>
      
      Fixes: 4e096a18
      
       ("net: introduce CAN specific pointer in the struct net_device")
      Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
      Reviewed-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Link: https://lore.kernel.org/all/20221028085650.170470-1-shaozhengchao@huawei.com
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      8aa59e35
    • Chen Zhongjin's avatar
      can: af_can: can_exit(): add missing dev_remove_pack() of canxl_packet · a3335fae
      Chen Zhongjin authored
      In can_init(), dev_add_pack(&canxl_packet) is added but not removed in
      can_exit(). It breaks the packet handler list and can make kernel
      panic when can_init() is called for the second time.
      
      | > modprobe can && rmmod can
      | > rmmod xxx && modprobe can
      |
      | BUG: unable to handle page fault for address: fffffbfff807d7f4
      | RIP: 0010:dev_add_pack+0x133/0x1f0
      | Call Trace:
      |  <TASK>
      |  can_init+0xaa/0x1000 [can]
      |  do_one_initcall+0xd3/0x4e0
      |  ...
      
      Fixes: fb08cba1
      
       ("can: canxl: update CAN infrastructure for CAN XL frames")
      Signed-off-by: default avatarChen Zhongjin <chenzhongjin@huawei.com>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Link: https://lore.kernel.org/all/20221031033053.37849-1-chenzhongjin@huawei.com
      [mkl: adjust subject and commit message]
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      a3335fae