summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2026-09-29pfcp: fix socket lifetime on netdevice registration failureXuanqiang Luo
pfcp_newlink() creates the UDP socket before register_netdevice(). If registration fails after pfcp_dev_init() succeeds, the core calls pfcp_dev_uninit(), which releases the socket and clears pfcp->sk. The newlink error path then releases it again, causing a NULL pointer dereference. This was observed with failslab fault injection: FAULT_INJECTION: forcing a failure. kobject: kobject_add_internal failed for pfcp0 (error: -12 parent: net) BUG: KASAN: null-ptr-deref in udp_tunnel_sock_release+0x1c/0x50 Read of size 8 at addr 0000000000000120 by task ip/1037 Call trace: show_stack+0x18/0x24 (C) dump_stack_lvl+0x78/0x90 print_report+0x468/0x5cc kasan_report+0xa4/0xf0 __asan_load8+0x7c/0xd0 udp_tunnel_sock_release+0x1c/0x50 pfcp_newlink+0x128/0x184 rtnl_newlink+0x848/0xe44 rtnetlink_rcv_msg+0x468/0x514 netlink_rcv_skb+0xc0/0x1f0 rtnetlink_rcv+0x18/0x24 netlink_unicast+0x4b8/0x558 netlink_sendmsg+0x2b8/0x584 ... Return from pfcp_del_sock() if pfcp->sk is NULL. Fixes: 76c8764ef36a5 ("pfcp: add PFCP module") Cc: stable@vger.kernel.org Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260924055252.33488-1-xuanqiang.luo@linux.dev Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selectionSelvin Xavier
Selecting between BNXT_RE_NUM_EXT_COUNTERS and BNXT_RE_NUM_STD_COUNTERS relied only on bnxt_qplib_is_chip_gen_p5_p7(), which doesn't account for the extended stats capability flag or the PF/VF restriction. Use bnxt_ext_stats_supported() instead, matching the check already used to populate the extended stats, so the counter count stays consistent with what gets filled in. Fixes: 8238c7bd8420 ("RDMA/bnxt_re: Fix the statistics for Gen P7 VF") Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-29RDMA/bnxt_re: Fix the PD and DPI table sizeSelvin Xavier
The PD and DPI bitmaps were sized as max >> 3 (bytes), but bitmap ops (set_bit(), clear_bit(), find_first_bit(), test_and_set_bit()) operate on whole unsigned long words, so whenever max isn't a multiple of BITS_PER_LONG, the buffer under-allocates and the top word's bitops read/write past the end of the kmalloc()'d buffer. Most exposed on the DPI table, since dpit->max comes from the firmware-reported dev_attr->max_dpi with no alignment guarantee. Fix the size of both allocations with BITS_TO_LONGS(max) * sizeof(unsigned long). Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-29RDMA/bnxt_re: Serialize dcb_wq access against async notifierSelvin Xavier
bnxt_re_async_notifier() runs in NAPI/softirq context via bnxt_en's RCU-protected ULP ops dispatch, never under rtnl_lock, so it isn't serialized against bnxt_re_uninit_dcb_wq() destroying rdev->dcb_wq. A concurrent notifier call can queue_work() on a workqueue that is being, or has just been, destroyed. Add a spinlock scoped to dcb_wq: the notifier takes it before checking dcb_wq and queuing work, and bnxt_re_uninit_dcb_wq() takes it to atomically clear dcb_wq before destroying it. Initialize the lock at rdev allocation so it is valid on every teardown path, including bnxt_re_dev_init()'s early failure labels. Fixes: 51dc5312dcd9 ("RDMA/bnxt_re: Add support to handle DCB_CONFIG_CHANGE event") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-29RDMA/bnxt_re: Initialize wqe.flags in bnxt_re_post_srq_recv()Selvin Xavier
wqe is declared once above the WR loop and never zeroed, so wqe.flags holds indeterminate stack contents on the first WR and the previous WR's stale value thereafter. This propagates straight into the hardware-visible srqe->flags in bnxt_qplib_post_srq_recv(). Most values of the wqe struct is set except flags. So initialize flags also. Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-29RDMA/bnxt_re: Validate SRQ max_sge at create timeSelvin Xavier
bnxt_re_create_srq() stored attr.max_sge into srq->qplib_srq.max_sge unvalidated, which defeats the num_sge check in bnxt_re_post_srq_recv() since that check compares against this same attacker-chosen value. Reject max_sge > dev_attr->max_srq_sges at create time, and clamp dev_attr->max_srq_sges to BNXT_STATIC_MAX_SGE since SRQ WQEs use the fixed-size SGE array. Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-29RDMA/bnxt_re: Detect wrong sge_len passed for inlineSelvin Xavier
Avoid handling wrong sge_len by adding extra check to see if the passed length is more than the inline size supported. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-29RDMA/bnxt_re: Fix integer overflow in send payload size computationSelvin Xavier
bnxt_re_build_sgl() summed SGE lengths into a signed int, which could overflow. Make it return u32, and have bnxt_re_copy_wr_payload() report the size via a u32 out-parameter with the return value carrying only the error status, instead of overloading a signed int with both. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-29eth: mpnic: add basic Rx handlingDaniel Zahka
A frame arrives as a run of completion descriptors: one header address/length descriptor, one address/length descriptor per payload page, and a metadata descriptor that closes the frame. The frame is assembled in an xdp_buff as the descriptors come in and handed to the stack when the metadata descriptor arrives. A page holds several frames, so rather than taking a reference per frame the driver takes a batch of references when it starts handing the page out and returns whatever is left over once the device moves on to the next one. Payload fragments that turn out to be contiguous within one page are merged so that a frame spread over a page does not eat one skb fragment slot per descriptor. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-8-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29eth: mpnic: implement Rx queue allocation and cleanupDaniel Zahka
The Rx side of a queue triad is a header queue, a payload queue and a completion queue. With HDS not active yet, frames are split between the two buffer queues at a fixed header boundary: everything up to 1536 bytes lands in the header page, the rest goes to the payload page. Small frames therefore never touch the payload queue, and several of them share one header page. The device is set to leave headroom and tailroom for XDP and skb_shared_info respectively. Both queues draw from one page pool per triad and post buffer descriptors to the device in batches. Even though we do not support XDP yet, use the XDP APIs for tracking pre-skb buffers. The XDP buffer handling helpers save us from reimplementing the same logic in the driver. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-7-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29eth: mpnic: add a netdevice and basic Tx handlingDaniel Zahka
Register the network interface and let it transmit skbs. The typical TWQ descriptor sequence for an skb is: 1 primary metadata, followed by 0 or more non-last address + length (A/L) descriptors, terminated by an always present last A/L descriptor. The device does not write a Tx completion unless it is requested in the primary metadata desc. The xmit path sets this bit when the stack does not report netdev_xmit_more(). This can create a problem if the last packet in a burst is dropped by the driver. To deal with that case, the driver latches the last metadata for which a completion was not requested, and uses this to request a completion and flush queued packets when one is dropped. There is no link state yet, so carrier follows the administrative state. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-6-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29eth: mpnic: start and stop the Tx HW queuesDaniel Zahka
Point the hardware at the descriptor rings and provide functions for turning the Tx queues on and off. Teardown has to wait for the DMA engines to go idle before the ring memory can be freed: disabling a queue only stops the device picking up new work, it does not tell us that the work already fetched has been retired. Each block exposes an idle bitmap per queue, and every one of the four blocks a packet passes through on its way out has to report idle before the descriptors are safe to free. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-5-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29eth: mpnic: implement Tx queue allocation and cleanupDaniel Zahka
Queues come in triads of two work queues and one completion queue. The Tx triad only uses the first work queue for now, the second one will be used for the XDP ring later. Add the ring structures, the per NAPI vector allocation of triads, descriptor memory and interrupts, and the completion processing. The completion queue does not report one entry per packet, it reports a work queue head, so a single completion can release many packets. Nothing enables the queues in hardware or submits anything to them yet, that comes with the next two changes. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-4-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29eth: mpnic: allocate MSI-X vectorsDaniel Zahka
Request one vector for FW generated interrupts and then one vector per CPU to use for the completion queues. Nothing requests a handler yet, that comes with the NAPI vectors. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-3-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29eth: mpnic: add register init for the deviceMohsin Bashir
Perform one time register initialization during mpnic_probe(). These CSR settings are either static configs that only need to be set once, or pulses for zeroizing on chip SRAMs, which also only need to be done once. This initialization is idempotent and does not require any matching deinitialization in the remove path. We can unbind and re-bind the driver and perform the same initialization without problems. Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-2-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29eth: mpnic: add scaffolding for Meta Platforms NICDaniel Zahka
MPNIC is the next network interface controller designed by Meta. Create a bare PCI driver for it. Subsequent changes will flesh it out. Registers live in BAR0 and are addressed as an array of 32 bit words, which is why the CSR indices are a quarter of the byte offset. Most of the register file is only accessible as 64 bit, so that is the only accessor added here. If a read returns all ones, a second read to an unused register with reset value 0 is performed to determine if the device is gone. If the device is gone, the mapped BAR0 pointer is cleared, so no further accesses reach the bus. For now, if mpnic_mmio_err() clears mpd->uc_addr0, nothing will reassign it. The user will have to unbind and rebind the driver. Future series will reset uc_addr0 from pci error handlers. In addition to being used as a 0 value reference CSR, MPNIC_BDQ_SPARE is also used to perform write flushes, because it can be read without producing side effects. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-1-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-29soc: renesas: Kconfig: Enable ICU support for RZ/G3E and RZ/V2NLad Prabhakar
Explicitly select the RZ/V2H ICU driver for RZ/G3E and RZ/V2N, as GPIO and IRQ interrupts are routed through the ICU block on these SoCs. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260925224927.14951-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-09-29drm/i915/display: Update the CMN_SDP_TL in fastset pathAnkit Nautiyal
Commit bfa597238073 ("drm/i915/dip: Enable Common SDP Transmission line") enabled the CMN_SDP_TL for the modeset path, but missed to add it to the fastset path. Since dip.cmn_sdp_tl is already skipped from the strict pipe-config comparison during fastsets, it was always intended to get updated without full modeset, but the update to the register was missed. During a fastset, if CMN_SDP_TL changes, update the register similar to the EMP_AS_SDP_TL, which gets updated in intel_vrr_set_transcoder_timings(). v2: Update cmn_sdp_changed() to also compare gmp_sdp_tl, pps_sdp_tl and vsc_ext_sdp_tl, not just cmn_sdp_tl. (Sashiko) Fixes: bfa597238073 ("drm/i915/dip: Enable Common SDP Transmission line") Cc: Suraj Kandpal <suraj.kandpal@intel.com> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patch.msgid.link/20260924021950.350207-1-ankit.k.nautiyal@intel.com
2026-09-29wifi: nxpwifi: fix return value check in change_vif_to_sta/apJeff Chen
nxpwifi_change_vif_to_sta() and nxpwifi_change_vif_to_ap() both call nxpwifi_set_bss_mode() without storing the return value, then check 'if (ret)' which tests the stale value from the previous call. The 'if (ret) goto done' is therefore dead code, and errors from nxpwifi_set_bss_mode() are silently ignored. Fix this by assigning the return value to ret, so the existing error path works correctly. Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x") Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/linux-wireless/anwqp-LuExbRshYu@stanley.mountain/ Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
2026-09-29wifi: nxpwifi: Limit channel width based on firmware capabilityJeff Chen
nxpwifi_cmd_append_11n_tlv() derived the channel width solely from the AP's advertised operating bandwidth and could request 40/80 MHz operation even when the firmware did not support it. On 20 MHz-only devices such as IW610, this may cause the firmware to be configured with an unsupported channel width. Check firmware bandwidth capabilities before selecting the channel width: - Allow 80 MHz only when ISSUPP_NO_80MHZ() is false. - Allow 40 MHz only when ISSUPP_40MHZ_ENABLED() is true. - Otherwise fall back to 20 MHz operation. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
2026-09-29wifi: nxpwifi: Add support for SDIO-based IW610Jeff Chen
Add the IW610 SDIO device ID to the supported device table. This enables driver probing, interface initialization, and firmware download for the NXP IW610 wireless chipset. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
2026-09-29mmc: core: add NXP IW610 base ID and block size quirkJeff Chen
The NXP IW610 SDIO chipset identifies itself with a base card ID (0x0214) during the initial MMC bus scan, whereas the WLAN function reports a different ID (0x0215). Like the IW61x, the IW610 requires MMC_QUIRK_BLKSZ_FOR_BYTE_MODE for correct byte-mode block size handling. Since SDIO fixups are applied before function devices are enumerated, the quirk must be associated with the base card ID rather than the WLAN function ID. Add the SDIO_DEVICE_ID_NXP_IW610_BASE definition and apply the required fixup in the SDIO quirk table. Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com> Acked-by: Ulf Hansson <ulfh@kernel.org>
2026-09-28swim3: Fix FDEJECT ioctl for exclusive openFinn Thain
The eject command from the util-linux package does not work with the swim3 driver: the drive doesn't eject anything and the command fails. Apparently, ioctl(fd, FDEJECT) returns -EBUSY after fd was opened O_EXCL. Fix this by checking ref_count for either 1 or -1. Either value means that the caller is the sole user of the disk. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@linux-m68k.org> Link: https://patch.msgid.link/f4cb43726ee6f1cf159a6208f77b4cceea670a3c.1790641175.git.fthain@linux-m68k.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-09-28swim: Fix FDEJECT ioctl for exclusive openFinn Thain
The eject command from the util-linux package does not work with the swim driver: the drive doesn't eject anything and the command fails. Apparently, ioctl(fd, FDEJECT) returns -EBUSY when fd is opened O_EXCL. Fix this by checking ref_count for either 1 or -1. Either value means that the caller is the sole user of the disk. Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support") Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@linux-m68k.org> Link: https://patch.msgid.link/ae3ee8e86833a2739d7857460cbe2addf4146088.1790641175.git.fthain@linux-m68k.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-09-28swim: Return -EROFS when opened with BLK_OPEN_WRITE flagFinn Thain
Write requests are not supported by the driver and produce IO errors as shown below. Avoid this by returning -EROFS when opened for writing. [ 4111.690000] I/O error, dev fd0, sector 2 op 0x1:(WRITE) flags 0x800800 phys_seg 1 prio class 2 [ 4111.700000] Buffer I/O error on dev fd0, logical block 2, lost async page write Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support") Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@linux-m68k.org> Link: https://patch.msgid.link/327be6ca3c92c3411b5dfaeede014ed65a2d0f0f.1790641175.git.fthain@linux-m68k.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-09-28net: stmmac: fix rx Scatter-Gather supportLorenzo Bianconi
When a received frame is larger than dma_buf_sz, the DMA scatters it across multiple RX descriptors (rx Scatter-Gather). The secondary RX buffer (sec_page) was only allocated and programmed when split-header (SPH) was active, so for regular frames buffer2 was neither allocated nor backed by a valid mapping. As soon as an incoming frame overflowed buffer1, the DMA wrote the overflow into the unmapped secondary-buffer address, triggering an SMMU translation fault on IOMMU-based platforms: arm-smmu 15000000.iommu: Unhandled context fault: fsr=0x402, iova=0x00000000, fsynr=0x7f0011, cbfrsynra=0x1c90, cb=11 arm-smmu 15000000.iommu: FSR = 00000402 [Format=2 TF], SID=0x1c90 arm-smmu 15000000.iommu: FSYNR0 = 007f0011 [S1CBNDX=127 WNR PLVL=1] Enable scatter-gather for non-SPH frames on cores that can program an independent secondary RX buffer (GMAC4/XGMAC): allocate and mark buffer2 as valid in stmmac_init_rx_buffers() and stmmac_rx_refill(), and account for it in the buffer length computation. Legacy cores have no set_sec_addr op, so they keep buffer2 disabled. Since buffer2 is handed to the DMA at page offset 0, the page pool sync window is widened to cover both buffers in every mode: offset is set to 0 and max_len to dma_buf_sz + stmmac_rx_offset(). The FCS can straddle the buffer1/buffer2 boundary and a descriptor boundary, so it is now stripped from the tail of the assembled frame with pskb_trim() instead of from a single buffer, avoiding an unsigned underflow for frames that overflow a buffer by 1..3 bytes. For single-buffer frames the XDP program must not see the FCS, so it is removed from the XDP buffer before the program runs. Native XDP currently only supports single-buffer (linear) frames. An oversized frame accepted by the MAC (jumbo enabled) is received via buffer2; the XDP program only sees buffer1, so on a TX/REDIRECT verdict the frame is forwarded truncated. XDP multi-buffer support to handle this case is planned as a follow-up. AF_XDP zero-copy RX is not covered by this change: a ZC queue still programs buffer2 at DMA address 0 (and XGMAC has no buffer2-valid bit), so an oversized frame overflowing buffer1 can still trigger the same SMMU translation fault. Handling is planned as a follow-up. Fixes: 88ebe2cf7f3f ("net: stmmac: Rework stmmac_rx()") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260923-stmmac-rx-sg-fix-v3-1-ed26fea7180d@oss.qualcomm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28octeontx2-af: mcs: Fix SC resource cleanup loopBaha Mesleh
The SC resource cleanup and statistics loops were incorrectly iterating over secy.max instead of sc.max, so the highest SC id could be left allocated across teardown or FLR. Use sc.max as the loop bound. Fixes: cfc14181d497 ("octeontx2-af: cn10k: mcs: Manage the MCS block hardware resources") Signed-off-by: Baha Mesleh <baha.mesleh@nokia.com> Signed-off-by: Subrat Pandey <subratp@marvell.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260922102149.2078168-3-subratp@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28octeontx2-pf: Fix aura BPID assignment when CONFIG_DCB is enabledGeetha sowjanya
Previously, BPID assignment under CONFIG_DCB assumed `queue_to_pfc_map` was always initialized. For SDP VFs this leads to invalid memory access as it was not initialized. This patch adds a NULL check for `queue_to_pfc_map` before dereferencing it. Also, simplifies the logic by always assigning a default BPID first, then conditionally overriding it if CONFIG_DCB is enabled and the map exists. Fixes: 184fb40f731b ("octeontx2-pf: Avoid adding dcbnl_ops for LBK and SDP vf") Signed-off-by: Geetha sowjanya <gakula@marvell.com> Signed-off-by: Subrat Pandey <subratp@marvell.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260922102149.2078168-2-subratp@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28Merge tag 'for-net-2026-09-28' of ↵Jakub Kicinski
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: Core: - hci_core: Serialize ACL scheduling with channel deletion - hci_core: Serialize SCO and ISO scheduling with teardown - hci_core: Serialize fragmented ISO packet queueing - hci_core: Fix inquiry cache timestamps on 64-bit systems - hci_core: free the HCI ID if naming fails - hci_conn: Lock parent access during enhanced SCO setup - hci_sync: Fix inquiry cache use-after-free - hci_sync: don't drain cmd_sync backlog on unregister - RFCOMM: Fix initial port reference race - SMP: Serialize SMP remote OOB data access Drivers: - btintel: fix buffer over-read in btintel_hw_error() - btintel: validate DDC record lengths - btintel_pcie: fix plen overflow in btintel_pcie_recv_frame() - btintel_pcie: reject oversized TX packets in send_frame() * tag 'for-net-2026-09-28' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: hci_core: Serialize SCO and ISO scheduling with teardown Bluetooth: hci_core: Serialize ACL scheduling with channel deletion Bluetooth: Serialize SMP remote OOB data access Bluetooth: RFCOMM: Fix initial port reference race Bluetooth: hci_sync: Fix inquiry cache use-after-free Bluetooth: hci_sync: don't drain cmd_sync backlog on unregister Bluetooth: hci_core: Serialize fragmented ISO packet queueing Bluetooth: hci_conn: Lock parent access during enhanced SCO setup Bluetooth: btintel: validate DDC record lengths Bluetooth: hci_core: free the HCI ID if naming fails Bluetooth: hci_core: Fix inquiry cache timestamps on 64-bit systems Bluetooth: btintel_pcie: reject oversized TX packets in send_frame() Bluetooth: btintel_pcie: fix plen overflow in btintel_pcie_recv_frame() Bluetooth: btintel: fix buffer over-read in btintel_hw_error() ==================== Link: https://patch.msgid.link/20260928152919.942973-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28x86/boot: Move unaccepted memory handling out of the decompressorArd Biesheuvel
arch_accept_memory() is an arch-specific hook that is required by the EFI stub when processing memory that the firmware reports to the OS as EFI_UNACCEPTED_MEMORY. This hook is called after ExitBootServices() has been called, as before that point, the EFI memory map may get updated behind the back of the running EFI stub, making it difficult to get a stable view on it while iterating over the entries. Currently, the x86 version of this hook is implemented in its decompressor rather than in the EFI stub itself, in a manner that is problematic: when an error occurs, it calls the decompressor's error() routine, but without having gone through the decompressor initialization code. This means it will resort to direct port I/O rather than the hypercall based interface that TDX guests would use otherwise. Conceptually, code that is only called from the EFI stub, and never by the decompressor when doing legacy boot, belongs in the EFI stub and not in the decompressor. So move it into the x86-specific EFI stub code, replacing the error() on the TDX path with tdx_panic(), and dropping the error() when no CC support is detected - the kernel can decide what to do in this case after it has booted. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org> Link: https://patch.msgid.link/20260925075137.44298-7-ardb@kernel.org
2026-09-28net/mlx5: Fix slab-out-of-bounds when handling team device eventsAnirudh Virdi
The mlx5_handle_changeupper_event() and mlx5_handle_changeinfodata_event() functions check for LAG masters (which includes both bonding and team devices) but only call bonding-specific APIs. When processing team device events, calling bond_slave_get_rcu() and bond_is_slave_inactive() on team_port structures causes KASAN to detect an out-of-bounds memory access since team_port is smaller than bond slave. Fix this by wrapping the bond-specific API calls with a check for bonding devices. This allows the function to still process LAG events for both bonding and teams but only calls bond-specific functions when dealing with actual bonding devices. For mlx5_handle_changeinfodata_event(), keep the explicit bond check as mlx5 doesn't handle state information for team ports anyway. Tested with Mellanox ConnectX-5 on Linux 7.2.0-rc6: - Bonding: PASS (no regressions) - Team device: PASS (no KASAN errors) Fixes: 54493a08e21f ("net/mlx5: Lag, record inactive state of bond device") Suggested-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Anirudh Virdi <avirdi@redhat.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/20260924064244.94045-1-avirdi@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: E-switch, disable host functions for a non PF e-switch managerShay Drory
mlx5_esw_host_functions_enabled() only treated host functions as disabled for an ECPF manager. To support a non PF acting as an e-switch manager, add a check for a non PF e-switch manager that treats host functions as disabled. This will avoid allocating a host-PF vport in mlx5_esw_vports_init(). With host functions disabled for non PF, its e-switch is the expected manager + uplink only. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-14-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: E-switch, correct stale VF/PF wording in esw-allowed commentsShay Drory
mlx5_esw_hold() and mlx5_eswitch_unblock_ipsec() bail out on !mlx5_esw_allowed(), and their comments explained that as "a VF has no eswitch" / "core dev is not a PF". New FW will let a VF act as a nested e-switch manager - such a VF has an eswitch and passes mlx5_esw_allowed() - so that equivalence no longer holds. Reword the comments to describe the actual condition, the device is not an e-switch manager, with no functional change. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-13-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: LAG, drop stale esw_shared_ingress_acl gate from shared FDBShay Drory
The shared-FDB support check still requires the esw_shared_ingress_acl capability. That capability backed the merged uplink ingress ACL, where the slave uplink's ingress-ACL root was pointed at the master's (esw_set_uplink_slave_ingress_root()). That handling was removed in commit 82e86a6c7109 ("net/mlx5: E-switch, remove special uplink ingress ACL handling") once both uplinks were tagged with the same reserved metadata (MLX5_ESW_METADATA_RSVD_UPLINK) - a single FDB rule then matches traffic from either uplink, with no shared ingress ACL involved. The capability check was left behind and has been dead since: the driver programs no shared ingress ACL, yet the check still keeps otherwise shared-FDB-capable devices out of shared FDB. Drop it. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-12-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: LAG, don't print port mapping to debugfs in MPESW modeShay Drory
The mapping debugfs file dumps the LAG virtual-to-physical port mapping. In MPESW mode the LAG does not own that mapping - port selection is driven by user steering rules, not by the LAG - so the dumped values are meaningless. Treat MPESW as if LAG is inactive and don't print anything to the user. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-11-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: E-switch, derive manager vport from device capabilityShay Drory
mlx5_eswitch_manager_vport() hardcoded the e-switch manager vport as either the ECPF or the host PF. Read esw_manager_vport_number from the e-switch capability when esw_manager_vport_number_valid is set, so the manager vport can be a VF - a prerequisite for VFs acting as e-switch managers. Keep the previous mapping as fallback when the capability does not report a number. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-10-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5e: TC, track peer flows in a vhca_id xarrayShay Drory
The per-peer reverse index lived in a fixed esw->offloads.peer_flows[] array of list heads indexed by the peer's LAG sequence number, capping a shared FDB at MLX5_MAX_PORTS members. Replace the array with an xarray keyed by the peer vhca_id. Each entry is a heap-allocated list head that chains the flows duplicated to that peer via their peer node. This lifts the MLX5_MAX_PORTS cap: the number of peers is bounded only by the number of distinct vhca_ids. The lifetime of the duplicated peer flows list_head follows the devcom pairing of the two eswitches: - pair (mlx5_esw_offloads_pair): kzalloc_obj + INIT_LIST_HEAD + xa_store the dup_peer_flows under the peer's vhca_id. - add (mlx5e_tc_add_fdb_peer_flow): xa_load the dup_peer_flows and list_add the duplicated flow's peer node. - del (mlx5e_tc_del_fdb_peer_flow): list_del that node. - flush (mlx5e_tc_clean_fdb_peer_flows): xa_for_each dup_peer_flows, drop every duplicated flow on it; called from unpair. - unpair (mlx5_esw_offloads_unpair): xa_erase + kfree the dup_peer_flows. So a dup_peer_flows is created when the local eswitch pairs with a peer over devcom and freed when they unpair. No functional change. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-9-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5e: TC, anchor peer-flow reverse index on the duplicated flowShay Drory
A TC eswitch flow offloaded to a shared FDB is duplicated onto every peer eswitch. Besides the forward list of duplicates on the origin flow (mlx5e_tc_flow.peer_flows), the eswitch keeps a reverse index, esw->offloads.peer_flows[], an array of per-peer list heads keyed by the peer's LAG sequence number, used to tear down a peer's duplicates when it is removed. That reverse index was anchored on the origin: since one origin can have a duplicate on every peer, the origin carried per-peer storage sized to the max port count - a peer[MLX5_MAX_PORTS] array of list nodes plus a peer_used bitmap - and each duplicate stored its peer_index. Anchor it on the duplicate instead, which belongs to a single peer. Give each flow one list node, mlx5e_tc_flow.peer, and place the duplicate - not the origin - on its peer's list through it; add a peer_orig back-ref so del can reach the origin from the duplicate. One node then replaces the origin's per-peer array, and del unlinks the duplicate directly, so peer[], peer_used and peer_index are dropped. The per-peer list heads remain the fixed esw->offloads.peer_flows[] array keyed by the LAG sequence number - that array is replaced in the next patch. No functional change. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-8-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: LAG, size debugfs buffers by port countShay Drory
debugfs mapping_show() uses constant MLX5_MAX_PORTS to size ports array. Instead, allocate dynamically using actual number of ports. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-7-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: LAG, drop per-port scratch array in drop-rule setupShay Drory
mlx5_lag_drop_rule_setup() walks the per-port tracker state, but does so through a per-port scratch array, mlx5_lag_drop_rule_setup() collects the disabled ports to create a per-port drop rule. Walk the tracker state inline removing its MLX5_MAX_PORTS dependency. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-6-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: LAG, allocate port-indexed scratch buffers dynamicallyShay Drory
mlx5_lag_print_mapping(), mlx5_infer_tx_affinity_mapping() and lag_active_port_bits() each used a MLX5_MAX_PORTS-sized stack buffer to hold per-port working state. Allocate these buffers with kcalloc(ldev->ports, ...) instead so they track the actual port count and no longer depend on MLX5_MAX_PORTS. lag_active_port_bits() can now fail on allocation, so it returns int and propagates -ENOMEM; a non-negative return is the active-port bitmask as before. Its two callers, mlx5_cmd_create_lag() and _mlx5_modify_lag(), check for a negative return and bail out, then narrow the value back into the u8 they hand to the device. This removes these buffers' dependency on MLX5_MAX_PORTS. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-5-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: LAG, allocate v2p_map dynamicallyShay Drory
v2p_map was a fixed array sized MLX5_MAX_PORTS * MLX5_LAG_MAX_HASH_BUCKETS embedded in struct mlx5_lag. Turn it into a pointer allocated in mlx5_lag_dev_alloc() once ldev->ports is known, sized by the actual port count, and free it in mlx5_ldev_free(). The ldev->ports / ldev->buckets initialization is moved up so the allocation can use it. The matching scratch buffer in mlx5_modify_lag() is converted from a MLX5_MAX_PORTS-sized stack array to a kcalloc() of the same extent, with the trailing teardown reworked through a goto so the buffer is freed on every path. The memcpy() that previously relied on sizeof() of the stack array now uses the explicit ldev->ports * MLX5_LAG_MAX_HASH_BUCKETS span. No functional change; this removes v2p_map's dependency on MLX5_MAX_PORTS. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-4-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5: E-switch, do not leave an unpaired devcom registeredShay Drory
If the initial PAIR event fails, the eswitch offloads devcom component stays registered until eswitch teardown even though no peer was ever paired. devcom is optional, so this is not a functional bug - but a registered component that reflects no actual pairing is incorrect state to keep around. Release it when the initial pairing fails. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-3-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net/mlx5e: Assign a random MAC to any netdev with a zero MAC addressShay Drory
mlx5e_set_netdev_dev_addr() falls back to a random MAC only when the queried address is all-zeros AND the device is not a vport group manager. A vport group manager that comes up with a zero MAC is therefore left with an invalid all-zero address. The vport_group_manager exception is unnecessary: a zero MAC is always invalid, regardless of device type. Drop the condition and assign a random MAC whenever the queried address is zero, so every netdev comes up with a valid address. Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260923103830.1183-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net: systemport: Fix inverted error messages in bcm_sysport_stop()Florian Fainelli
In bcm_sysport_stop(), the error messages printed when tdma_enable_set() and rdma_enable_set() time out were inverted: the failure of tdma_enable_set() logged 'timeout disabling RDMA' and the failure of rdma_enable_set() logged 'timeout disabling TDMA'. Swap the error messages so they correctly describe the failing engine. Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260922232440.598918-9-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net: systemport: Fix Wake-on-LAN RXCHK filter enable loopFlorian Fainelli
In bcm_sysport_suspend_to_wol(), the loop enabling programmed RXCHK filters in RXCHK_CONTROL used an auxiliary counter 'i' instead of the actual set filter index 'index'. When non-contiguous filters were configured (for example, if filter 0 was deleted and filter 1 remained), the code would enable bit (RXCHK_BRCM_TAG_MATCH_SHIFT + 0) corresponding to filter 0 rather than filter 1, causing Wake-on-LAN filter matching to fail. Fix this by using the filter 'index' to set the appropriate match bit in RXCHK_CONTROL. Cc: stable+noautosel@kernel.org # never worked Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260922232440.598918-5-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net: systemport: Fix NULL pointer dereference in bcm_sysport_fini_rx_ring()Florian Fainelli
If allocation of priv->rx_cbs fails during bcm_sysport_init_rx_ring(), error unwinding in bcm_sysport_open() calls bcm_sysport_fini_rx_ring(). Without checking if priv->rx_cbs is non-NULL, bcm_sysport_fini_rx_ring() dereferences priv->rx_cbs, resulting in a NULL pointer dereference. Add a check for !priv->rx_cbs at the beginning of bcm_sysport_fini_rx_ring(), matching bcm_sysport_fini_tx_ring(). Cc: stable+noautosel@kernel.org # unlikely driver error path Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260922232440.598918-4-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net: systemport: Fix RUNT MIB counter register offset calculationFlorian Fainelli
In UniMAC hardware, there is a 0xC byte gap between the RX MIB counters and the TX MIB counters, and a second 0xC byte gap between the TX MIB counters and the RX RUNT MIB counters. In bcm_sysport_update_mib_counters(), 'offset' was only set to UMAC_MIB_STAT_OFFSET (0xC) for all non-RX counters, omitting the second 0xC gap for BCM_SYSPORT_STAT_RUNT counters. As a result, all 4 RUNT MIB counters were read from unmapped gap register space. Fix this by setting offset to 2 * UMAC_MIB_STAT_OFFSET (0x18) when reading BCM_SYSPORT_STAT_RUNT counters. Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver") Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260922232440.598918-6-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net: systemport: Fix buffer overflow in bcm_sysport_get_stats()Florian Fainelli
When running on SYSTEMPORT Lite, certain statistics are unsupported and skipped during bcm_sysport_get_stats(). The variable 'j' tracks the compacted index into the destination data buffer, whereas 'i' iterates over all elements in bcm_sysport_gstrings_stats. Because the buffer allocated by ethtool is sized only according to bcm_sysport_get_sset_count(), storing values at data[i] instead of data[j] writes past the allocated array bounds, leading to memory corruption. Fix this by writing to data[j] instead of data[i]. Fixes: 10377ba7673d ("net: systemport: Support 64bit statistics") Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260922232440.598918-2-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-28net: bcmasp: remove duplicate MDA filter register definitionsFlorian Fainelli
Remove the redundant duplicate definitions of ASP_RX_FILTER_MDA_CFG, ASP_RX_FILTER_MDA_PAT_H, ASP_RX_FILTER_MDA_PAT_L, ASP_RX_FILTER_MDA_MSK_H, and ASP_RX_FILTER_MDA_MSK_L in bcmasp.h. Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Link: https://patch.msgid.link/20260922222525.3992167-3-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>