1. Jan 07, 2022
    • Aya Levin's avatar
      net/mlx5e: Fix page DMA map/unmap attributes · 0b7cfa40
      Aya Levin authored
      Driver initiates DMA sync, hence it may skip CPU sync. Add
      DMA_ATTR_SKIP_CPU_SYNC as input attribute both to dma_map_page and
      dma_unmap_page to avoid redundant sync with the CPU.
      When forcing the device to work with SWIOTLB, the extra sync might cause
      data corruption. The driver unmaps the whole page while the hardware
      used just a part of the bounce buffer. So syncing overrides the entire
      page with bounce buffer that only partially contains real data.
      
      Fixes: bc77b240 ("net/mlx5e: Add fragmented memory support for RX multi packet WQE")
      Fixes: db05815b
      
       ("net/mlx5e: Add XSK zero-copy support")
      Signed-off-by: default avatarAya Levin <ayal@nvidia.com>
      Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      0b7cfa40
  2. Jan 06, 2022
    • Wen Gu's avatar
      net/smc: Reset conn->lgr when link group registration fails · 36595d8a
      Wen Gu authored
      SMC connections might fail to be registered in a link group due to
      unable to find a usable link during its creation. As a result,
      smc_conn_create() will return a failure and most resources related
      to the connection won't be applied or initialized, such as
      conn->abort_work or conn->lnk.
      
      If smc_conn_free() is invoked later, it will try to access the
      uninitialized resources related to the connection, thus causing
      a warning or crash.
      
      This patch tries to fix this by resetting conn->lgr to NULL if an
      abnormal exit occurs in smc_lgr_register_conn(), thus avoiding the
      access to uninitialized resources in smc_conn_free().
      
      Meanwhile, the new created link group should be terminated if smc
      connections can't be registered in it. So smc_lgr_cleanup_early() is
      modified to take care of link group only and invoked to terminate
      unusable link group by smc_conn_create(). The call to smc_conn_free()
      is moved out from smc_lgr_cleanup_early() to smc_conn_abort().
      
      Fixes: 56bc3b20
      
       ("net/smc: assign link to a new connection")
      Suggested-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
      Acked-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      36595d8a
    • Jiasheng Jiang's avatar
      fsl/fman: Check for null pointer after calling devm_ioremap · d5a73ec9
      Jiasheng Jiang authored
      As the possible failure of the allocation, the devm_ioremap() may return
      NULL pointer.
      Take tgec_initialization() as an example.
      If allocation fails, the params->base_addr will be NULL pointer and will
      be assigned to tgec->regs in tgec_config().
      Then it will cause the dereference of NULL pointer in set_mac_address(),
      which is called by tgec_init().
      Therefore, it should be better to add the sanity check after the calling
      of the devm_ioremap().
      
      Fixes: 39339616
      
       ("fsl/fman: Add FMan MAC driver")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d5a73ec9
    • Dan Carpenter's avatar
      rocker: fix a sleeping in atomic bug · 43d01212
      Dan Carpenter authored
      This code is holding the &ofdpa->flow_tbl_lock spinlock so it is not
      allowed to sleep.  That means we have to pass the OFDPA_OP_FLAG_NOWAIT
      flag to ofdpa_flow_tbl_del().
      
      Fixes: 936bd486
      
       ("rocker: use FIB notifications instead of switchdev calls")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43d01212
    • Eric Dumazet's avatar
      ppp: ensure minimum packet size in ppp_write() · 44073187
      Eric Dumazet authored
      It seems pretty clear ppp layer assumed user space
      would always be kind to provide enough data
      in their write() to a ppp device.
      
      This patch makes sure user provides at least
      2 bytes.
      
      It adds PPP_PROTO_LEN macro that could replace
      in net-next many occurrences of hard-coded 2 value.
      
      I replaced only one occurrence to ease backports
      to stable kernels.
      
      The bug manifests in the following report:
      
      BUG: KMSAN: uninit-value in ppp_send_frame+0x28d/0x27c0 drivers/net/ppp/ppp_generic.c:1740
       ppp_send_frame+0x28d/0x27c0 drivers/net/ppp/ppp_generic.c:1740
       __ppp_xmit_process+0x23e/0x4b0 drivers/net/ppp/ppp_generic.c:1640
       ppp_xmit_process+0x1fe/0x480 drivers/net/ppp/ppp_generic.c:1661
       ppp_write+0x5cb/0x5e0 drivers/net/ppp/ppp_generic.c:513
       do_iter_write+0xb0c/0x1500 fs/read_write.c:853
       vfs_writev fs/read_write.c:924 [inline]
       do_writev+0x645/0xe00 fs/read_write.c:967
       __do_sys_writev fs/read_write.c:1040 [inline]
       __se_sys_writev fs/read_write.c:1037 [inline]
       __x64_sys_writev+0xe5/0x120 fs/read_write.c:1037
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Uninit was created at:
       slab_post_alloc_hook mm/slab.h:524 [inline]
       slab_alloc_node mm/slub.c:3251 [inline]
       __kmalloc_node_track_caller+0xe0c/0x1510 mm/slub.c:4974
       kmalloc_reserve net/core/skbuff.c:354 [inline]
       __alloc_skb+0x545/0xf90 net/core/skbuff.c:426
       alloc_skb include/linux/skbuff.h:1126 [inline]
       ppp_write+0x11d/0x5e0 drivers/net/ppp/ppp_generic.c:501
       do_iter_write+0xb0c/0x1500 fs/read_write.c:853
       vfs_writev fs/read_write.c:924 [inline]
       do_writev+0x645/0xe00 fs/read_write.c:967
       __do_sys_writev fs/read_write.c:1040 [inline]
       __se_sys_writev fs/read_write.c:1037 [inline]
       __x64_sys_writev+0xe5/0x120 fs/read_write.c:1037
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: 1da177e4
      
       ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: linux-ppp@vger.kernel.org
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Acked-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      44073187
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec · c4251db3
      David S. Miller authored
      
      
      Steffen Klassert says:
      
      ====================
      pull request (net): ipsec 2022-01-06
      
      1) Fix xfrm policy lookups for ipv6 gre packets by initializing
         fl6_gre_key properly. From Ghalem Boudour.
      
      2) Fix the dflt policy check on forwarding when there is no
         policy configured. The check was done for the wrong direction.
         From Nicolas Dichtel.
      
      3) Use the correct 'struct xfrm_user_offload' when calculating
         netlink message lenghts in xfrm_sa_len(). From Eric Dumazet.
      
      4) Tread inserting xfrm interface id 0 as an error.
         From Antony Antony.
      
      5) Fail if xfrm state or policy is inserted with XFRMA_IF_ID 0,
         xfrm interfaces with id 0 are not allowed.
         From Antony Antony.
      
      6) Fix inner_ipproto setting in the sec_path for tunnel mode.
         From  Raed Salem.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c4251db3
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-5.16-20220105' of... · 502a2ce9
      Jakub Kicinski authored
      Merge tag 'linux-can-fixes-for-5.16-20220105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2022-01-05
      
      It consists of 2 patches, both by me. The first one fixes the use of
      an uninitialized variable in the gs_usb driver the other one a
      skb_over_panic in the ISOTP stack in case of reception of too large
      ISOTP messages.
      
      * tag 'linux-can-fixes-for-5.16-20220105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: isotp: convert struct tpcon::{idx,len} to unsigned int
        can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data
      ====================
      
      Link: https://lore.kernel.org/r/20220105205443.1274709-1-mkl@pengutronix.de
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      502a2ce9
    • Linus Torvalds's avatar
      Merge tag 'net-5.16-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 75acfdb6
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski"
       "Networking fixes, including fixes from bpf, and WiFi. One last pull
        request, turns out some of the recent fixes did more harm than good.
      
        Current release - regressions:
      
         - Revert "xsk: Do not sleep in poll() when need_wakeup set", made the
           problem worse
      
         - Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in
           __fixed_phy_register", broke EPROBE_DEFER handling
      
         - Revert "net: usb: r8152: Add MAC pass-through support for more
           Lenovo Docks", broke setups without a Lenovo dock
      
        Current release - new code bugs:
      
         - selftests: set amt.sh executable
      
        Previous releases - regressions:
      
         - batman-adv: mcast: don't send link-local multicast to mcast routers
      
        Previous releases - always broken:
      
         - ipv4/ipv6: check attribute length for RTA_FLOW / RTA_GATEWAY
      
         - sctp: hold endpoint before calling cb in
           sctp_transport_lookup_process
      
         - mac80211: mesh: embed mesh_paths and mpp_paths into
           ieee80211_if_mesh to avoid complicated handling of sub-object
           allocation failures
      
         - seg6: fix traceroute in the presence of SRv6
      
         - tipc: fix a kernel-infoleak in __tipc_sendmsg()"
      
      * tag 'net-5.16-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (36 commits)
        selftests: set amt.sh executable
        Revert "net: usb: r8152: Add MAC passthrough support for more Lenovo Docks"
        sfc: The RX page_ring is optional
        iavf: Fix limit of total number of queues to active queues of VF
        i40e: Fix incorrect netdev's real number of RX/TX queues
        i40e: Fix for displaying message regarding NVM version
        i40e: fix use-after-free in i40e_sync_filters_subtask()
        i40e: Fix to not show opcode msg on unsuccessful VF MAC change
        ieee802154: atusb: fix uninit value in atusb_set_extended_addr
        mac80211: mesh: embedd mesh_paths and mpp_paths into ieee80211_if_mesh
        mac80211: initialize variable have_higher_than_11mbit
        sch_qfq: prevent shift-out-of-bounds in qfq_init_qdisc
        netrom: fix copying in user data in nr_setsockopt
        udp6: Use Segment Routing Header for dest address if present
        icmp: ICMPV6: Examine invoking packet for Segment Route Headers.
        seg6: export get_srh() for ICMP handling
        Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register"
        ipv6: Do cleanup if attribute validation fails in multipath route
        ipv6: Continue processing multipath route even if gateway attribute is invalid
        net/fsl: Remove leftover definition in xgmac_mdio
        ...
      75acfdb6
    • Marc Kleine-Budde's avatar
      can: isotp: convert struct tpcon::{idx,len} to unsigned int · 5f33a09e
      Marc Kleine-Budde authored
      In isotp_rcv_ff() 32 bit of data received over the network is assigned
      to struct tpcon::len. Later in that function the length is checked for
      the maximal supported length against MAX_MSG_LENGTH.
      
      As struct tpcon::len is an "int" this check does not work, if the
      provided length overflows the "int".
      
      Later on struct tpcon::idx is compared against struct tpcon::len.
      
      To fix this problem this patch converts both struct tpcon::{idx,len}
      to unsigned int.
      
      Fixes: e057dd3f ("can: add ISO 15765-2:2016 transport protocol")
      Link: https://lore.kernel.org/all/20220105132429.1170627-1-mkl@pengutronix.de
      
      
      Cc: stable@vger.kernel.org
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Reported-by: default avatar <syzbot+4c63f36709a642f801c5@syzkaller.appspotmail.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      5f33a09e
    • Marc Kleine-Budde's avatar
      can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data · 4a8737ff
      Marc Kleine-Budde authored
      The received data contains the channel the received data is associated
      with. If the channel number is bigger than the actual number of
      channels assume broken or malicious USB device and shut it down.
      
      This fixes the error found by clang:
      
      | drivers/net/can/usb/gs_usb.c:386:6: error: variable 'dev' is used
      |                                     uninitialized whenever 'if' condition is true
      |         if (hf->channel >= GS_MAX_INTF)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
      | drivers/net/can/usb/gs_usb.c:474:10: note: uninitialized use occurs here
      |                           hf, dev->gs_hf_size, gs_usb_receive_bulk_callback,
      |                               ^~~
      
      Link: https://lore.kernel.org/all/20211210091158.408326-1-mkl@pengutronix.de
      Fixes: d08e973a
      
       ("can: gs_usb: Added support for the GS_USB CAN devices")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      4a8737ff
    • Taehee Yoo's avatar
      selftests: set amt.sh executable · db54c12a
      Taehee Yoo authored
      
      
      amt.sh test script will not work because it doesn't have execution
      permission. So, it adds execution permission.
      
      Reported-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Fixes: c08e8bae
      
       ("selftests: add amt interface selftest script")
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Link: https://lore.kernel.org/r/20220105144436.13415-1-ap420073@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      db54c12a
    • Aaron Ma's avatar
      Revert "net: usb: r8152: Add MAC passthrough support for more Lenovo Docks" · 00fcf8c7
      Aaron Ma authored
      This reverts commit f77b83b5.
      
      This change breaks multiple usb to ethernet dongles attached on Lenovo
      USB hub.
      
      Fixes: f77b83b5
      
       ("net: usb: r8152: Add MAC passthrough support for more Lenovo Docks")
      Signed-off-by: default avatarAaron Ma <aaron.ma@canonical.com>
      Link: https://lore.kernel.org/r/20220105155102.8557-1-aaron.ma@canonical.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      00fcf8c7
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 49ef78e5
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
       "Here are two last fixes for this release cycle from the GPIO
        subsystem:
      
         - fix irq offset calculation in gpio-aspeed-sgpio
      
         - update the MAINTAINERS entry for gpio-brcmstb"
      
      * tag 'gpio-fixes-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        MAINTAINERS: update gpio-brcmstb maintainers
        gpio: gpio-aspeed-sgpio: Fix wrong hwirq base in irq handler
      49ef78e5
    • Jakub Kicinski's avatar
      Merge tag 'ieee802154-for-net-2022-01-05' of... · af872b69
      Jakub Kicinski authored
      Merge tag 'ieee802154-for-net-2022-01-05' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan
      
      Stefan Schmidt says:
      
      ====================
      pull-request: ieee802154 for net 2022-01-05
      
      Below I have a last minute fix for the atusb driver.
      
      Pavel fixes a KASAN uninit report for the driver. This version is the
      minimal impact fix to ease backporting. A bigger rework of the driver to
      avoid potential similar problems is ongoing and will come through net-next
      when ready.
      
      * tag 'ieee802154-for-net-2022-01-05' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan:
        ieee802154: atusb: fix uninit value in atusb_set_extended_addr
      ====================
      
      Link: https://lore.kernel.org/r/20220105153914.512305-1-stefan@datenfreihafen.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      af872b69
  3. Jan 05, 2022
  4. Jan 04, 2022
  5. Jan 03, 2022