Changelog in Linux kernel 5.15.216

 
ALSA: 6fire: Fix UAF at error handling during probe [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Sun Jul 26 09:48:19 2026 +0200

    ALSA: 6fire: Fix UAF at error handling during probe
    
    commit a54bf16965f896415c3337bc4fbb40fb11941d99 upstream.
    
    Although 6fire driver had a few fixes for dealing with the early error
    handling during the probe phase, it forgot a pending URB before
    freeing the resources, which may lead to a UAF.
    
    This patch addresses it by doing the almost same cleanup procedure
    like the normal disconnect phase at the error path.
    
    Reported-and-tested-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
    Closes: https://lore.kernel.org/20260724030900.1984491-1-shuangpeng.kernel@gmail.com
    Cc: <stable@vger.kernel.org>
    Link: https://patch.msgid.link/20260726074821.2288158-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: lx6464es: fix period byte count for 16-bit streams [+ + +]
Author: Xu Rao <raoxu@uniontech.com>
Date:   Thu Jul 23 16:57:10 2026 +0800

    ALSA: lx6464es: fix period byte count for 16-bit streams
    
    commit 6437033bffe8bd2af174d139af552d90d40c7ac6 upstream.
    
    The lx6464es driver advertises both 16-bit and packed 24-bit PCM formats,
    but lx_trigger_start() and lx_interrupt_request_new_buffer() calculate the
    DMA period size as runtime->period_size * runtime->channels * 3.  That is
    only correct for the packed 24-bit formats.
    
    For 16-bit streams the driver submits buffers that are 50% larger than the
    actual ALSA period and advances the DMA address by the same wrong amount.
    For example, with 2 channels, 256 frames and 4 periods, the third buffer
    already extends beyond the ALSA buffer and the fourth buffer starts outside
    it.
    
    Use snd_pcm_lib_period_bytes() so the byte count matches the runtime
    format, channel count and period size.
    
    Fixes: 02bec4904508 ("ALSA: lx6464es - driver for the digigram lx6464es interface")
    Cc: stable@vger.kernel.org
    Signed-off-by: Xu Rao <raoxu@uniontech.com>
    Link: https://patch.msgid.link/8BB12E8D92A7CDBA+20260723085710.2567463-1-raoxu@uniontech.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: pcm: wake linked drain waiters on unlink [+ + +]
Author: Norbert Szetei <norbert@doyensec.com>
Date:   Tue Jul 28 14:50:01 2026 +0200

    ALSA: pcm: wake linked drain waiters on unlink
    
    commit f495b6c4c8594122918552c9be2b51eb71647cd9 upstream.
    
    snd_pcm_drain() on a linked stream parks an on-stack wait entry on the
    drained peer's runtime->sleep, and after schedule_timeout() removes it
    only if that peer is still found in the caller's group.  If group
    membership changes during the wait and the sleep ends by signal or
    timeout (so autoremove_wake_function() does not run), finish_wait() is
    skipped and snd_pcm_drain() returns with the entry still queued on that
    stream's sleep list; a later wake_up() then walks a freed stack frame.
    This is reachable by unlinking either the drained or the draining stream.
    
    Unlike the close path (snd_pcm_drop() -> snd_pcm_post_stop()),
    snd_pcm_unlink() never wakes the sleep queues.  Wake every group member
    under the group lock before the membership change, so a linked drainer is
    released and drops its entry while the streams are still grouped.
    
    The window was opened when snd_pcm_link_rwsem stopped being held across
    the wait and the removal became conditional on group membership (see
    Fixes). The later switch to finish_wait() kept that conditional removal,
    so the signal/timeout case remained.
    
    Fixes: f57f3df03a8e ("ALSA: pcm: More fine-grained PCM link locking")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-5
    Signed-off-by: Norbert Szetei <norbert@doyensec.com>
    Link: https://patch.msgid.link/A0705100-D10B-4286-9980-0142ABEEAD51@doyensec.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: usb-audio: Clamp frame size in implicit-feedback mode [+ + +]
Author: Sonali Pradhan <sonalipradhan@google.com>
Date:   Tue Jul 28 20:24:32 2026 +0000

    ALSA: usb-audio: Clamp frame size in implicit-feedback mode
    
    commit 8d7a30c50c2e58a6839634ed0acde14466d1dc61 upstream.
    
    snd_usb_handle_sync_urb() scales received sync packet sizes by the sender's
    stride and stores the result directly in out_packet->packet_size[i]. If a
    connected USB device sends an oversized sync packet, this frame count can
    exceed ep->maxframesize.
    
    The un-clamped frame count then propagates to the playback endpoint queue,
    potentially driving packet transfers beyond the endpoint's hardware frame
    limits.
    
    Cap the calculated frame count against ep->maxframesize in
    snd_usb_handle_sync_urb() to prevent oversized packets from entering the
    playback queue.
    
    Fixes: 28acb12014fb ("ALSA: usb-audio: use sender stride for implicit feedback")
    Cc: stable@vger.kernel.org
    Assisted-by: Jetski:Gemini-3.6-Flash
    Signed-off-by: Sonali Pradhan <sonalipradhan@google.com>
    Link: https://patch.msgid.link/20260728202432.2354994-1-sonalipradhan@google.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: usb-audio: Fix DMA buffer out-of-bounds write when fill_max is set [+ + +]
Author: Sonali Pradhan <sonalipradhan@google.com>
Date:   Tue Jul 28 20:17:16 2026 +0000

    ALSA: usb-audio: Fix DMA buffer out-of-bounds write when fill_max is set
    
    commit d0199ae1666ff9ae2d1d568d64c3430d4c47f0e5 upstream.
    
    When a USB audio endpoint requests full packet transfers via the fill_max
    descriptor flag, data_ep_set_params() promotes ep->curpacksize to
    ep->maxpacksize. However, maxsize is left at the original sample-rate
    derived value.
    
    Since u->buffer_size is allocated as maxsize * packets, the resulting
    DMA buffer is far too small for the requested transfer length. When the
    USB host controller streams up to curpacksize bytes per packet, it writes
    past the end of the buffer via DMA, corrupting kernel heap memory.
    
    Update maxsize to curpacksize when fill_max is set so that the allocated
    DMA buffer size matches the actual transfer request size.
    
    [ changed to reassign maxsize only when ep->fill_max is set -- tiwai ]
    
    Fixes: 8fdff6a319e7 ("ALSA: snd-usb: implement new endpoint streaming model")
    Cc: stable@vger.kernel.org
    Assisted-by: Jetski:Gemini-3.6-Flash
    Signed-off-by: Sonali Pradhan <sonalipradhan@google.com>
    Link: https://patch.msgid.link/20260728201716.2347726-1-sonalipradhan@google.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: usb-audio: fix OOB write in snd_usbmidi_akai_output() [+ + +]
Author: Baul Lee <baul.lee@xbow.com>
Date:   Sun Jul 26 16:45:00 2026 +0900

    ALSA: usb-audio: fix OOB write in snd_usbmidi_akai_output()
    
    commit 0970274613fb463d376211450cab066d34ebfe6a upstream.
    
    snd_usbmidi_akai_output() computes its fill-loop bound
    
            buf_end = ep->max_transfer - MAX_AKAI_SYSEX_LEN - 1;
    
    as a signed int, so a small device-advertised bulk-OUT max_transfer
    makes buf_end negative.  The loop guard then compares the u32
    urb->transfer_buffer_length against that negative int: the usual
    arithmetic conversion turns buf_end into a large unsigned value, so the
    guard stays true and each iteration keeps appending SysEx framing and
    payload bytes past the end of the URB transfer buffer, which is only
    max_transfer bytes long.
    
    A USB device that advertises a tiny bulk-OUT endpoint can therefore
    trigger an attacker-length- and content-controlled heap out-of-bounds
    write when a process writes to the created /dev/snd/midiC*D* node.
    
    Return early when there is no room for even one SysEx, so the loop is
    never entered with a bound that would wrap.  The loop is the last
    statement of the function, so bailing out is equivalent to it not
    running.
    
    Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
    
    Fixes: 4434ade8c933 ("ALSA: usb-audio: add support for Akai MPD16")
    Suggested-by: Takashi Iwai <tiwai@suse.de>
    Reported-by: Federico Kirschbaum <federico.kirschbaum@xbow.com>
    Reported-by: Baul Lee <baul.lee@xbow.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Baul Lee <baul.lee@xbow.com>
    Link: https://patch.msgid.link/20260726074500.50145-1-baul.lee@xbow.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: usb-audio: fix OOB write on Type II inbound URBs [+ + +]
Author: Baul Lee <baul.lee@xbow.com>
Date:   Wed Aug 5 10:34:41 2026 +0900

    ALSA: usb-audio: fix OOB write on Type II inbound URBs
    
    commit 69ee44e1a23be62318189dc4b37fa4ad94053269 upstream.
    
    data_ep_set_params() sizes each URB transfer buffer before it adds the
    Format Type II transfer delimiter:
    
            u->packets = urb_packs;
            u->buffer_size = maxsize * u->packets;
    
            if (fmt->fmt_type == UAC_FORMAT_TYPE_II)
                    u->packets++; /* for transfer delimiter */
            u->urb = usb_alloc_urb(u->packets, GFP_KERNEL);
    
    buffer_size is computed from the pre-increment packet count and never
    recomputed, so for a Type II endpoint the buffer is one packet short of
    the packet count the URB is built with.
    
    prepare_inbound_urb() then lays out one iso frame per packet and never
    consults buffer_size:
    
            offs = 0;
            for (i = 0; i < urb_ctx->packets; i++) {
                    urb->iso_frame_desc[i].offset = offs;
                    urb->iso_frame_desc[i].length = ep->curpacksize;
                    offs += ep->curpacksize;
            }
    
            urb->transfer_buffer_length = offs;
            urb->number_of_packets = urb_ctx->packets;
    
    The last descriptor therefore points one packet past the end of the
    transfer buffer, where the host controller writes device data on every
    inbound transfer.  prepare_silent_urb() and prepare_playback_urb() bound
    their fill loops by ctx->buffer_size, so only capture is affected.
    
    fmt_type comes from the device's audio streaming descriptors, so any
    device advertising a Type II capture format hits this once userspace sets
    hw_params on the stream.
    
    KASAN on 7.2.0-rc5 (arm64) with a dummy_hcd/raw-gadget device, one report
    per inbound transfer:
    
      BUG: KASAN: slab-out-of-bounds in dummy_timer
      Write of size 64 at addr ffff0000186171c0 by task cons02/166
       __asan_memcpy
       dummy_timer
       hrtimer_run_softirq
      Allocated by task 166:
       usb_alloc_coherent
       snd_usb_endpoint_set_params
      The buggy address is located 0 bytes to the right of
       allocated 64-byte region [ffff000018617180, ffff0000186171c0)
    
    Compute buffer_size after the delimiter packet has been accounted for,
    and bound the fill loop by buffer_size, as prepare_silent_urb() already
    does on the outbound side.  This grows every Type II URB allocation by
    one maxsize packet.
    
    Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
    
    Fixes: 8fdff6a319e7 ("ALSA: snd-usb: implement new endpoint streaming model")
    Reported-by: Federico Kirschbaum <federico.kirschbaum@xbow.com>
    Reported-by: Baul Lee <baul.lee@xbow.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Baul Lee <baul.lee@xbow.com>
    Link: https://patch.msgid.link/20260805013441.38245-1-baul.lee@xbow.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: usb-audio: Skip DSD quirk for Musical Fidelity M6s DAC [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Thu Jul 9 11:56:06 2026 +0200

    ALSA: usb-audio: Skip DSD quirk for Musical Fidelity M6s DAC
    
    [ Upstream commit 93b47e66cc6d6c6382d44b44f5e7f6fc3a7b38c3 ]
    
    Salvador reported that the recent fix for applying the DSD quirk to
    Musical Fidelity devices broke for his M6s DAC model (2772:0502).
    
    Although this is basically a firmware bug, the model in question is
    fairly old, and no further firmware update can be expected, so it'd be
    better to address in the driver side.
    
    As an ad hoc workaround, skip the DSD quirk for this device by adding
    an empty quirk entry of 2772:0502; this essentially skips the later
    DSD quirk entry by the match with the vendor 2772.
    
    Fixes: da3a7efff64e ("ALSA: usb-audio: Update for native DSD support quirks")
    Reported-by: Salvador Blaya <tiniebla6@gmail.com>
    Closes: https://lore.kernel.org/CAOdyq+qFaqCh=tK_wNnA64hv5pQuA1Y09ANxQ=xK8yR-t4mf9Q@mail.gmail.com
    Tested-by: Salvador Blaya <tiniebla6@gmail.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Link: https://patch.msgid.link/20260709095614.1418838-1-tiwai@suse.de
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ALSA: usx2y: bound the hwdep mmap fault offset [+ + +]
Author: Baul Lee <baul.lee@xbow.com>
Date:   Wed Aug 5 10:34:45 2026 +0900

    ALSA: usx2y: bound the hwdep mmap fault offset
    
    commit 2ca1eea3cd17930daffe9e429a7c89232036ec24 upstream.
    
    snd_us428ctls_vm_fault() turns the faulting page offset into a kernel
    address with no bound of any kind:
    
            offset = vmf->pgoff << PAGE_SHIFT;
            vaddr = (char *)(...)->us428ctls_sharedmem + offset;
            page = virt_to_page(vaddr);
            get_page(page);
            vmf->page = page;
    
            return 0;
    
    snd_us428ctls_mmap() checks only the length of the mapping, never the
    offset, and us428ctls_sharedmem is a single page from
    alloc_pages_exact().  For a character device file_mmap_size_max()
    returns ULONG_MAX, so the mm layer imposes no ceiling either.  Every page
    offset above zero resolves to a struct page outside the object, and the
    handler installs it into the caller's address space read-write; the vma
    is not marked read-only.
    
    The caller picks the page frame with a single mmap() argument and gets
    read-write access to a page of kernel memory it does not own; an offset
    that lands in an unpopulated vmemmap region oopses instead.
    
    A process that can open the hwdep node of an attached US-X2Y reaches
    this after loading the FPGA image through the same node; no capability
    check is involved.
    
    On 7.2.0-rc5 (arm64), mmap() with a large offset:
    
      Unable to handle kernel paging request at virtual address fffffdffc45d5ac8
      pc : snd_us428ctls_vm_fault+0x68/0x140 [snd_usb_usx2y]
      Call trace:
       snd_us428ctls_vm_fault+0x68/0x140 [snd_usb_usx2y]
       __do_fault
       __handle_mm_fault
       handle_mm_fault
       el0_da
    
    Reject any offset outside the shared region.  The pcm hwdep handler in
    usx2yhwdeppcm.c computes its address the same way and needs the same
    bound.
    
    Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: Federico Kirschbaum <federico.kirschbaum@xbow.com>
    Reported-by: Baul Lee <baul.lee@xbow.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Baul Lee <baul.lee@xbow.com>
    Link: https://patch.msgid.link/20260805013445.38283-1-baul.lee@xbow.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
amd-xgbe: fix MAC_AUTO_SW handling in CL37 AN [+ + +]
Author: Prashanth Kumar KR <PrashanthKumar.K.R@amd.com>
Date:   Thu Jul 9 15:20:06 2026 +0530

    amd-xgbe: fix MAC_AUTO_SW handling in CL37 AN
    
    [ Upstream commit 4bf22afe53a1de4b44b04cf677fd5199089cbdff ]
    
    MAC_AUTO_SW (VR_MII_DIG_CTRL1 bit 9) enables automatic XPCS speed
    mode switching after CL37 auto-negotiation and is only meaningful in
    SGMII MAC mode. The original code unconditionally set this bit on
    every call to xgbe_an37_set(), including when called from
    xgbe_an37_disable() with enable=false. This left MAC_AUTO_SW=1 after
    AN was disabled, causing the XPCS to autonomously switch speed from
    stale AN state during subsequent mode changes, breaking SGMII speed
    negotiation on 1G copper SFP modules.
    
    Patrick: This was breaking negotiation for all 1G SFP modules,
    not just copper modules.
    
    Fixes: 42fd432fe6d3 ("amd-xgbe: align CL37 AN sequence as per databook")
    Reported-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
    Link: https://lore.kernel.org/netdev/CAEg67GmFS0Q4oSZkz8zWdOzckSth9_vBPiOy6a7-d697C2w2Xg@mail.gmail.com
    Signed-off-by: Prashanth Kumar KR <PrashanthKumar.K.R@amd.com>
    Tested-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
    Link: https://patch.msgid.link/20260709095006.3683940-1-prashanthkumar.k.r@amd.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates [+ + +]
Author: Will Deacon <will@kernel.org>
Date:   Thu Jul 16 13:06:39 2026 +0100

    arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates
    
    commit e057b94772328221405b067c3a85fe479b915dc8 upstream.
    
    When seccomp support was originally added to arm64 in a1ae65b21941
    ("arm64: add seccomp support"), seccomp was erroneously called _before_
    the ptrace syscall-enter-stop and therefore the tracer could trivially
    manipulate the syscall register state after the seccomp check had
    passed. This was subsequently fixed in a5cd110cb836 ("arm64/ptrace: run
    seccomp after ptrace") by moving the seccomp check after the tracer has
    run. Unfortunately, a decade later, that fix has been reported to be
    incomplete.
    
    On arm64, both the first argument to a syscall and its eventual return
    value are allocated to register x0. In order to facilitate syscall
    restarting and querying of syscall arguments on the syscall exit path,
    the original value of x0 is stashed in 'struct pt_regs::orig_x0' early
    during the syscall entry path and is returned for the first argument by
    syscall_get_arguments(). Unlike 32-bit Arm, this stashed value is not
    directly exposed via ptrace() and so changes to register x0 made by the
    tracer on a syscall-enter-stop are not reflected in 'orig_x0'. This
    means that seccomp, syscall tracepoints and audit can observe a stale
    value for the register compared to the argument that will be observed by
    the actual syscall.
    
    Re-sync 'orig_x0' from x0 on the syscall entry path following a
    potential ptrace stop (i.e. PTRACE_EVENTMSG_SYSCALL_ENTRY or
    SECCOMP_RET_TRACE). This behaviour is limited to native tasks (because
    compat tasks expose 'orig_r0' to ptrace) where the syscall is not being
    skipped (because x0 is updated to hold the return value of -ENOSYS in
    that case).
    
    Cc: Kees Cook <kees@kernel.org>
    Cc: Jinjie Ruan <ruanjinjie@huawei.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: stable@vger.kernel.org
    Reported-by: Yiqi Sun <sunyiqixm@gmail.com>
    Link: https://lore.kernel.org/all/20260529065444.1336608-1-sunyiqixm@gmail.com/
    Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
    Fixes: a5cd110cb836 ("arm64/ptrace: run seccomp after ptrace")
    Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
    Tested-by: Jinjie Ruan <ruanjinjie@huawei.com>
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ARM: npcm: Fix OF node refcount leaks in SMP setup [+ + +]
Author: Yuho Choi <dbgh9129@gmail.com>
Date:   Sun May 24 23:38:46 2026 -0400

    ARM: npcm: Fix OF node refcount leaks in SMP setup
    
    [ Upstream commit 8eb052f48331474c2789d07b7f11165c323bd2f9 ]
    
    npcm7xx_smp_boot_secondary() and npcm7xx_smp_prepare_cpus() look up
    the GCR and SCU nodes with of_find_compatible_node(). The returned
    nodes are used for of_iomap(), but the node references are never
    released.
    
    of_iomap() does not consume the device node reference, and iounmap()
    only releases the MMIO mapping. Drop each node reference after the
    corresponding mapping attempt.
    
    Fixes: 7bffa14c9aed ("arm: npcm: add basic support for Nuvoton BMCs")
    Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
    Reviewed-by: Avi Fishman <avifishman70@gmail.com>
    Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ASoC: bt-sco: fix bt-sco-pcm-wb dai widget don't connect to the endpoint [+ + +]
Author: Jiaxin Yu <jiaxin.yu@mediatek.com>
Date:   Wed Mar 2 09:35:33 2022 +0800

    ASoC: bt-sco: fix bt-sco-pcm-wb dai widget don't connect to the endpoint
    
    [ Upstream commit 8f2b025abc31bc15d38657d1286d7470bbbd5efa ]
    
    This patch fix the second dai driver's dai widget can't connect to the
    endpoint. Because "bt-sco-pcm" and "bt-sco-pcm-wb" dai driver have the
    same stream_name, so it will cause they have the same widget name.
    Therefor it will just create only one route when do snd_soc_dapm_add_route
    that only find the widget through the widget name.
    
    Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
    Link: https://lore.kernel.org/r/20220302013533.29068-1-jiaxin.yu@mediatek.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 0b604e886ece ("ASoC: bt-sco: fix duplicate DAPM widget names for wideband DAI")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: bt-sco: fix duplicate DAPM widget names for wideband DAI [+ + +]
Author: Shengjiu Wang <shengjiu.wang@nxp.com>
Date:   Wed Jul 15 18:06:20 2026 +0800

    ASoC: bt-sco: fix duplicate DAPM widget names for wideband DAI
    
    [ Upstream commit 0b604e886ece11b71c4daaeccc512c784b89b014 ]
    
    The bt-sco-pcm-wb DAI uses the same stream_name strings as bt-sco-pcm
    ("Playback" and "Capture"). This causes duplicate DAPM AIF widget
    names within the same component, leading to debugfs warnings:
    
      debugfs: 'Playback' already exists in 'dapm'
      debugfs: 'Capture' already exists in 'dapm'
    
    Give the wideband DAI distinct stream names ("WB Playback" and
    "WB Capture") and add corresponding DAPM AIF widgets and routes for
    them.
    
    Fixes: 5947e1b4992e ("ASoC: bt-sco: extend rate and add a general compatible string")
    Assisted-by: VeroCoder:claude-sonnet-4-5
    Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
    Link: https://patch.msgid.link/20260715100620.1387159-1-shengjiu.wang@oss.nxp.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: max98090: fix missing IS_ERR() before PTR_ERR() on mclk lookup [+ + +]
Author: Uday Khare <udaykhare77@gmail.com>
Date:   Mon Jul 20 16:12:54 2026 +0530

    ASoC: max98090: fix missing IS_ERR() before PTR_ERR() on mclk lookup
    
    [ Upstream commit a792ce0fad61a70793ec565743f11d6ca534de59 ]
    
    In max98090_probe(), the -EPROBE_DEFER check after devm_clk_get() is
    broken due to a missing IS_ERR() guard.
    
    The code intends to return -EPROBE_DEFER only when the clock lookup
    fails with that specific error.  However, without IS_ERR() the check:
    
        if (PTR_ERR(max98090->mclk) == -EPROBE_DEFER)
    
    is called unconditionally, including when devm_clk_get() succeeds and
    returns a valid pointer.  Calling PTR_ERR() on a valid pointer
    reinterprets its address as a signed long; the result is arbitrary
    and is almost never equal to -EPROBE_DEFER, so the check silently
    does nothing in the success case.  When devm_clk_get() fails with
    any error other than -EPROBE_DEFER the check is also skipped, leaving
    max98090->mclk holding an error pointer with no indication to the caller.
    
    This means a deferred probe will never actually be triggered for this
    device, and any non-EPROBE_DEFER clock error is silently swallowed with
    the error pointer left in the mclk field.
    
    Fix this by adding the missing IS_ERR() guard around the PTR_ERR() call,
    matching the pattern already used in the sibling max98088 and wm8960
    drivers.
    
    Fixes: b10ab7b838bd ("ASoC: max98090: Add master clock handling")
    Signed-off-by: Uday Khare <udaykhare77@gmail.com>
    Link: https://patch.msgid.link/20260720104254.14948-1-udaykhare77@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: max98095: fix missing IS_ERR() before PTR_ERR() on mclk lookup [+ + +]
Author: Uday Khare <udaykhare77@gmail.com>
Date:   Mon Jul 20 16:09:50 2026 +0530

    ASoC: max98095: fix missing IS_ERR() before PTR_ERR() on mclk lookup
    
    [ Upstream commit 317e21532e6ffa1de026bdbce5ba98e1b70ca5c6 ]
    
    In max98095_probe(), the -EPROBE_DEFER check after devm_clk_get() is
    broken due to a missing IS_ERR() guard.
    
    The code intends to return -EPROBE_DEFER only when the clock lookup
    fails with that specific error.  However, without IS_ERR() the check:
    
        if (PTR_ERR(max98095->mclk) == -EPROBE_DEFER)
    
    is called unconditionally, including when devm_clk_get() succeeds and
    returns a valid pointer.  Calling PTR_ERR() on a valid pointer
    reinterprets its address as a signed long; the result is arbitrary
    and is almost never equal to -EPROBE_DEFER, so the check silently
    does nothing in the success case.  When devm_clk_get() fails with
    any error other than -EPROBE_DEFER the check is also skipped, leaving
    max98095->mclk holding an error pointer with no indication to the caller.
    
    This means a deferred probe will never actually be triggered for this
    device, and any non-EPROBE_DEFER clock error is silently swallowed with
    the error pointer left in the mclk field.
    
    Fix this by adding the missing IS_ERR() guard around the PTR_ERR() call,
    matching the pattern already used in the sibling max98088 and wm8960
    drivers.
    
    Fixes: e3048c3d2be5 ("ASoC: max98095: Add master clock handling")
    Signed-off-by: Uday Khare <udaykhare77@gmail.com>
    Link: https://patch.msgid.link/20260720103950.14474-1-udaykhare77@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop [+ + +]
Author: Christian Hewitt <christianshewitt@gmail.com>
Date:   Sat Jun 27 13:12:05 2026 +0000

    ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop
    
    [ Upstream commit 6b59c53c8adc2b522327407af5e1793a65b67e4b ]
    
    The I2S FIFO soft-resets its fast domain on start (AIU_RST_SOFT bit 0 +
    AIU_I2S_SYNC read in aiu_fifo_i2s_trigger), mirroring the downstream
    vendor driver's audio_out_i2s_enable(). The S/PDIF FIFO has no equivalent:
    it only toggles the IEC958 DCU, so a stale datapath FIFO can be replayed,
    producing the "machine gun noise" buffer underrun - on start when switching
    outputs, and on stop when playback ends. The latter is audible on devices
    with an always-on S/PDIF-fed DAC (e.g. the ES7144 on the WeTek Play2).
    
    The vendor driver resets the IEC958 fast domain (AIU_RST_SOFT bit 2) on
    both enable and disable (audio_hw_958_enable), and when reconfiguring
    (audio_hw_958_reset clears AIU_958_DCU_FF_CTRL then resets). Do the same:
    reset before enabling the DCU on start, and before disabling on stop.
    
    Fixes: 6ae9ca9ce986bf ("ASoC: meson: aiu: add i2s and spdif support")
    Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
    Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
    Link: https://patch.msgid.link/20260627131205.808800-1-christianshewitt@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: tas2562: fix broken entries in the volume lookup table [+ + +]
Author: Haidar Lee <haidar.lee@adlinktech.com>
Date:   Wed Jul 15 14:04:41 2026 +0800

    ASoC: tas2562: fix broken entries in the volume lookup table
    
    commit bdb0fd6de403fcea7b85dc9d38f0a571583ebe80 upstream.
    
    The float_vol_db_lookup table is supposed to hold
    round(10^(dB/20) * 2^30) for every 2 dB step from -110 dB to 0 dB,
    which is 56 entries, but it only has 55: the -90 dB entry duplicates
    the -92 dB value (0x0000695b) and the -20 dB entry (0x06666666) is
    missing altogether. As a result every step between -90 dB and -22 dB
    is off by 2 dB, and the control's maximum raw value of 110 indexes one
    element past the end of the array.
    
    Replace the duplicated -90 dB entry with the correct value 0x000084a3
    and add the missing -20 dB entry, bringing the table to the full 56
    entries so index 55 (raw value 110, 0 dB) is in range again.
    
    Fixes: bf726b1c86f2 ("ASoC: tas2562: Add support for digital volume control")
    Cc: stable@vger.kernel.org
    Signed-off-by: Haidar Lee <haidar.lee@adlinktech.com>
    Link: https://patch.msgid.link/20260715-tas2562-dvc-fix-v1-2-072b13901b20@adlinktech.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ASoC: tas2562: fix deprecated 'shut-down' GPIO always cleared after lookup [+ + +]
Author: Uday Khare <udaykhare77@gmail.com>
Date:   Mon Jul 6 21:01:09 2026 +0530

    ASoC: tas2562: fix deprecated 'shut-down' GPIO always cleared after lookup
    
    [ Upstream commit 3238c634725afbb2a137fdda762208510828f71d ]
    
    In tas2562_parse_dt(), the fallback lookup for the deprecated
    "shut-down" GPIO property is broken due to a missing pair of braces.
    
    The code intends to reset sdz_gpio to NULL only when the lookup
    returns an error that is not -EPROBE_DEFER (so the driver gracefully
    continues without a GPIO). However, without braces the statement:
    
        tas2562->sdz_gpio = NULL;
    
    falls outside the IS_ERR() check and is executed unconditionally
    for every path through the if block, including a successful GPIO
    lookup.
    
    This means any device using the deprecated 'shut-down' DT property
    will always have sdz_gpio == NULL after probe, making the GPIO
    completely non-functional.
    
    Fix this by adding the missing braces to scope the NULL assignment
    inside the IS_ERR() branch, matching the pattern already used for
    the primary 'shutdown' GPIO lookup above.
    
    Fixes: f78a97003b8b ("ASoC: tas2562: Update shutdown GPIO property")
    Signed-off-by: Uday Khare <udaykhare77@gmail.com>
    Link: https://patch.msgid.link/20260706153109.10953-1-udaykhare77@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: tas2562: fix DVC coefficient write order [+ + +]
Author: Haidar Lee <haidar.lee@adlinktech.com>
Date:   Wed Jul 15 14:04:40 2026 +0800

    ASoC: tas2562: fix DVC coefficient write order
    
    commit 8e957e4907c58e9ca944f98799524f2bbb9cf68a upstream.
    
    The TAS2562 applies the 32-bit digital volume coefficient to the
    playback path when the last byte, DVC_CFG4 (book 0 page 2 reg 0x0F), is
    written. tas2562_volume_control_put() wrote DVC_CFG4 first and DVC_CFG1
    (the MSB) last, so every volume change latched a value made of the
    previous coefficient's upper three bytes combined with the new LSB; the
    remaining bytes only took effect on the next volume change.
    
    In practice the control was unusable: the first setting after power-on
    always played at roughly 0 dB no matter what value was requested (the
    chip's default upper bytes were still latched), and most subsequent
    changes muted the output entirely or produced a distorted, over-unity
    gain.
    
    Verified on a TAS2562 (ADLINK OSM-520 / MT8189 board) by tracing the
    I2C writes with ftrace and by writing the same coefficients manually in
    both byte orders: written MSB-first the register block behaves exactly
    as the driver expects, LSB-first reproduces the broken behaviour.
    
    Write the bytes MSB first with DVC_CFG4 last so the complete new
    coefficient is latched atomically.
    
    Fixes: bf726b1c86f2 ("ASoC: tas2562: Add support for digital volume control")
    Cc: stable@vger.kernel.org
    Signed-off-by: Haidar Lee <haidar.lee@adlinktech.com>
    Link: https://patch.msgid.link/20260715-tas2562-dvc-fix-v1-1-072b13901b20@adlinktech.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
assoc_array: trim the final shortcut word using the current chunk end [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sun Jul 19 12:15:05 2026 -0400

    assoc_array: trim the final shortcut word using the current chunk end
    
    [ Upstream commit a82c8a05e86f3f84e09698f65b4515b5d04633f6 ]
    
    assoc_array_walk() masks off the bits past shortcut->skip_to_level in the
    word that contains skip_to_level, gated on
    round_up(sc_level, ASSOC_ARRAY_KEY_CHUNK_SIZE) > skip_to_level.
    
    That guard is wrong in two opposite ways:
    
     - When sc_level is word-aligned (every word after the first) round_up()
       is a no-op, so the guard is sc_level > skip_to_level and never fires for
       the word that holds skip_to_level.  A shortcut that spans more than one
       word and ends in the middle of its last word leaves that word untrimmed,
       and its stale high bits leak into the dissimilarity word and can steer
       the walk down the wrong descendant.
    
     - When sc_level is unaligned (the first word) and skip_to_level sits on
       the next chunk boundary, sc_level + CHUNK would exceed skip_to_level and
       fire the trim with shift = skip_to_level & CHUNK_MASK == 0, which clears
       the whole dissimilarity word and makes a differing shortcut compare
       equal.
    
    Use the end of the chunk that contains sc_level instead:
    
            skip_to_level < round_down(sc_level, CHUNK) + CHUNK
    
    For an aligned sc_level whose word holds skip_to_level this now fires (the
    first bug); for an unaligned sc_level with skip_to_level on the following
    boundary it does not, so shift is never 0 when the branch runs and the trim
    never clears the whole word.
    
    Fixes: 3cb989501c26 ("Add a generic associative array implementation.")
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
    Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
    Link: https://lore.kernel.org/r/20260719161505.2423935-4-michael.bommarito@gmail.com
    Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ata: pata_sl82c105: fix bridge revision use-after-free [+ + +]
Author: Hongyan Xu <getshell@seu.edu.cn>
Date:   Thu Aug 6 14:06:28 2026 +0800

    ata: pata_sl82c105: fix bridge revision use-after-free
    
    [ Upstream commit 7700a31039cdc6715cb6cce7e7a664ee4e945f67 ]
    
    pci_get_slot() returns a referenced PCI device. Commit 44c10138fd4b
    ("PCI: Change all drivers to use pci_device->revision") replaced a
    configuration-space read with direct access to the cached revision field,
    but left that access after pci_dev_put(). The bridge may therefore be freed
    before its revision is read.
    
    Read the revision before dropping the reference.
    
    Fixes: 44c10138fd4b ("PCI: Change all drivers to use pci_device->revision")
    Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
    Reviewed-by: Niklas Cassel <cassel@kernel.org>
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ata: sata_dwc_460ex: enable SATA interrupts only after IRQ handler is registered [+ + +]
Author: Rosen Penev <rosenp@gmail.com>
Date:   Sun Jul 12 14:37:26 2026 -0700

    ata: sata_dwc_460ex: enable SATA interrupts only after IRQ handler is registered
    
    [ Upstream commit 4bbc16a353a98023e5ddfca7c1fc0e49971cf4d0 ]
    
    sata_dwc_enable_interrupts() is called before platform_get_irq() and
    ata_host_activate(), leaving the SATA controller's interrupt mask
    enabled without a registered handler.  If a later step fails (irq
    request, phy init, etc.) or if the controller asserts an interrupt
    during probe, the irq line may fire with no handler, causing a
    spurious interrupt storm.
    
    Move sata_dwc_enable_interrupts() after ata_host_activate() so that
    interrupts are only unmasked once the handler is registered and the
    core is fully initialized.
    
    Fixes: 62936009f35a ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex")
    Assisted-by: opencode:big-pickle
    Signed-off-by: Rosen Penev <rosenp@gmail.com>
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ata: sata_dwc_460ex: fix clear_interrupt_bit() clearing all pending interrupts [+ + +]
Author: Rosen Penev <rosenp@gmail.com>
Date:   Sun Jul 12 14:37:27 2026 -0700

    ata: sata_dwc_460ex: fix clear_interrupt_bit() clearing all pending interrupts
    
    [ Upstream commit 66c4e310ad71f41e41736d33dd8a1fb5eaaec7f3 ]
    
    clear_interrupt_bit() ignores the bit argument and performs a
    read-write-back of the entire INTPR register.  If INTPR uses standard
    Write-1-to-Clear semantics, this clears every pending interrupt bit,
    not just the intended one.  Coalesced interrupts (e.g. DMAT + NEWFP)
    would be cleared together, silently losing the second event.
    
    Write only the specific bit to clear so that other pending interrupts
    are preserved.
    
    Fixes: 62936009f35a ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex")
    Assisted-by: opencode:big-pickle
    Signed-off-by: Rosen Penev <rosenp@gmail.com>
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ata: sata_dwc_460ex: fix infinite loop in NCQ tag completion bit-scanning [+ + +]
Author: Rosen Penev <rosenp@gmail.com>
Date:   Sun Jul 12 14:37:28 2026 -0700

    ata: sata_dwc_460ex: fix infinite loop in NCQ tag completion bit-scanning
    
    [ Upstream commit c2130f6553f4a5cbdc259de069600117a995f197 ]
    
    The hand-rolled bit-scanning loop in the NCQ completion path has an
    infinite loop bug.  When tag_mask has only high bits set (e.g.
    0x80000000), the inner while loop left-shifts tag_mask until it
    overflows to 0.  At that point !(0 & 1) is always true and 0 <<= 1
    stays 0, causing an infinite loop in hardirq context with a spinlock
    held.
    
    Replace the open-coded bit-scanning with __ffs() which correctly
    finds the least significant set bit and is bounded by the width of
    the argument.
    
    Fixes: 62936009f35a ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex")
    Assisted-by: opencode:big-pickle
    Signed-off-by: Rosen Penev <rosenp@gmail.com>
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ata: sata_dwc_460ex: remove variable num_processed [+ + +]
Author: Colin Ian King <colin.i.king@gmail.com>
Date:   Mon Oct 24 15:17:59 2022 +0100

    ata: sata_dwc_460ex: remove variable num_processed
    
    [ Upstream commit de58fd3d80f884f7f322a06bfe08465e49b47c5d ]
    
    Variable num_processed is just being incremented and it's never used
    anywhere else. The variable and the increment are redundant so
    remove it.
    
    Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
    Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
    Stable-dep-of: c2130f6553f4 ("ata: sata_dwc_460ex: fix infinite loop in NCQ tag completion bit-scanning")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
audit: fix potential integer overflow in audit_log_n_string() [+ + +]
Author: Zhan Xusheng <zhanxusheng1024@gmail.com>
Date:   Sat Jul 18 13:09:22 2026 +0800

    audit: fix potential integer overflow in audit_log_n_string()
    
    commit f865c143629d4094866a811dba5f329250bad486 upstream.
    
    audit_log_n_string() computes new_len as "slen + 3" (enclosing quotes
    plus the NUL terminator) and stores it into an int, while slen is a
    size_t.  For a sufficiently large slen the addition can overflow and/or
    the result be truncated when assigned to the int new_len, so the
    "new_len > avail" check can be bypassed and the subsequent
    memcpy(ptr, string, slen) can write past the skb tail.
    
    This is the same class of bug that was fixed for the hex sibling in
    commit 65dfde57d1e2 ("audit: fix potential integer overflow in
    audit_log_n_hex()"); both helpers are reached through
    audit_log_n_untrustedstring() with the same length source.
    
    Make new_len a size_t and use check_add_overflow() to catch the
    overflow, mirroring the audit_log_n_hex() fix.  No functional change for
    the in-tree callers, which all pass bounded lengths.
    
    Cc: stable@vger.kernel.org
    Fixes: 168b7173959f ("AUDIT: Clean up logging of untrusted strings")
    Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
    Signed-off-by: Paul Moore <paul@paul-moore.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

audit: fix potential use-after-free in audit_del_rule() [+ + +]
Author: Luxiao Xu <rakukuip@gmail.com>
Date:   Tue Jul 21 23:37:41 2026 +0800

    audit: fix potential use-after-free in audit_del_rule()
    
    commit 246df90b5f1a8a6e6abbd2f058b029558720adec upstream.
    
    `audit_del_rule()` destroys `e->rule.exe` via `audit_remove_mark_rule()`
    before unlinking the rule from RCU-visible filter lists and waiting for a
    grace period. Concurrent readers in `audit_filter()` and
    `audit_filter_rules()` still dereference `e->rule.exe`, while the fsnotify
    mark can be freed on an independent lifetime path. This creates a
    use-after-free window during rule deletion.
    
    Fix this by unlinking the rule from the RCU-visible lists and invoking
    `synchronize_rcu()` before calling `audit_remove_mark_rule()` (and other
    rule removal helpers). This ensures that all existing RCU readers have
    exited the critical section before any underlying resources are destroyed.
    
    Cc: stable@vger.kernel.org
    Fixes: 34d99af52ad4 ("audit: implement audit by executable")
    Reported-by: Vega <vega@nebusec.ai>
    Assisted-by: Codex:gpt-5.4
    Signed-off-by: Luxiao Xu <rakukuip@gmail.com>
    Signed-off-by: Ren Wei <enjou1224z@gmail.com>
    Signed-off-by: Paul Moore <paul@paul-moore.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
binfmt_elf_fdpic: only honour the first PT_INTERP [+ + +]
Author: Christian Brauner <brauner@kernel.org>
Date:   Tue Jul 21 13:20:45 2026 +0200

    binfmt_elf_fdpic: only honour the first PT_INTERP
    
    commit 3349ef6a366a61d631f6a263d12cea240957719d upstream.
    
    The program header scan handles PT_INTERP from a switch nested in the
    scan loop, so its break leaves the switch and not the loop. A binary
    carrying more than one PT_INTERP runs the case again and overwrites both
    interpreter_name and interpreter. The previous name allocation leaks and
    so does the previous interpreter reference, along with the write denial
    open_exec() took on it. The denial is never released, so the file stays
    unwritable for as long as the system runs.
    
    An unprivileged caller reaches this with a crafted binary and repeats it
    at will. binfmt_elf stops at the first PT_INTERP. Do the same here.
    
    The flaw dates back to the driver's introduction in the pre-git history
    tree introduced in v2.6.11 by 91808d6ebe39 ("[PATCH] FRV: Add FDPIC ELF
    binary format driver").
    
    Link: https://patch.msgid.link/20260721-gezittert-medium-kreide-b41fc1f0277e@brauner
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reviewed-by: Jori Koolstra <jkoolstra@xs4all.nl>
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
binfmt_misc: reject a flag character as the field delimiter [+ + +]
Author: Christian Brauner <brauner@kernel.org>
Date:   Fri Jul 10 11:33:04 2026 +0200

    binfmt_misc: reject a flag character as the field delimiter
    
    commit 8e85d50ba1117fd446bf9a250bd8a97d48384bdc upstream.
    
    The registration string starts with a user chosen delimiter that
    separates the individual fields. So that the field parsers terminate
    even on a truncated string create_entry() pads the buffer with that
    same delimiter:
    
            memset(buf + count, del, 8);
    
    Most fields are scanned for the delimiter with strchr()/scanarg() and
    happily stop on the padding. The flags field is different: instead of
    scanning for the delimiter check_special_flags() consumes the flag
    characters 'P', 'O', 'C' and 'F' and stops at the first byte that is
    none of them, relying on the trailing delimiter to end the scan.
    
    If the delimiter is itself a flag character the padding no longer acts
    as a terminator. The scan swallows all eight padding bytes and keeps
    reading past the end of the allocation until it hits a byte that is
    not a flag character. For example registering
    
            PaPEPPxPPiP
    
    with 'P' as the delimiter (name "a", type extension, magic "x",
    interpreter "i", empty flags) leaves the flag scan running off the end
    of the buffer. The registration is rejected in the end because the
    parser does not stop exactly at buf + count, but only after the out of
    bounds read has already happened. With an unlucky allocation layout the
    scan can walk into an unmapped page; under KASAN it is reported as a
    slab out of bounds read. binfmt_misc mounts are available to
    unprivileged users in a user namespace so the read is reachable without
    privileges.
    
    Reject a delimiter that is one of the flag characters up front. Such a
    registration was always rejected anyway, only after the out of bounds
    read, so no valid registration string changes meaning.
    
    Link: https://patch.msgid.link/20260710-work-binfmt_misc-locking-v3-3-a162f7cb58d6@kernel.org
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

binfmt_misc: set have_execfd only once the interpreter is opened [+ + +]
Author: Christian Brauner <brauner@kernel.org>
Date:   Mon Jul 20 14:36:49 2026 +0200

    binfmt_misc: set have_execfd only once the interpreter is opened
    
    commit bbf5f639918dc011aaf60aab8480218758ee68c5 upstream.
    
    load_misc_binary() raises bprm->have_execfd as soon as it sees the 'O'
    (or 'C') flag. This happens well before it opens the interpreter. If
    that open fails the flag stays set on the bprm. binfmt_misc is at the
    head of the format list so an interpreter open failure that returns
    -ENOEXEC lets the search fall through to a later format. This means it
    runs the matched binary directly having never staged an interpreter. So
    bprm->executable is NULL while have_execfd falsely claims a descriptor
    is present.
    
    Consequently, begin_new_exec() dereferences the missing executable:
    
      would_dump(bprm, bprm->executable);
    
    and NULL derefs. Had it not, the hand-off later in the same function
    would have failed anyway. FD_ADD(0, bprm->executable) rejects a NULL
    file with -ENOMEM. Both sites are past the point of no return so the
    exec cannot be unwound either way.
    
    This can be reached by unprivileged users as binfmt_misc can be mounted
    in user namespaces. So a user can register an 'O' entry whose
    interpreter lives on a FUSE mount, have the FUSE server fail the open
    with -ENOEXEC and execute a native ELF file that matches the entry.
    
    have_execfd only means anything alongside the executable it describes
    which is not set until the interpreter has been opened and staged.
    So lets raise it there, next to execfd_creds, which is already set at
    that point. An open failure now leaves it clear, so the fallback format
    derives credentials from the binary and emits no AT_EXECFD, as it would
    for any native exec. The argv rewrite load_misc_binary() performs before
    the open is still not undone. This means the binary sees the interpreter
    path in argv[0] and its own path in argv[1] but that predates this
    change and only became observable once the exec stopped faulting.
    
    Link: https://patch.msgid.link/20260720-beglichen-kognitiv-organismus-5e1e55326c56@brauner
    Fixes: bc2bf338d54b ("exec: Remove recursion from search_binary_handler")
    Cc: stable@vger.kernel.org
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Wed Aug 12 23:46:59 2026 +0000

    Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev
    
    [ Upstream commit d38eaf611839b85ade3dd3db309dbc8aaaaf0095 ]
    
    b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding
    conn ref") don't reset the chan->conn to NULL anymore making the bt#
    netdev not be remove once the last l2cap_chan_del is removed.
    
    Instead of restoring the original behavior this remove the logic of
    keeping the interface after the last channel is removed because it
    never worked as intended and the l2cap_chan_del always detach its
    l2cap_conn which results in always removing the channel anyway.
    
    Fixes: b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: HIDP: reject frames without a transaction header [+ + +]
Author: Sangho Lee <kudo3228@gmail.com>
Date:   Thu Jul 23 12:28:06 2026 +0900

    Bluetooth: HIDP: reject frames without a transaction header
    
    commit 47778d2c2087b5d192398f6fddf692d16a5431cf upstream.
    
    hidp_recv_ctrl_frame() and hidp_recv_intr_frame() read skb->data[0]
    before checking that the L2CAP SDU contains a transaction header. A
    connected HIDP peer can send an empty basic-mode SDU and make both paths
    use an uninitialized byte from skb tailroom.
    
    KMSAN reports the use in hidp_session_run(), with the uninitialized value
    originating in __alloc_skb() through vhci_write(). The control path
    produces two reports and the interrupt path produces one.
    
    The byte can also be controlled by a malformed lower-layer packet. If an
    HCI ACL packet contains an L2CAP PDU with a declared zero-length payload
    followed by an extra 0x15 byte, l2cap_recv_acldata() reduces skb->len to
    the declared PDU length before dispatch. The current HIDP path nevertheless
    consumes the extra byte as HIDP_TRANS_HID_CONTROL |
    HIDP_CTRL_VIRTUAL_CABLE_UNPLUG and terminates the HIDP session. With this
    change, the same packet is discarded and a subsequent feature report
    request succeeds.
    
    Pull the transaction header with skb_pull_data() and discard frames that
    do not contain it.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Sangho Lee <kudo3228@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: HIDP: validate numbered report payloads [+ + +]
Author: Sangho Lee <kudo3228@gmail.com>
Date:   Thu Jul 23 12:28:07 2026 +0900

    Bluetooth: HIDP: validate numbered report payloads
    
    commit 34f53d27b81a16a02828c8fdfa4e02badc326f17 upstream.
    
    When hidp_get_raw_report() waits for a numbered report,
    hidp_process_data() compares the expected report number with skb->data[0].
    A connected HIDP peer can reply with only a DATA transaction header,
    leaving the skb empty after the header is removed.
    
    KMSAN reports an uninitialized-value use in hidp_session_run(), with the
    value originating in __alloc_skb() through vhci_write(). The transaction
    header checks remove the empty-frame reports, but this report remains until
    the payload check is added.
    
    The comparison can also consume a peer-controlled byte beyond the declared
    L2CAP PDU. A DATA | FEATURE response followed by an extra 0x01 byte made
    the current code accept that byte as report ID 1 and complete
    HIDIOCGFEATURE with a zero-byte result. With this change the malformed
    response is rejected with -EIO, while a subsequent valid response still
    succeeds.
    
    Require a payload byte before comparing a numbered report ID. Unnumbered
    reports continue to accept an empty payload.
    
    Fixes: 0ff1731a1ae5 ("HID: bt: Add support for hidraw HIDIOCGFEATURE and HIDIOCSFEATURE")
    Cc: stable@vger.kernel.org
    Signed-off-by: Sangho Lee <kudo3228@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref [+ + +]
Author: Marco Elver <elver@google.com>
Date:   Wed Aug 12 23:46:58 2026 +0000

    Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref
    
    [ Upstream commit b66774b48dd98f07254951f74ea6f513efe7ff8b ]
    
    l2cap_chan_timeout() runs asynchronously and accesses chan->conn. If
    the connection is torn down while the timer is running or pending,
    chan->conn can be freed, leading to a use-after-free when the timer
    worker attempts to lock conn->lock:
    
    | BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:112 [inline]
    | BUG: KASAN: slab-use-after-free in atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:4456 [inline]
    | BUG: KASAN: slab-use-after-free in __mutex_trylock_fast kernel/locking/mutex.c:161 [inline]
    | BUG: KASAN: slab-use-after-free in mutex_lock+0x4f/0xa0 kernel/locking/mutex.c:318
    | Write of size 8 at addr ffff8881298d9550 by task kworker/2:1/83
    |
    | CPU: 2 UID: 0 PID: 83 Comm: kworker/2:1 Not tainted 7.1.0-rc6-next-20260601-dirty #6 PREEMPT(full)
    | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1 04/01/2014
    | Workqueue: events l2cap_chan_timeout
    | Call Trace:
    |  <TASK>
    |  instrument_atomic_read_write include/linux/instrumented.h:112 [inline]
    |  atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:4456 [inline]
    |  __mutex_trylock_fast kernel/locking/mutex.c:161 [inline]
    |  mutex_lock+0x4f/0xa0 kernel/locking/mutex.c:318
    |  l2cap_chan_timeout+0x5d/0x1b0 net/bluetooth/l2cap_core.c:422
    |  process_one_work kernel/workqueue.c:3326 [inline]
    |  process_scheduled_works+0x7c8/0xfb0 kernel/workqueue.c:3409
    |  worker_thread+0x8a9/0xcf0 kernel/workqueue.c:3490
    |  kthread+0x346/0x430 kernel/kthread.c:436
    |  ret_from_fork+0x1a3/0x470 arch/x86/kernel/process.c:158
    |  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
    |  </TASK>
    |
    | Allocated by task 320:
    |  l2cap_conn_add+0xa7/0x820 net/bluetooth/l2cap_core.c:7075
    |  l2cap_connect_cfm+0xdb/0xd70 net/bluetooth/l2cap_core.c:7452
    |  hci_connect_cfm include/net/bluetooth/hci_core.h:2139 [inline]
    |  hci_remote_features_evt+0x52f/0x9f0 net/bluetooth/hci_event.c:3760
    |  hci_event_func net/bluetooth/hci_event.c:7796 [inline]
    |  hci_event_packet+0x561/0xa70 net/bluetooth/hci_event.c:7847
    |  hci_rx_work+0x370/0x890 net/bluetooth/hci_core.c:4040
    |  process_one_work kernel/workqueue.c:3326 [inline]
    |  process_scheduled_works+0x7c8/0xfb0 kernel/workqueue.c:3409
    |  worker_thread+0x8a9/0xcf0 kernel/workqueue.c:3490
    |  kthread+0x346/0x430 kernel/kthread.c:436
    |  ret_from_fork+0x1a3/0x470 arch/x86/kernel/process.c:158
    |  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
    |
    | Freed by task 322:
    |  hci_disconn_cfm include/net/bluetooth/hci_core.h:2154 [inline]
    |  hci_conn_hash_flush+0x101/0x1f0 net/bluetooth/hci_conn.c:2736
    |  hci_dev_close_sync+0x889/0xde0 net/bluetooth/hci_sync.c:5405
    |  hci_dev_do_close net/bluetooth/hci_core.c:502 [inline]
    |  hci_unregister_dev+0x1f7/0x370 net/bluetooth/hci_core.c:2679
    |  vhci_release+0x12a/0x180 drivers/bluetooth/hci_vhci.c:690
    |  __fput+0x369/0x890 fs/file_table.c:510
    |  task_work_run+0x160/0x1d0 kernel/task_work.c:233
    |  get_signal+0xf5b/0x1120 kernel/signal.c:2810
    |  arch_do_signal_or_restart+0x4d/0x600 arch/x86/kernel/signal.c:337
    |  __exit_to_user_mode_loop kernel/entry/common.c:64 [inline]
    |  exit_to_user_mode_loop+0x85/0x510 kernel/entry/common.c:98
    |  do_syscall_64+0x263/0x3d0 arch/x86/entry/syscall_64.c:100
    |  entry_SYSCALL_64_after_hwframe+0x77/0x7f
    |
    | The buggy address belongs to the object at ffff8881298d9400
    |  which belongs to the cache kmalloc-512 of size 512
    | The buggy address is located 336 bytes inside of
    |  freed 512-byte region [ffff8881298d9400, ffff8881298d9600)
    
    Fix it by having chan->conn hold a reference to l2cap_conn (via
    l2cap_conn_get) when the channel is added to the connection, and
    releasing it in the channel destructor. This ensures the l2cap_conn
    remains alive as long as the channel exists.
    
    A new FLAG_DEL channel flag is introduced to indicate that the channel
    has been deleted from its connection. l2cap_chan_del() atomically sets
    this flag using test_and_set_bit() instead of setting chan->conn to
    NULL. All asynchronous workers (l2cap_chan_timeout, l2cap_ack_timeout,
    l2cap_monitor_timeout, l2cap_retrans_timeout) and l2cap_chan_send()
    check FLAG_DEL to determine whether the channel has been torn down,
    rather than testing chan->conn for NULL.
    
    Fixes: 8c8e620467a7 ("Bluetooth: L2CAP: use chan timer to close channels in cleanup_listen()")
    Cc: <stable@vger.kernel.org>
    Cc: Siwei Zhang <oss@fourdim.xyz>
    Cc: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Assisted-by: Gemini:gemini-3.1-pro-preview
    Reported-by: https://sashiko.dev/#/patchset/20260521021249.3258069-1-oss%40fourdim.xyz
    Change-Id: Ie9862976d25c3e6d386689cd198ebe5ab4cc5509
    Signed-off-by: Marco Elver <elver@google.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Todd Kjos <tkjos@google.com>

Bluetooth: L2CAP: fix UAF in l2cap_le_connect_rsp [+ + +]
Author: Jiale Yao <yaojiale02@163.com>
Date:   Thu Jul 23 14:48:45 2026 +0800

    Bluetooth: L2CAP: fix UAF in l2cap_le_connect_rsp
    
    [ Upstream commit c4740e7f23ff9a8210198d8b4703259e21b9f69d ]
    
    l2cap_le_connect_rsp() obtains a channel via
    __l2cap_get_chan_by_ident() but neither holds a reference nor uses
    l2cap_chan_hold_unless_zero() before locking and operating on it.
    A concurrent l2cap_chan_del() triggered by a remote disconnect can
    free the channel between the lookup and l2cap_chan_lock(), causing
    a use-after-free.
    
    The BR/EDR counterpart l2cap_connect_rsp() and the sibling handler
    l2cap_le_command_rej() already use l2cap_chan_hold_unless_zero()
    to safely hold a reference, but l2cap_le_connect_rsp() was left
    unprotected.
    
    Fix by adding l2cap_chan_hold_unless_zero() after the ident lookup
    and l2cap_chan_put() on the exit path, consistent with other L2CAP
    response handlers.
    
    Fixes: f1496dee9cbd ("Bluetooth: Add initial code for LE L2CAP Connect Request")
    Assisted-by: Claude:deepseek-v4-pro
    Signed-off-by: Jiale Yao <yaojiale02@163.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: qca: fix NVM tag length underflow in TLV parser [+ + +]
Author: Xiang Mei <xmei5@asu.edu>
Date:   Sat Jul 4 16:10:30 2026 -0700

    Bluetooth: qca: fix NVM tag length underflow in TLV parser
    
    [ Upstream commit c90164ca0f7036942ba088eb7ea8d3f6c2352020 ]
    
    In the TLV_TYPE_NVM branch of qca_tlv_check_data() the tag loop bound is
    "while (idx < length - sizeof(struct tlv_type_nvm))". "length" is a signed
    int from the firmware TLV header and sizeof(struct tlv_type_nvm) is a
    size_t (12), so "length" is converted to size_t and any firmware-supplied
    "length" < 12 makes the subtraction wrap to a huge value. The loop body
    then reads a 12-byte struct tlv_type_nvm past the end of the short
    vmalloc'd firmware buffer (and the EDL_TAG_ID_* handlers can write past it).
    
    Rewrite the bound as "idx + sizeof(struct tlv_type_nvm) <= length"; both
    operands are non-negative, so it no longer underflows and a "length" too
    small for one record correctly skips the loop.
    
      BUG: KASAN: vmalloc-out-of-bounds in qca_download_firmware.isra.0 (drivers/bluetooth/btqca.c:421)
      Read of size 2 at addr ffffc900000e5004 by task kworker/u9:0/52
      Workqueue: hci0 hci_power_on
      Call Trace:
       ...
       kasan_report (mm/kasan/report.c:595)
       qca_download_firmware.isra.0 (drivers/bluetooth/btqca.c:421 drivers/bluetooth/btqca.c:617)
       qca_uart_setup (drivers/bluetooth/btqca.c:948)
       qca_setup (drivers/bluetooth/hci_qca.c:2029)
       hci_uart_setup (drivers/bluetooth/hci_ldisc.c:438)
       hci_dev_open_sync (net/bluetooth/hci_sync.c:5227)
       hci_power_on (net/bluetooth/hci_core.c:920)
       process_one_work (kernel/workqueue.c:3322)
       worker_thread (kernel/workqueue.c:3486)
       kthread (kernel/kthread.c:436)
       ret_from_fork (arch/x86/kernel/process.c:158)
       ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
    
    Fixes: 2e4edfa1e2bd ("Bluetooth: qca: add missing firmware sanity checks")
    Reported-by: Weiming Shi <bestswngs@gmail.com>
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Xiang Mei <xmei5@asu.edu>
    Reported-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Johan Hovold <johan@kernel.org>
    Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: RFCOMM: Fix session UAF in set_termios [+ + +]
Author: Chengfeng Ye <nicoyip.dev@gmail.com>
Date:   Mon Jul 20 00:03:11 2026 +0800

    Bluetooth: RFCOMM: Fix session UAF in set_termios
    
    commit c783399efc22d035443f1dfbf2a09bf9562aaa5e upstream.
    
    rfcomm_tty_set_termios() tests dlc->session without rfcomm_mutex and
    later passes the pointer to rfcomm_send_rpn(). The latter dereferences
    both session->initiator and session->sock. Meanwhile, krfcommd can
    unlink the DLC and free the session while holding rfcomm_mutex.
    
    The race can proceed as follows:
    
      TTY ioctl task                 krfcommd
      --------------                 --------
      load dlc->session
      enter rfcomm_send_rpn()
                                     lock rfcomm_mutex
                                     clear dlc->session
                                     free session
                                     unlock rfcomm_mutex
      read session->initiator
    
    KASAN reported:
    
      BUG: KASAN: slab-use-after-free in rfcomm_send_rpn+0x297/0x2a0
      Read of size 4 at addr ffff88810012a850 by task poc/92
    
      Call Trace:
       rfcomm_send_rpn+0x297/0x2a0
       rfcomm_tty_set_termios+0x50d/0x850
       tty_set_termios+0x596/0x950
       set_termios+0x46a/0x6e0
       tty_mode_ioctl+0x152/0xbd0
       tty_ioctl+0x915/0x1240
       __x64_sys_ioctl+0x134/0x1c0
    
      Allocated by task 92:
       rfcomm_session_add+0x9e/0x2e0
       rfcomm_dlc_open+0x8b1/0xe00
       rfcomm_dev_activate+0x85/0x1a0
       rfcomm_tty_open+0x90/0x280
    
      Freed by task 68:
       kfree+0x131/0x3c0
       rfcomm_session_del+0x119/0x180
       rfcomm_run+0x737/0x4710
    
    Add rfcomm_dlc_send_rpn(), which holds rfcomm_mutex while it verifies
    that the DLC is still attached and sends the RPN frame. Have the TTY
    path use the helper and drop its unlocked session check. This keeps the
    session valid through both the frame construction and socket send.
    
    Fixes: 3a5e903c09ae ("[Bluetooth]: Implement RFCOMM remote port negotiation")
    Cc: stable@vger.kernel.org
    Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
bnxt_en: Disable EOP for TPA on all chips to prevent data corruption [+ + +]
Author: Michael Chan <michael.chan@broadcom.com>
Date:   Fri Jul 31 12:09:36 2026 -0700

    bnxt_en: Disable EOP for TPA on all chips to prevent data corruption
    
    [ Upstream commit c3faf548a00f4c17100cc9204746975fa46a73b9 ]
    
    EOP (End of frame padding) on the AGG ring may cause overlapping of
    zero padding at the end of one segment with the next segment's data.
    If Relaxed Ordering (RO) is enabled, the zero padding may overwrite
    valid data in the next segment and corrupt the data.  Older chips
    (P5 and older) do not automatically disable RO when EOP is enabled.
    On some ARM systems, data corruption was reported on 57508 (P5)
    chips with RO enabled.
    
    Always disable EOP on all chips on the AGG rings when TPA is enabled
    to fix the data corruption.
    
    Fixes: bfcd8d791ec1 ("bnxt_en: Add fast path logic for TPA on 57500 chips.")
    Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Signed-off-by: Michael Chan <michael.chan@broadcom.com>
    Link: https://patch.msgid.link/20260731190937.807270-5-michael.chan@broadcom.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bnxt_en: Do not set EOP on RX AGG BDs on 5760X chips [+ + +]
Author: Michael Chan <michael.chan@broadcom.com>
Date:   Wed Nov 26 13:56:46 2025 -0800

    bnxt_en: Do not set EOP on RX AGG BDs on 5760X chips
    
    [ Upstream commit 30f253f8d9a01d532fdb7ec6c8a9d4c15fe29241 ]
    
    With End-of-Packet padding (EOP) set, the chip will disable Relaxed
    Ordering (RO) of TPA data packets.  A TPA segment with EOP set will be
    padded to the next cache boundary and can potentially overwrite the
    beginning bytes of the next TPA segment when RO is enabled on 5760X.
    To prevent that, the chip disables RO for TPA when EOP is set.
    
    To take advantge of RO and higher performance, do not set EOP on
    5760X chips when TPA is enabled.  Define a proper RX_BD_FLAGS_AGG_EOP
    constant to make it clear that we are setting EOP.
    
    Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
    Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
    Signed-off-by: Michael Chan <michael.chan@broadcom.com>
    Link: https://patch.msgid.link/20251126215648.1885936-6-michael.chan@broadcom.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: c3faf548a00f ("bnxt_en: Disable EOP for TPA on all chips to prevent data corruption")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bnxt_en: Fix PTP PPS setting bug [+ + +]
Author: Keegan Freyhof <keegan.freyhof@broadcom.com>
Date:   Fri Jul 31 12:09:37 2026 -0700

    bnxt_en: Fix PTP PPS setting bug
    
    [ Upstream commit 80eaf88efec33ac77ed7726d066c4f2f932cc329 ]
    
    The existing driver logic is always turning on PTP_CLK_REQ_PPS
    regardless of the "on" parameter passed to bnxt_ptp_enable().
    During shutdown, PTP_CLK_REQ_PPS may be turned off and this
    bug will do the opposite and may trigger a PCIe PTM request TLP.
    On some systems this can trigger a PCIe AER.
    
    Fix it by properly configuring PTP_CLK_REQ_PPS based on the "on"
    parameter.
    
    Fixes: 9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins")
    Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
    Signed-off-by: Keegan Freyhof <keegan.freyhof@broadcom.com>
    Signed-off-by: Michael Chan <michael.chan@broadcom.com>
    Link: https://patch.msgid.link/20260731190937.807270-6-michael.chan@broadcom.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bonding: alb: re-check primary_is_promisc under RTNL in bond_alb_monitor [+ + +]
Author: Xiang Mei (Microsoft) <xmei5@asu.edu>
Date:   Sat Jul 25 23:39:30 2026 +0000

    bonding: alb: re-check primary_is_promisc under RTNL in bond_alb_monitor
    
    [ Upstream commit 683c6ba6e58e6ed1037831ea97dd58d9c0e76b8d ]
    
    bond_alb_monitor() reads primary_is_promisc under RCU, then drops RCU and
    takes RTNL via rtnl_trylock() before undoing the promiscuity it set on the
    active slave. In that window the active slave can change under RTNL
    (RTM_DELLINK -> __bond_release_one() -> bond_alb_handle_active_change()),
    which already drops the promiscuity and clears primary_is_promisc. The
    monitor still acts on the stale decision: if the slave was removed with no
    failover, curr_active_slave is now NULL and the deref faults; if it failed
    over, the stale dev_set_promiscuity(-1) underflows the new slave's
    promiscuity counter and pins it in IFF_PROMISC.
    
      Oops: general protection fault, probably for non-canonical address ...
      KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
      Workqueue: b42 bond_alb_monitor
      RIP: 0010:bond_alb_monitor (drivers/net/bonding/bond_alb.c:1600)
       process_one_work (kernel/workqueue.c:3322)
       worker_thread (kernel/workqueue.c:3486)
       kthread (kernel/kthread.c:436)
       ret_from_fork (arch/x86/kernel/process.c:158)
      Kernel panic - not syncing: Fatal exception
    
    Re-check primary_is_promisc (and curr_active_slave) after taking RTNL so
    the monitor only undoes an increment it still owns. The other bonding
    monitors already re-read state under RTNL in their commit phase
    (bond_miimon_commit/bond_ab_arp_commit); bond_alb_monitor() was the only
    one acting on the pre-trylock decision.
    
    Fixes: d0e81b7e2246 ("bonding: Acquire correct locks in alb for promisc change")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
    Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
    Acked-by: Jay Vosburgh <jv@jvosburgh.net>
    Link: https://patch.msgid.link/20260725233930.2957317-1-xmei5@asu.edu
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bpf, sockmap: Fix cork use-after-free in tcp_bpf_sendmsg() [+ + +]
Author: Chengfeng Ye <nicoyip.dev@gmail.com>
Date:   Fri Jul 24 18:38:56 2026 +0800

    bpf, sockmap: Fix cork use-after-free in tcp_bpf_sendmsg()
    
    [ Upstream commit 2d66a033864e27ab8d5e44cb36f31d9d2413bee4 ]
    
    tcp_bpf_sendmsg() keeps msg_tx across sk_stream_wait_memory(), which
    drops and reacquires the socket lock.  Its error path tries to decide
    whether msg_tx names the local temporary message by comparing it with
    the current value of psock->cork.
    
    This comparison is unsafe when two threads send on the same socket:
    
      Thread A                         Thread B
      msg_tx = psock->cork
      sk_msg_alloc() fails
      sk_stream_wait_memory()
        releases the socket lock      acquires the socket lock
                                      completes the cork
                                      psock->cork = NULL
                                      frees the cork
        reacquires the socket lock
      msg_tx != psock->cork
      sk_msg_free(msg_tx)
    
    The stale cork is therefore mistaken for the local temporary message
    and freed again.  KASAN reported:
    
      BUG: KASAN: slab-use-after-free in sk_msg_free+0x49/0x50
      Read of size 4 at addr ffff88810c908800 by task poc/90
      Call Trace:
       sk_msg_free+0x49/0x50
       tcp_bpf_sendmsg+0x14f5/0x1cc0
       __sys_sendto+0x32c/0x3a0
       __x64_sys_sendto+0xdb/0x1b0
      Allocated by task 89:
       __kasan_kmalloc+0x8f/0xa0
       tcp_bpf_sendmsg+0x16b3/0x1cc0
      Freed by task 91:
       __kasan_slab_free+0x43/0x70
       kfree+0x131/0x3c0
       tcp_bpf_sendmsg+0xec3/0x1cc0
    
    msg_tx can only name the stack-local tmp or the shared cork. Check for
    tmp directly so a changed psock->cork cannot turn a shared message into
    an apparent local one.
    
    Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
    Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
    Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
    Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
    Link: https://lore.kernel.org/bpf/87fr18lmzo.fsf%40cloudflare.com/
    Link: https://lore.kernel.org/netdev/20260719161630.2901208-1-nicoyip.dev%40gmail.com/ [v1]
    Link: https://patch.msgid.link/20260724103856.3399001-1-nicoyip.dev@gmail.com
    Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bpf, sockmap: Fix sk_redir use-after-free in send verdict [+ + +]
Author: Chengfeng Ye <nicoyip.dev@gmail.com>
Date:   Sun Jul 19 23:22:07 2026 +0800

    bpf, sockmap: Fix sk_redir use-after-free in send verdict
    
    commit a76624733730e541e4955fdecf506af2f6b20558 upstream.
    
    sk_psock_msg_verdict() takes a socket reference for psock->sk_redir.
    tcp_bpf_send_verdict() copies that pointer while holding the source socket
    lock, but does not take a reference for the local copy before dropping the
    lock around tcp_bpf_sendmsg_redir().
    
    When apply_bytes keeps the cached verdict active, another sendmsg() on the
    same source socket can consume the remaining bytes and release the cached
    reference while the first thread still holds only the raw local pointer:
    
      CPU 0                                  CPU 1
      sk_redir = psock->sk_redir
      apply_bytes remains nonzero
      release_sock(sk)
                                             lock_sock(sk)
                                             apply_bytes reaches zero
                                             psock->sk_redir = NULL
                                             release_sock(sk)
                                             tcp_bpf_sendmsg_redir(sk_redir)
                                             sock_put(sk_redir)
      tcp_bpf_sendmsg_redir(sk_redir)
    
    The final sock_put() can free sk_redir before CPU 0 dereferences it.
    
    KASAN reported:
    
      BUG: KASAN: slab-use-after-free in tcp_bpf_sendmsg_redir+0xf39/0x1020
      Read of size 8 at addr ffff888108537090 by task poc/87
      Call Trace:
       tcp_bpf_sendmsg_redir+0xf39/0x1020
       tcp_bpf_sendmsg+0x977/0x1a50
       __sys_sendto+0x32c/0x3a0
       __x64_sys_sendto+0xdb/0x1b0
      Allocated by task 85:
       sk_prot_alloc+0x56/0x210
       sk_clone+0x6f/0x14b0
       inet_csk_clone_lock+0x24/0x740
       tcp_create_openreq_child+0x25/0x2710
       tcp_v4_syn_recv_sock+0x10a/0xe00
      Freed by task 0:
       __kasan_slab_free+0x43/0x70
       slab_free_after_rcu_debug+0xa6/0x1e0
       rcu_core+0x50a/0x1850
      Last potentially related work creation:
       __sk_destruct+0x3da/0x540
       sk_psock_destroy+0x81e/0xab0
       process_one_work+0x63a/0x1070
    
    Take a temporary socket reference while the source socket lock still
    protects psock->sk_redir, and drop it after tcp_bpf_sendmsg_redir()
    returns.  This keeps each unlocked use independent of cached-verdict
    ownership.
    
    Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
    Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
    Reviewed-by: John Fastabend <john.fastabend@gmail.com>
    Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/bpf/20260719152207.2892156-1-nicoyip.dev@gmail.com
    Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
bpf: Fix ld_{abs,ind} failure path analysis in subprogs [+ + +]
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Tue Jul 28 17:54:34 2026 +0800

    bpf: Fix ld_{abs,ind} failure path analysis in subprogs
    
    commit ee861486e377edc55361c08dcbceab3f6b6577bd upstream.
    
    Usage of ld_{abs,ind} instructions got extended into subprogs some time
    ago via commit 09b28d76eac4 ("bpf: Add abnormal return checks."). These
    are only allowed in subprograms when the latter are BTF annotated and
    have scalar return types.
    
    The code generator in bpf_gen_ld_abs() has an abnormal exit path (r0=0 +
    exit) from legacy cBPF times. While the enforcement is on scalar return
    types, the verifier must also simulate the path of abnormal exit if the
    packet data load via ld_{abs,ind} failed.
    
    This is currently not the case. Fix it by having the verifier simulate
    both success and failure paths, and extend it in similar ways as we do
    for tail calls. The success path (r0=unknown, continue to next insn) is
    pushed onto stack for later validation and the r0=0 and return to the
    caller is done on the fall-through side.
    
    Fixes: 09b28d76eac4 ("bpf: Add abnormal return checks.")
    Reported-by: STAR Labs SG <info@starlabs.sg>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/r/20260408191242.526279-2-daniel@iogearbox.net
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    [ Dropped visit_abnormal_return_insn changes: depends on 7.0 symbols from
     e40f5a6bf88a ("bpf: correct stack liveness for tail calls");
     Hunk1: adapted IS_ERR/PTR_ERR to !branch/-EFAULT to match push_stack()
     NULL-on-failure convention;
     Dropped mark_reg_scratched(), which only affects log verbosity, introduced
     by 0f55f9ed21f9 ("bpf: Only print scratched registers and stack slots to
     verifier logs.").]
    Signed-off-by: Philo Lu <lulie@linux.alibaba.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bpf: lwt: Fix dst reference leak on reroute failure [+ + +]
Author: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Date:   Thu Jul 23 14:04:45 2026 +0800

    bpf: lwt: Fix dst reference leak on reroute failure
    
    commit 88c17de85ddb459c3fe1e3c65d61fa366b1cf0a8 upstream.
    
    bpf_lwt_xmit_reroute() obtains a referenced dst from the route
    lookup. When skb_cow_head() fails before that dst is installed on the
    skb, the error path only frees the skb. The skb still owns its previous
    dst, so the newly looked up dst reference is leaked.
    
    Release the new dst reference before freeing the skb on this error
    path.
    
    Fixes: 3bd0b15281af ("bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c")
    Cc: stable@vger.kernel.org
    Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
    Link: https://patch.msgid.link/20260723060445.21926-1-xuanqiang.luo@linux.dev
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

bpf: Preserve pointer state for commuted arithmetic [+ + +]
Author: Yiyang Chen <chenyy23@mails.tsinghua.edu.cn>
Date:   Wed Jul 29 15:18:28 2026 +0000

    bpf: Preserve pointer state for commuted arithmetic
    
    [ Upstream commit a4c6f804b44c5c790269b25e0e61cf4e9f117c86 ]
    
    When scalar += pointer is handled in adjust_ptr_min_max_vals(), the
    destination register inherits the pointer state from the source pointer.
    Copying only selected fields is fragile because pointer provenance is
    tracked by several bpf_reg_state fields.
    
    Use the caller's temporary offset register to preserve the scalar operand
    while replacing the destination with the full pointer state. This preserves
    the frame number for PTR_TO_STACK registers and keeps parent identity
    fields consistent.
    
    Fixes: f4d7e40a5b71 ("bpf: introduce function calls (verification)")
    Signed-off-by: Yiyang Chen <chenyy23@mails.tsinghua.edu.cn>
    Tested-by: Daniel Wade <danjwade95@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Link: https://patch.msgid.link/20260729-c3-035-public-bpf-v4-v4-2-8ee297e2346b@mails.tsinghua.edu.cn
    Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
btrfs: fix root leak if its reloc root is unexpected in merge_reloc_roots() [+ + +]
Author: Filipe Manana <fdmanana@suse.com>
Date:   Thu Jun 11 15:16:21 2026 +0100

    btrfs: fix root leak if its reloc root is unexpected in merge_reloc_roots()
    
    [ Upstream commit ce6050bafb4e33377dc17fcc357736bfc351180c ]
    
    If we have an unexpected reloc_root for our root, we jump to the out label
    but never drop the reference we obtained for root, resulting in a leak.
    Add a missing btrfs_put_root() call.
    
    Fixes: 24213fa46c70 ("btrfs: do proper error handling in merge_reloc_roots")
    Reviewed-by: Qu Wenruo <wqu@suse.com>
    Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Reviewed-by: David Sterba <dsterba@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

btrfs: free mapping node on duplicate reloc root insert [+ + +]
Author: Guanghui Yang <3497809730@qq.com>
Date:   Sun Jul 12 03:17:28 2026 +0000

    btrfs: free mapping node on duplicate reloc root insert
    
    [ Upstream commit 6a8269b6459ed870a8156c106a0f597383907872 ]
    
    __add_reloc_root() allocates a mapping_node before inserting it into
    rc->reloc_root_tree.  If rb_simple_insert() finds an existing entry, it
    returns the existing rb_node and leaves the newly allocated node unlinked.
    
    The error path then returns -EEXIST without freeing the new node.  Since
    the node was never inserted into reloc_root_tree, the later cleanup in
    put_reloc_control() cannot find it either.
    
    Free the newly allocated node before returning -EEXIST.
    
    The callers currently assert that -EEXIST should not happen, so this is a
    defensive cleanup for an unexpected duplicate insert path.  If the path is
    ever reached, the local allocation should still be released.
    
    Fixes: 57a304cfd43b ("btrfs: do not panic in __add_reloc_root")
    Reviewed-by: Qu Wenruo <wqu@suse.com>
    Signed-off-by: Guanghui Yang <3497809730@qq.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

btrfs: reject free space cache with more entries than pages [+ + +]
Author: Xiang Mei <xmei5@asu.edu>
Date:   Wed Jun 10 10:29:26 2026 -0700

    btrfs: reject free space cache with more entries than pages
    
    [ Upstream commit a2d8d5647ed854e38f941741aea45b9eb15a6350 ]
    
    When loading a v1 free space cache, __load_free_space_cache() takes
    num_entries and num_bitmaps straight from the on-disk
    btrfs_free_space_header. That header is stored in the tree_root under a key
    with type 0, which the tree-checker has no case for, so neither count is
    validated before the load trusts it.
    
    The load loops num_entries times and maps the next page whenever the current
    one runs out, going through io_ctl_check_crc() -> io_ctl_map_page(), which
    does io_ctl->pages[io_ctl->index++]. But pages[] is allocated in
    io_ctl_init() from the cache inode's i_size, not from num_entries:
    
            num_pages = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
            io_ctl->pages = kcalloc(num_pages, sizeof(struct page *), GFP_NOFS);
    
    So if num_entries claims more records than the pages can hold, io_ctl->index
    runs off the end of pages[]. The write side never hits this because
    io_ctl_add_entry() and io_ctl_add_bitmap() both stop once
    io_ctl->index >= io_ctl->num_pages; the read side just never had the same
    check.
    
    To trigger it, take a clean cache (num_entries = <N> here), set num_entries
    in the header to 0x10000, and fix up the leaf checksum so it still passes
    the tree-checker. The cache inode has i_size = 65536, so num_pages is 16 and
    pages[] is a 16-pointer (kmalloc-128) array. The load now tries to read
    65536 entries, io_ctl->index walks up to 16, and pages[16] is read past the
    array:
    
      BUG: KASAN: slab-out-of-bounds in io_ctl_check_crc (fs/btrfs/free-space-cache.c:420 fs/btrfs/free-space-cache.c:565)
      Read of size 8 at addr ffff88800c833a80 by task kworker/u8:3/58
       io_ctl_check_crc (fs/btrfs/free-space-cache.c:420 fs/btrfs/free-space-cache.c:565)
       __load_free_space_cache (fs/btrfs/free-space-cache.c:655 fs/btrfs/free-space-cache.c:820)
       load_free_space_cache (fs/btrfs/free-space-cache.c:1017)
       caching_thread (fs/btrfs/block-group.c:880)
       btrfs_work_helper (fs/btrfs/async-thread.c:312)
       process_one_work
       worker_thread
       kthread
       ret_from_fork
    
    free-space-cache.c:420 is io_ctl_map_page(), inlined into io_ctl_check_crc()
    at line 565, which is why that is the frame KASAN names. The out-of-bounds
    slot is then treated as a struct page and handed to crc32c(), so the bad
    read turns into a GP fault.
    
    Add the missing check to io_ctl_check_crc(), which is where both the entry
    loop and the bitmap loop end up. When num_entries is too large the load now
    fails like any corrupt cache: __load_free_space_cache() drops it and rebuilds
    the free space from the extent tree, so a valid cache is never rejected.
    
    Reported-by: Weiming Shi <bestswngs@gmail.com>
    Fixes: 5b0e95bf607d ("Btrfs: inline checksums into the disk free space cache")
    Link: https://lore.kernel.org/linux-btrfs/CAPpSM+RMPByMCKXvM5QFKToxsyNccfuFLWMdD0mfd0wh2Ja62w@mail.gmail.com/
    Assisted-by: Claude:claude-opus-4-8
    Reviewed-by: Qu Wenruo <wqu@suse.com>
    Signed-off-by: Xiang Mei <xmei5@asu.edu>
    Reviewed-by: David Sterba <dsterba@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
can: bcm: add locking when updating filter and timer values [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:42 2026 +0200

    can: bcm: add locking when updating filter and timer values
    
    commit 749179c2e25b95d22499ed29096b3e02d6dfd2b4 upstream.
    
    KCSAN detected a simultaneous access to timer values that can be
    overwritten in bcm_rx_setup() when updating timer and filter content
    while bcm_rx_handler(), bcm_rx_timeout_handler() or bcm_rx_thr_handler()
    run concurrently on incoming CAN traffic.
    
    Protect the timer (ival1/ival2/kt_ival1/kt_ival2/kt_lastmsg) and filter
    (nframes/flags/frames/last_frames) updates in bcm_rx_setup() with a new
    per-op bcm_rx_update_lock, taken with the matching scope in the RX
    handlers. memcpy_from_msg() is staged into a temporary buffer before the
    lock is taken, since it can sleep and must not run under a spinlock.
    
    hrtimer_cancel() is always called without bcm_rx_update_lock held, since
    bcm_rx_timeout_handler()/bcm_rx_thr_handler() take the same lock and a
    running callback would otherwise deadlock against the canceller.
    
    Also close a related race: bcm_rx_setup() cleared the RTR flag in the
    stored reply frame's can_id as a separate, unprotected step after the
    frame content was already installed, so a concurrent bcm_rx_handler()
    could transmit a stale reply with CAN_RTR_FLAG still set. Fold that
    normalization into the initial frame preparation instead (on the staged
    buffer for updates, directly on op->frames pre-registration for new
    ops), so the installed frame is always atomically self-consistent.
    
    bcm_rx_handler()'s RX_RTR_FRAME check now takes a lock-protected
    snapshot of op->flags before deciding whether to call bcm_can_tx(),
    but does not hold the lock across that call.
    
    Also take a lock-protected snapshot of the currframe in bcm_can_tx()
    to avoid partly overwrites by content updates in bcm_tx_setup().
    Finally check if a TX_RESET_MULTI_IDX/SETTIMER might have reset
    op->currframe between the two locked sections in bcm_can_tx().
    
    Omit calling hrtimer_forward() with zero interval in bcm_rx_thr_handler().
    kt_ival2 may have been concurrently cleared by bcm_rx_setup() before it
    cancels this timer, so check kt_ival2 inside the bcm_rx_update_lock.
    
    Fixes: c2aba69d0c36 ("can: bcm: add locking for bcm_op runtime updates")
    Reported-by: syzbot+75e5e4ae00c3b4bb544e@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/linux-can/6975d5cf.a00a0220.33ccc7.0022.GAE@google.com/
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-3-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: add missing device refcount for CAN filter removal [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:46 2026 +0200

    can: bcm: add missing device refcount for CAN filter removal
    
    commit d59948293ea34b6337ce2b5febab8510de70048c upstream.
    
    sashiko-bot remarked a problem with a concurrent device unregistration
    in isotp.c which also is present in the bcm.c code. A former fix for raw.c
    commit c275a176e4b6 ("can: raw: add missing refcount for memory leak fix")
    introduced a netdevice_tracker which solves the issue for bcm.c too.
    
    bcm_release(), bcm_delete_rx_op() and bcm_notifier() relied on
    dev_get_by_index(ifindex) to re-find the device for an rx_op before
    unregistering its filter. If a concurrent NETDEV_UNREGISTER has already
    unlisted the device from the ifindex table, that lookup fails and
    can_rx_unregister() is silently skipped, leaving a stale CAN filter
    pointing at the soon-to-be-freed bcm_op/socket.
    
    Hold a netdev_hold()/netdev_put() tracked reference on op->rx_reg_dev
    from the moment the rx filter is registered in bcm_rx_setup() until it
    is unregistered in bcm_rx_unreg(), and use that reference directly in
    bcm_release() and bcm_delete_rx_op() instead of re-looking the device
    up by ifindex.
    
    Reported-by: sashiko-bot@kernel.org
    Closes: https://sashiko.dev/#/patchset/20260707094716.63578-1-socketcan@hartkopp.net
    Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol")
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-8-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: defer rx_op deallocation to workqueue to fix thrtimer UAF [+ + +]
Author: Lee Jones <lee@kernel.org>
Date:   Tue Jul 28 18:39:44 2026 +0200

    can: bcm: defer rx_op deallocation to workqueue to fix thrtimer UAF
    
    commit 68973f9db76144825e4f35dfdc80fb8279eb2d57 upstream.
    
    Commit f1b4e32aca08 ("can: bcm: use call_rcu() instead of costly
    synchronize_rcu()") replaced synchronize_rcu() in bcm_delete_rx_op()
    with call_rcu() and introduced the RX_NO_AUTOTIMER flag.
    
    However, this flag check was omitted for thrtimer in the packet rx
    fast-path. During BCM RX operation teardown, a concurrent RCU reader
    (bcm_rx_handler) can race and re-arm thrtimer via
    bcm_rx_update_and_send() after call_rcu() has been scheduled.  Once
    the RCU grace period elapses, bcm_op is freed.  The subsequently
    firing thrtimer then dereferences the deallocated op, causing a UAF.
    
    Adding flag checks to the rx fast-path (bcm_rx_update_and_send) does not
    fully close the TOCTOU race and introduces latency for every CAN frame.
    Conversely, calling hrtimer_cancel() directly inside the RCU callback
    (softirq context) is fatal as hrtimer_cancel() can sleep, triggering
    a "scheduling while atomic" panic.
    
    Resolve this by deferring the timer cancellation and memory free to a
    dedicated unbound workqueue (bcm_wq).  The RCU callback now queues a
    work item to bcm_wq, which safely cancels both timers and deallocates
    memory in sleepable process context.  A dedicated workqueue is used to
    prevent system-wide WQ saturation and is cleanly flushed/destroyed
    on module unload to avoid rmmod page faults.
    
    Since the deferred work can now outlive the calling context by an
    unbounded amount, also take a reference on op->sk when it is assigned
    and drop it only once the deferred work has cancelled both timers, so a
    socket can no longer be freed out from under a still-armed timer whose
    callback (bcm_send_to_user()) dereferences op->sk.
    
    Fixes: f1b4e32aca08 ("can: bcm: use call_rcu() instead of costly synchronize_rcu()")
    Tested-by: Feng Xue <feng.xue@outlook.com>
    Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-1-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: extend bcm_tx_lock usage for data and timer updates [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:44 2026 +0200

    can: bcm: extend bcm_tx_lock usage for data and timer updates
    
    commit 12ce799f7ab1e05bd8fbf79e46f403bfe5597ebc upstream.
    
    Stage new CAN frame content for an existing tx op into a kmalloc()'d
    buffer and validate it there, mirroring the approach already used in
    bcm_rx_setup(). Only copy the validated data into op->frames while
    holding op->bcm_tx_lock, so bcm_can_tx() and bcm_tx_timeout_handler()
    can no longer observe a partially updated or unvalidated frame.
    
    Add a missing error path for memcpy_from_msg() when copying CAN frame
    data from userspace.
    
    Also move the kt_ival1/kt_ival2/ival1/ival2 updates in bcm_tx_setup()
    under op->bcm_tx_lock, and read kt_ival1/kt_ival2/count under the same
    lock in bcm_tx_set_expiry() and bcm_tx_timeout_handler(), closing the
    torn 64-bit ktime_t read on 32-bit platforms.
    
    Fixes: c2aba69d0c36 ("can: bcm: add locking for bcm_op runtime updates")
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-6-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: fix CAN frame rx/tx statistics [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:43 2026 +0200

    can: bcm: fix CAN frame rx/tx statistics
    
    commit e6c24ba95fc3f1b5e1dcd28b1c6e59ef61a9daa5 upstream.
    
    KCSAN detected a data race within the bcm_rx_handler() when two CAN frames
    have been simultaneously received and processed in a single rx op by two
    different CPUs.
    
    Use atomic operations with (signed) long data types to access the
    statistics in the hot path to fix the KCSAN complaint.
    
    Additionally simplify the update and check of statistics overflow by
    using the atomic operations in separate bcm_update_[rx|tx]_stats()
    functions. The rx variant runs under bcm_rx_update_lock to prevent
    races when resetting the two rx counters; the tx variant runs under
    bcm_tx_lock and only needs to guard its own counter's overflow.
    
    As the rx path resets its values already at LONG_MAX / 100, there is
    no conflict between the two locking domains (bcm_rx_update_lock vs.
    bcm_tx_lock) even for ops that use both paths.
    
    The rx statistics update and the frames_filtered update in
    bcm_rx_changed() were previously performed in two separate
    bcm_rx_update_lock sections. For an rx op subscribed on all interfaces
    (ifindex == 0), bcm_rx_handler() can run concurrently on different
    CPUs, so a counter reset by one CPU between these two sections could
    leave frames_filtered larger than frames_abs on another CPU, producing
    a bogus (even negative) reduction percentage in procfs. Update the
    statistics in the same critical section as bcm_rx_changed() to close
    this gap, which also removes the now unneeded extra lock/unlock pair
    around the traffic_flags calculation.
    
    Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol")
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-4-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: fix data race on rx_stamp/rx_ifindex in bcm_rx_handler() [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:48 2026 +0200

    can: bcm: fix data race on rx_stamp/rx_ifindex in bcm_rx_handler()
    
    commit 58fd6cbc8541216af1d7ed272ea7ac2b66d50fd8 upstream.
    
    For an rx op subscribed on all interfaces (ifindex == 0), the same op
    is registered once in the shared per-netns wildcard filter list, so
    bcm_rx_handler() can run concurrently on different CPUs for frames
    arriving on different net devices.
    
    op->rx_stamp and op->rx_ifindex were written before bcm_rx_update_lock was
    taken, allowing concurrent writers to race each other - including a torn
    store of the 64-bit rx_stamp on 32-bit platforms.
    
    Beyond a torn store bcm_send_to_user() must report the timestamp/ifindex
    of the very same frame whose content it is delivering. So the assignment
    is placed in the same unbroken bcm_rx_update_lock section as the content
    comparison.
    
    As a side effect, the RTR-request frame feature (which never reach
    bcm_send_to_user()) no longer updates rx_stamp/rx_ifindex, since only
    the notification path needs them.
    
    Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol")
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/linux-can/20260707145135.5BC831F00A3A@smtp.kernel.org/
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-10-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: fix stale rx/tx ops after device removal [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:47 2026 +0200

    can: bcm: fix stale rx/tx ops after device removal
    
    commit 3b762c0d950383ab7a002686c9136b9aa55d2d70 upstream.
    
    RX: an RX_SETUP update(!) for an existing op skipped can_rx_register()
    unconditionally, even when a concurrent NETDEV_UNREGISTER had already
    torn down its registration (op->rx_reg_dev == NULL). This silently
    did not re-enable frame delivery for that updated filter. bcm_rx_setup()
    now re-registers in that case, while leaving rx_ops with ifindex = 0
    (all CAN devices) which never carry a tracked rx_reg_dev registered as-is.
    
    TX: bcm_notify() only handled bo->rx_ops on NETDEV_UNREGISTER, leaving
    tx_ops with an active cyclic transmission re-arming its hrtimer
    indefinitely to execute bcm_tx_timeout_handler(). Cancelling the hrtimer
    prevents the runaway timer and any injection into a later reused ifindex,
    since nothing else calls bcm_can_tx() for the op until an explicit
    TX_SETUP update re-arms it.
    
    Unlike bcm_rx_unreg(), which clears the tracked rx_reg_dev for rx_ops,
    the ifindex is intentionally left unchanged for tx_ops. bcm_tx_setup()
    always rejects ifindex 0, so clearing it would strand the op: neither a
    later TX_SETUP (bcm_find_op()) nor TX_DELETE (bcm_delete_tx_op()) could
    ever find it again, since both require an exact ifindex match.
    
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/linux-can/20260708094536.DDF821F00A3A@smtp.kernel.org/
    Closes: https://lore.kernel.org/linux-can/20260708154039.347ED1F000E9@smtp.kernel.org/
    Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol")
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-9-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: track a single source interface for ANYDEV timeout/throttle ops [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:49 2026 +0200

    can: bcm: track a single source interface for ANYDEV timeout/throttle ops
    
    commit 2f5976f54a04e9f18b25283036ac3136be453b17 upstream.
    
    An ANYDEV rx op (ifindex == 0) with an active RX timeout and/or
    throttle timer has no defined semantics when matching frames arrive
    from several interfaces: bcm_rx_handler() can run concurrently for
    the same op on different CPUs, racing hrtimer_cancel()/
    bcm_rx_starttimer() against bcm_rx_timeout_handler() and causing
    spurious RX_TIMEOUT notifications and last_frames corruption. The
    same concurrency lets throttled multiplex frames from different
    interfaces clobber the single rx_ifindex/rx_stamp fields shared by
    the op.
    
    Add op->if_detected to track the first interface that delivers a
    matching frame while a timeout/throttle timer is configured, and
    reject frames from any other interface for that op. The claim is
    decided in bcm_rx_handler() before hrtimer_cancel() touches
    op->timer, so a rejected frame can never disturb the claimed
    interface's watchdog. RTR-mode ops are excluded via RX_RTR_FRAME,
    independent of kt_ival1/kt_ival2, since those may briefly hold a
    stale value from an earlier non-RTR configuration.
    
    The claim is released in bcm_notify() on NETDEV_UNREGISTER and in
    bcm_rx_setup() when SETTIMER reconfigures the timer values.
    
    A (re-)claim is only possible on CAN devices in NETREG_REGISTERED
    dev->reg_state to cover the release in bcm_notify() where reg_state
    becomes NETREG_UNREGISTERING until synchronize_net().
    
    Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol")
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/linux-can/20260709105031.1A39C1F000E9@smtp.kernel.org/
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-11-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: bcm: validate frame length in bcm_rx_setup() for RTR replies [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:21:45 2026 +0200

    can: bcm: validate frame length in bcm_rx_setup() for RTR replies
    
    commit 62ec41f364648be79d54d94d0d240ee326948afd upstream.
    
    bcm_tx_setup() validates cf->len against the CAN/CAN FD DLC limits
    before installing frames for TX_SETUP, but bcm_rx_setup() never did
    the same for the RTR-reply frame configured via RX_SETUP with
    RX_RTR_FRAME.
    
    Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol")
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260714-bcm_fixes-v15-7-562f7e3e42da@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: c_can: c_can_chip_config(): keep controller in init mode until bittiming is configured [+ + +]
Author: Lucas Martins Alves <lucas.alves@lumal21.com.br>
Date:   Tue Jul 14 16:48:57 2026 +0000

    can: c_can: c_can_chip_config(): keep controller in init mode until bittiming is configured
    
    commit 26504844613fb44c7cab1c5f6fcff77861709baa upstream.
    
    c_can_chip_config() was programming C_CAN_CTRL_REG without CONTROL_INIT,
    which may allow the controller to become active before
    c_can_set_bittiming() finishes.
    
    That creates a short timing window where the peripheral can interact with
    the bus using a different/default bitrate, potentially generating bus
    errors and corrupting traffic.
    
    Set CONTROL_INIT together with the control-mode writes in
    c_can_chip_config() (normal, loopback and listen-only paths), so the
    controller stays halted until bit timing is fully programmed.
    
    This prevents transient bus disturbance during startup when the configured
    bitrate differs from the active bus bitrate.
    
    Signed-off-by: Lucas Martins Alves <lucas.alves@lumal21.com.br>
    Link: https://patch.msgid.link/20260714164839.771123-1-lucas.alves@lumal21.com.br
    Fixes: 881ff67ad450 ("can: c_can: Added support for Bosch C_CAN controller")
    Cc: stable@kernel.org
    [mkl: remove space before close parenthesis]
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: ems_usb: validate CPC message lengths [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Mon Jul 6 17:27:52 2026 +0800

    can: ems_usb: validate CPC message lengths
    
    commit 02925f51377f2a42a6724f00549167499c9302e5 upstream.
    
    ems_usb_read_bulk_callback() walks CPC messages packed in one USB
    receive buffer.
    
    Check that each declared message fits in the URB payload. Also require the
    type-specific payload to cover the fields used by the CAN, state, error and
    overrun handlers.
    
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Link: https://patch.msgid.link/20260706092752.79600-1-pengpeng@iscas.ac.cn
    Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
    Cc: stable@vger.kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: etas_es58x: es58x_read_bulk_callback(): fix RX buffer leak on URB resubmit failure [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Mon Jul 6 09:46:01 2026 +0800

    can: etas_es58x: es58x_read_bulk_callback(): fix RX buffer leak on URB resubmit failure
    
    commit 7a0cf2b2497c757c3cb1286eddf2986abb0d387b upstream.
    
    es58x_read_bulk_callback() resubmits the RX URB after processing a received
    packet. If the resubmit succeeds, the URB remains anchored and will be
    handled by the normal RX path or by teardown.
    
    However, if usb_submit_urb() fails, the callback unanchors the URB and then
    returns directly. This skips the existing free_urb path, so the coherent
    transfer buffer allocated with usb_alloc_coherent() is not released.
    
    Reuse the existing free_urb path after a resubmit failure so that the RX
    coherent buffer is freed before leaving the callback.
    
    Fixes: 5eaad4f76826 ("can: usb: etas_es58x: correctly anchor the urb in the read bulk callback")
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
    Link: https://patch.msgid.link/20260706014601.415445-1-lgs201920130244@gmail.com
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: isotp: check register_netdevice_notifier() error in module init [+ + +]
Author: Minhong He <heminhong@kylinos.cn>
Date:   Wed Jul 29 16:56:56 2026 +0800

    can: isotp: check register_netdevice_notifier() error in module init
    
    [ Upstream commit ef09a13c5afac41a3c4b5f22b8572820d9e7518c ]
    
    Register the netdevice notifier before can_proto_register() and check the
    return value. If protocol registration fails, unregister the notifier
    before returning the error.
    
    Align isotp_module_init() with the reordering already done for raw.c
    (commit c28b3bffe49e ("can: raw: process optimization in raw_init()")) and
    bcm.c (commit edd1a7e42f1d ("can: bcm: registration process optimization
    in bcm_module_init()")).
    
    Fixes: 8d0caedb7596 ("can: bcm/raw/isotp: use per module netdevice notifier")
    Signed-off-by: Minhong He <heminhong@kylinos.cn>
    Link: https://patch.msgid.link/20260729085656.134523-1-heminhong@kylinos.cn
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: isotp: fix use-after-free race with concurrent NETDEV_UNREGISTER [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:32:49 2026 +0200

    can: isotp: fix use-after-free race with concurrent NETDEV_UNREGISTER
    
    commit 20bab8b88baac140ca3701116e1d486c7f51e311 upstream.
    
    isotp_release() looked up the bound network device via dev_get_by_index()
    using the stored ifindex. During device unregistration the device is
    unlisted from the ifindex hash before the NETDEV_UNREGISTER notifier
    chain runs, so a concurrent isotp_release() could find no device, skip
    can_rx_unregister() entirely, and still proceed to free the socket.
    Since isotp_release() had already removed itself from the isotp
    notifier list at that point, isotp_notify() would never get a chance to
    clean up either, leaving a stale CAN filter that keeps pointing at the
    freed socket.
    
    Fix this the same way raw.c already does: hold a tracked reference to
    the bound net_device in the socket (so->dev/so->dev_tracker) from
    bind() onward instead of re-resolving it from the ifindex, and
    serialize bind()/release() with rtnl_lock() so that so->dev is always
    consistent with what the NETDEV_UNREGISTER notifier sees. so->dev
    stays valid regardless of ifindex-hash unlisting, and is only ever
    cleared by whichever of isotp_release()/isotp_notify() gets there
    first, so the filter is always removed exactly once.
    
    isotp_bind() now rejects a (re)bind with -EAGAIN while so->[tx|rx].state
    isn't ISOTP_IDLE yet, so a timer left running by a prior
    NETDEV_UNREGISTER can't act on a newly bound so->ifindex. Both checks
    share the same lock_sock() section, so there is no window in which a
    concurrent isotp_notify() clearing so->bound could be missed.
    
    Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/linux-can/20260707101420.47F261F000E9@smtp.kernel.org/
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260712-isotp-fixes-v10-2-793a1b1ce17f@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: isotp: serialize TX state transitions under so->rx_lock [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Fri Jul 24 12:32:50 2026 +0200

    can: isotp: serialize TX state transitions under so->rx_lock
    
    commit cf070fe33bfbd1a4c21236078fadb35dd223a157 upstream.
    
    The TX state machine (so->tx.state) is driven from three contexts:
    sendmsg() claiming and progressing a transfer, the RX path consuming
    Flow Control/echo frames, and two hrtimers timing out a stalled
    transfer. Mixing a lock-free cmpxchg() claim in sendmsg() with
    hrtimer_cancel() calls made under so->rx_lock elsewhere left windows
    where a frame or timer callback could act on a state that had already
    moved on, corrupting an unrelated transfer.
    
    so->rx_lock now covers the full lifecycle of a TX claim: sendmsg()
    takes it to check so->tx.state is ISOTP_IDLE, switch it to
    ISOTP_SENDING, bump so->tx_gen and drain the previous transfer's
    timers - all as one critical section. isotp_rcv_fc()/isotp_rcv_cf()
    already run under this lock via isotp_rcv(), and isotp_rcv_echo() now
    takes it itself, so none of them can ever observe a transfer mid-claim.
    This also means a transfer can no longer be handed to sendmsg()'s
    cleanup paths (signal or send error) while another thread is
    concurrently claiming or finishing it, so those paths can cancel
    timers and reset the state unconditionally.
    
    isotp_release() claims the socket the same way, so a racing sendmsg()
    sees a consistent ISOTP_SHUTDOWN and skips arming its timer or sending.
    
    Only the hrtimer callbacks stay outside so->rx_lock, since they run
    under so->rx_lock's cancellation elsewhere and taking it themselves
    would deadlock. so->tx_gen lets them recognize whether the transfer
    they timed out is still the one currently active, so they don't
    report an error against a transfer that has since completed or been
    superseded.
    
    Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/linux-can/20260710142146.BDAE61F000E9@smtp.kernel.org/
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20260712-isotp-fixes-v10-3-793a1b1ce17f@hartkopp.net
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: j1939: fix lockless local-destination check [+ + +]
Author: Shuhao Fu <sfual@cse.ust.hk>
Date:   Thu May 7 10:22:26 2026 +0200

    can: j1939: fix lockless local-destination check
    
    [ Upstream commit e4e8af62adab2fdcca230006f829407a953070cd ]
    
    j1939_priv.ents[].nusers is documented as protected by priv->lock, and
    its updates already happen under that lock. j1939_can_recv() also reads
    it under read_lock_bh(). However, j1939_session_skb_queue() and
    j1939_tp_send() still read priv->ents[da].nusers without taking the
    lock.
    
    Those transport-side checks decide whether to set J1939_ECU_LOCAL_DST, so
    they can race with j1939_local_ecu_get() and j1939_local_ecu_put() while
    userspace is binding or releasing sockets concurrently with TP traffic.
    This can misclassify TP/ETP sessions as local or remote and take the wrong
    transport path.
    
    Fix both transport paths by routing the destination-locality check through
    a helper that reads ents[].nusers under read_lock_bh(&priv->lock).
    
    Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
    Signed-off-by: Shuhao Fu <sfual@cse.ust.hk>
    Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Link: https://patch.msgid.link/20260419140614.GA4041240@chcpu16
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: j1939: transport: j1939_session_fresh_new(): initialize receive buffer [+ + +]
Author: Oleksij Rempel <o.rempel@pengutronix.de>
Date:   Tue Jul 28 07:58:35 2026 +0200

    can: j1939: transport: j1939_session_fresh_new(): initialize receive buffer
    
    commit eb96c58907922546e415e545fe9a14ea63b02719 upstream.
    
    Zero the allocated buffer in j1939_session_fresh_new() to ensure it
    contains no residual data.
    
    While there is a potential performance impact if users allocate maximum
    sized ETP buffers, most real-world use cases are not noticeably affected
    since the maximum known buffer size is typically around 65K.
    
    Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
    Reported-by: Ji'an Zhou <eilaimemedsnaimel@gmail.com>
    Message-ID: <CAPAUci5dykCLjoijqkUtFqJFesgncrD7+S6y_V=gjbFkY2Tifg@mail.gmail.com>
    Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Link: https://patch.msgid.link/20260728055835.1151785-3-o.rempel@pengutronix.de
    Cc: stable@kernel.org
    [mkl: add Message-ID]
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: kvaser_usb: kvaser_usb_hydra_get_busparams(): fix memory leak in kvaser_usb_hydra_get_busparams() [+ + +]
Author: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Date:   Wed Jul 22 16:09:03 2026 +0530

    can: kvaser_usb: kvaser_usb_hydra_get_busparams(): fix memory leak in kvaser_usb_hydra_get_busparams()
    
    commit 941eaf9a6d3b33dea49f2c0a1da7546a03b6ff71 upstream.
    
    The memory allocated for cmd is not freed after the call to
    kvaser_usb_send_cmd() in both the normal and error paths.
    Fix that by adding a kfree() immediately after the call.
    
    Fixes: 39d3df6b0ea8 ("can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming")
    Cc: stable@vger.kernel.org
    Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
    Link: https://patch.msgid.link/20260722103906.108571-1-nihaal@cse.iitm.ac.in
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: kvaser_usb_leaf: kvaser_usb_leaf_wait_cmd(): validate received command extents [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Wed Jul 22 12:22:21 2026 +0800

    can: kvaser_usb_leaf: kvaser_usb_leaf_wait_cmd(): validate received command extents
    
    commit 0293dd153f9dbc1ddf5dacdccc76b363bce4a8ee upstream.
    
    The wait and bulk receive paths walk variable-length commands from a
    USB buffer. A nonzero command shorter than CMD_HEADER_LEN can still be
    dispatched, and the wait path copies a matching command into a fixed
    caller-owned struct kvaser_cmd using the device-provided length.
    
    Reject nonzero commands that do not contain the fixed header or that
    extend beyond the current USB buffer item. In the wait path, also reject
    a matching command that exceeds the destination before copying it.
    
    Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Link: https://patch.msgid.link/20260722042221.44066-1-pengpeng@iscas.ac.cn
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: peak_usb: add bounds check for USB channel index [+ + +]
Author: James Gao <jamesgao5@outlook.com>
Date:   Wed May 20 13:40:03 2026 +0800

    can: peak_usb: add bounds check for USB channel index
    
    commit 39132f166ca8ce00ae60d8a9068e06a60943cc4b upstream.
    
    The channel control index ctrl_idx is derived from rx->len which comes
    directly from a device USB payload. The mask 0x0f allows values 0-15, but
    the array size of usb_if->dev[] is only 2. Values 2-15 cause heap
    out-of-bounds read, eventually causing kernel panic in the IRQ context.
    
    Add bounds checking for ctrl_idx before the array access in both
    pcan_usb_pro_handle_canmsg() and pcan_usb_pro_handle_error().
    
    Fixes: d8a199355f8f ("can: usb: PEAK-System Technik PCAN-USB Pro specific part")
    Signed-off-by: James Gao <jamesgao5@outlook.com>
    Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
    Link: https://patch.msgid.link/TYWPR01MB8559DBAAAA6A7F410400329CF0012@TYWPR01MB8559.jpnprd01.prod.outlook.com
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: peak_usb: peak_usb_start(): fix double free of transfer buffer on URB submit error [+ + +]
Author: Maoyi Xie <maoyixie.tju@gmail.com>
Date:   Wed Jun 17 02:15:31 2026 +0800

    can: peak_usb: peak_usb_start(): fix double free of transfer buffer on URB submit error
    
    commit 9b3d5a6d952c38bbcf07f903cbeadefdb56b9bc9 upstream.
    
    In peak_usb_start(), each RX URB transfer buffer is allocated with kmalloc()
    and the URB is flagged URB_FREE_BUFFER so that the final usb_free_urb() also
    frees the transfer buffer.
    
    If usb_submit_urb() fails, the error path frees the buffer explicitly with
    kfree(buf) and then calls usb_free_urb(urb). Because URB_FREE_BUFFER is set,
    usb_free_urb() -> urb_destroy() frees the same buffer a second time, a double
    free of the transfer buffer.
    
      BUG: KASAN: double-free in usb_free_urb.part.0+0x91/0xb0
      Free of addr ffff8881069ccb80 by task trigger.sh/285
    
      Call Trace:
       kfree+0x113/0x3c0
       usb_free_urb.part.0+0x91/0xb0
    
    Drop the redundant kfree(buf); usb_free_urb() already releases the transfer
    buffer. This mirrors commit 03819abbeb11 ("net: usb: lan78xx: Fix double free
    issue with interrupt buffer allocation").
    
    Fixes: bb4785551f64 ("can: usb: PEAK-System Technik USB adapters driver core")
    Closes: https://lore.kernel.org/linux-can/178159320216.2154888.16953451793788581739@maoyixie.com/T/#u
    Cc: stable@vger.kernel.org
    Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>
    Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
    Link: https://patch.msgid.link/178163373110.2507866.216458825145756798@maoyixie.com
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: peak_usb: validate uCAN receive record lengths [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Mon Jul 6 17:28:36 2026 +0800

    can: peak_usb: validate uCAN receive record lengths
    
    commit 93fcab2c6968446316bbb49548848df604d6346f upstream.
    
    pcan_usb_fd_decode_buf() walks uCAN records packed in one USB
    receive buffer.
    
    Require each record to contain the fixed header for its type, and verify
    CAN payload bytes before copying them into the skb.
    
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Link: https://patch.msgid.link/20260706092836.79754-1-pengpeng@iscas.ac.cn
    Fixes: 0a25e1f4f185 ("can: peak_usb: add support for PEAK new CANFD USB adapters")
    Cc: stable@vger.kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: softing: fw_parse(): validate firmware record spans [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Wed Jul 22 12:43:47 2026 +0800

    can: softing: fw_parse(): validate firmware record spans
    
    commit 856d6cb04e5407523566b075841dcd6423757d1c upstream.
    
    fw_parse() reads a fixed record header, a firmware-provided payload,
    and a trailing checksum without knowing the end of the firmware blob. A
    truncated record can therefore make those reads exceed the blob.
    
    The same record also supplies addresses and lengths for writes into
    DPRAM. The generic loader uses wrap-prone mixed signed arithmetic for its
    bounds check, while the application loader does not bound the staging
    copy at all.
    
    Pass the firmware end to the parser and validate the full source record.
    Use a signed wide offset for generic DPRAM records and validate the
    application staging span against the mapped DPRAM before copying.
    
    Fixes: 03fd3cf5a179 ("can: add driver for Softing card")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Link: https://patch.msgid.link/20260722044347.2708-1-pengpeng@iscas.ac.cn
    Cc: stable@kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
cdrom: fix stack out-of-bounds read in CDROMVOLCTRL [+ + +]
Author: Xu Rao <raoxu@uniontech.com>
Date:   Mon Jul 20 20:44:21 2026 +0100

    cdrom: fix stack out-of-bounds read in CDROMVOLCTRL
    
    commit b27e195d4db8dea263050bdbeb11881b2999c9c6 upstream.
    
    mmc_ioctl_cdrom_volume() first reads the audio control mode page into a
    32-byte stack buffer with cgc->buflen set to 24.  If the device reports a
    block descriptor, the function increases cgc->buflen to include that
    descriptor and reads the page again.
    
    For CDROMVOLCTRL, the function then builds a MODE SELECT parameter list
    by moving cgc->buffer forward by offset - 8 bytes.  This drops the block
    descriptor from the outgoing payload and leaves a new 8-byte mode
    parameter header in front of the audio control page.  However, cgc->buflen
    is left unchanged.
    
    With a standard 8-byte block descriptor, cgc->buffer points at buffer + 8
    but cgc->buflen remains 32.  cdrom_mode_select() therefore asks the low
    level packet path to write 32 bytes from that adjusted pointer, reading 8
    bytes past the end of the 32-byte stack buffer.
    
    This is not hit by CDROMVOLREAD, and CDROMVOLCTRL only triggers it on
    drives that return a non-zero block descriptor length, which helps explain
    why it has gone unnoticed.  The overread is also sent to the device as
    extra MODE SELECT payload, so it may not produce an obvious local failure.
    
    Reduce cgc->buflen by the same amount as the buffer pointer adjustment so
    the MODE SELECT transfer covers only the intended parameter list.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Xu Rao <raoxu@uniontech.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://patch.msgid.link/20260720194421.1497-2-phil@philpotter.co.uk
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ceph: fix pre-auth out-of-bounds read on snaptrace in ceph_handle_caps() [+ + +]
Author: Bryam Vargas <hexlabsecurity@proton.me>
Date:   Fri May 29 00:37:24 2026 +0000

    ceph: fix pre-auth out-of-bounds read on snaptrace in ceph_handle_caps()
    
    commit 4dbc71bcaf9a30abf3920a4e2cc4ed33bba78c02 upstream.
    
    ceph_handle_caps() reads snap_trace_len from the wire-format
    ceph_mds_caps header and uses it unconditionally to build a fake
    end pointer (snaptrace + snaptrace_len) that is later handed to
    ceph_update_snap_trace() in the CEPH_CAP_OP_IMPORT case:
    
        snaptrace     = h + 1;
        snaptrace_len = le32_to_cpu(h->snap_trace_len);
        p             = snaptrace + snaptrace_len;
        ...
        case CEPH_CAP_OP_IMPORT:
            if (snaptrace_len) {
                ...
                if (ceph_update_snap_trace(mdsc, snaptrace,
                                           snaptrace + snaptrace_len,
                                           false, &realm)) { ... }
    
    ceph_update_snap_trace() then decodes a struct ceph_mds_snap_realm
    from snaptrace using ceph_decode_need(&p, e, sizeof(*ri), bad)
    with the attacker-supplied fake end e == snaptrace + snaptrace_len.
    With snaptrace_len == 0xFFFFFFFF the bound check is trivially
    satisfied, ri = p reads sizeof(struct ceph_mds_snap_realm) past
    the legitimate msg->front buffer, and ri->num_snaps /
    ri->num_prior_parent_snaps then drive further out-of-bounds
    reads of the encoded snap arrays.
    
    The eleven msg_version >= 2 .. msg_version >= 12 decoder blocks
    above the op switch each catch this OOB through their
    ceph_decode_*_safe() / ceph_decode_need() helpers, but they sit
    behind a hdr.version-gated if, so a malicious or compromised
    MDS that sets msg->hdr.version = 1 reaches the IMPORT path with
    no version-gated decoder having validated snap_trace_len. The
    shape has been present since ceph_handle_caps() was introduced.
    
    Validate snap_trace_len against the message front buffer before
    consuming it, using the canonical ceph_decode_need() / ceph_has_room()
    helper.  The helper bounds the length with subtraction (n <= end - p,
    guarded by end >= p) rather than pointer addition, so it is wrap-safe
    for the attacker-controlled u32 length on 32-bit builds where
    p + snap_trace_len could overflow the address space.  This matches the
    rest of the ceph decode path (e.g. the pool_ns_len check a few lines
    below), and the existing goto bad cleanup already covers this exit
    path.
    
    Cc: stable@vger.kernel.org
    Fixes: a8599bd821d0 ("ceph: capability management")
    Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
    Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
comedi: comedi_parport: deal with premature interrupt [+ + +]
Author: Ian Abbott <abbotti@mev.co.uk>
Date:   Wed May 27 13:51:03 2026 +0100

    comedi: comedi_parport: deal with premature interrupt
    
    commit 17221216ae8ce6a24e8a4e787382e3ebc81b88a8 upstream.
    
    Syzbot reported a general protection fault in
    `comedi_get_is_subdevice_running()`, which was called from the interrupt
    handler `parport_interrupt()` in the "comedi_parport" driver, but it
    does not currently have a C reproducer for the problem.  It's
    probably due to a premature interrupt for one of two reasons:
    
    1. The driver sets up the interrupt handler before the comedi subdevices
       used by the interrupt handler have been allocated, but does not
       disable the interrupt in the parallel port's CTRL register first.
    2. The driver uses a user-supplied I/O port base address which Syzbot
       would have supplied, but it might not be backed by real parallel port
       hardware.
    
    Change the initialization order in the driver's comedi "attach" handler
    (`parport_attach()`) so that the hardware registers are initialized
    before the interrupt handler is requested.  This should prevent
    premature interrupts occurring for real hardware.
    
    Also add a test to the interrupt handler to ensure the comedi device is
    fully attached and return early if it isn't.
    
    Fixes: 241ab6ad7108e ("Staging: comedi: add comedi_parport driver")
    Reported-by: syzbot+f24c3d5d316011bacc70@syzkaller.appspotmail.com
    Cc: stable <stable@kernel.org>
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Link: https://patch.msgid.link/20260527125104.96596-1-abbotti@mev.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
counter: microchip-tcb-capture: Fix DT channel validation [+ + +]
Author: Babanpreet Singh <bbnpreetsingh@gmail.com>
Date:   Tue Jul 14 04:29:10 2026 +0000

    counter: microchip-tcb-capture: Fix DT channel validation
    
    [ Upstream commit f1a3a9946aab611dd2200c01ff122f64b033dad2 ]
    
    mchp_tc_probe() reads the devicetree "reg" cell - a u32, per the API
    contract of of_property_read_u32_index() - into a signed int, so the
    bounds check "channel > 2" fails to reject cell values at or above
    0x80000000: reinterpreted as a negative int, they compare below 2 and
    pass validation.
    
    A malformed devicetree can therefore drive a negative channel into the
    ATMEL_TC_REG() offset arithmetic, making the driver access syscon
    regmap offsets outside the TC block's register window, and into the
    "t%d_clk" clock-name formatting, where it truncates clk_name (sized
    for "t0_clk".."t2_clk").
    
    Declare channel as u32, matching the API contract; the unsigned
    comparison then rejects everything except channels 0..2. Adjust the
    format specifier to %u accordingly, which also resolves the W=1
    warning that exposed the gap:
    
      microchip-tcb-capture.c:520:56: warning: '%d' directive output may
        be truncated writing between 1 and 11 bytes into a region of size
        6 [-Wformat-truncation=]
      note: directive argument in the range [-2147483648, 2]
    
    No behavior change for well-formed devicetrees: channels 0..2 take
    identical paths before and after.
    
    Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
    Assisted-by: Claude:claude-fable-5 [gcc W=1]
    Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
    Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
    Link: https://lore.kernel.org/r/20260714042910.7-1-bbnpreetsingh@gmail.com
    Signed-off-by: William Breathitt Gray <wbg@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
cpufreq: powernow-k8: Fix possible memory leak in powernowk8_cpu_init() [+ + +]
Author: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Date:   Mon Jul 27 15:05:51 2026 +0530

    cpufreq: powernow-k8: Fix possible memory leak in powernowk8_cpu_init()
    
    commit d5f8e5f6040d052d44fcbf4f31dd35145c0c8d7d upstream.
    
    The memory allocated for data->powernow_table inside
    powernow_k8_cpu_init_acpi() or find_psb_table() is not freed in one of
    the error paths in powernowk8_cpu_init(). Fix that by adding a kfree().
    
    Fixes: 1ff6e97f1d99 ("[CPUFREQ] cpumask: avoid playing with cpus_allowed in powernow-k8.c")
    Cc: stable@vger.kernel.org
    Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260727093553.98246-1-nihaal@cse.iitm.ac.in
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
crypto: rsa-pkcs1pad: Don't WARN on an empty digest [+ + +]
Author: Doruk Tan Ozturk <doruk@0sec.ai>
Date:   Mon Jul 20 21:15:33 2026 +0200

    crypto: rsa-pkcs1pad: Don't WARN on an empty digest
    
    KEYCTL_PKEY_VERIFY lets an unprivileged caller supply a zero-length
    digest (in_len == 0).  keyctl_pkey_params_get_2() accepts the zero
    length and the request reaches pkcs1pad_verify(), where the empty
    digest is rejected but only after being passed through
    WARN_ON(!req->dst_len).  The warning is therefore directly
    user-triggerable, and on kernels built with panic_on_warn=1 an
    unprivileged process can panic the machine -- a local denial of
    service.  Reproduced as UID 65534 in a setuid sandbox.
    
    Keep rejecting the invalid request with -EINVAL, but do not emit a
    warning for the user-controlled length.
    
    This is the 5.10.y/5.15.y form of the fix, where the length is read
    directly from req->dst_len rather than cached in a digest_size local.
    Mainline does not contain this code path; commit 1e562deacecc
    ("crypto: rsassa-pkcs1 - Migrate to sig_alg backend") removed
    pkcs1pad_verify() in v6.13-rc1.  This is a minimal fix for the
    affected stable branches.  The 6.1.y/6.6.y/6.12.y form
    (WARN_ON(!digest_size)) is sent as a separate patch.
    
    Found by 0sec automated security-research tooling (https://0sec.ai).
    
    Fixes: c7381b012872 ("crypto: akcipher - new verify API for public key algorithms")
    Cc: stable@vger.kernel.org
    Assisted-by: 0sec:multi-model
    Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
    Reviewed-by: Lukas Wunner <lukas@wunner.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dmaengine: qcom: bam_dma: Fix command element mask field for BAM v1.6.0+ [+ + +]
Author: Md Sadre Alam <md.alam@oss.qualcomm.com>
Date:   Mon Jun 15 11:39:08 2026 +0530

    dmaengine: qcom: bam_dma: Fix command element mask field for BAM v1.6.0+
    
    commit 867621ba203027338b525af6729719c544135336 upstream.
    
    BAM version 1.6.0 and later changed the behavior of the mask field in
    command elements for read operations.
    
    In older BAM versions, or prior implementation assumptions, the mask
    field was effectively ignored for read commands. However, starting from
    BAM v1.6.0, the mask field for read commands is repurposed to carry the
    upper 4 bits of the destination address, enabling support for 36-bit
    addressing. For write commands, the mask field continues to function as
    a traditional write mask.
    
    The current driver sets mask = 0xffffffff for all command elements.
    While this works for write operations, it breaks read operations on
    BAM v1.6.0+ hardware. In such cases, the hardware interprets the upper
    address bits as 0xf, resulting in an invalid destination address
    (0xf_xxxxxxxx instead of 0x0_xxxxxxxx).
    
    This leads to failures such as NAND enumeration issues observed on
    platforms like IPQ5424.
    
    Fix this by assigning the mask field based on command type:
      - For read commands: set mask = 0 (upper address bits = 0)
      - For write commands: retain mask = 0xffffffff
    
    Also update the bam_cmd_element structure documentation to reflect the
    dual purpose of the mask field across BAM versions.
    
    This ensures correct behavior on BAM v1.6.0+ while maintaining backward
    compatibility with older hardware.
    
    Fixes: dfebb055f73a2 ("dmaengine: qcom: bam_dma: wrapper functions for command descriptor")
    Tested-by: Lakshmi Sowjanya D <lakshmi.d@oss.qualcomm.com>
    Signed-off-by: Md Sadre Alam <md.alam@oss.qualcomm.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260615060908.1263171-1-varadarajan.narayanan@oss.qualcomm.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

dmaengine: sh: rz-dmac: Move interrupt request after everything is set up [+ + +]
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Date:   Fri Jul 24 14:55:37 2026 +0200

    dmaengine: sh: rz-dmac: Move interrupt request after everything is set up
    
    commit 731712403ddb39d1a76a11abf339a0615bc85de7 upstream.
    
    Once the interrupt is requested, the interrupt handler may run immediately.
    Since the IRQ handler can access channel->ch_base, which is initialized
    only after requesting the IRQ, this may lead to invalid memory access.
    Likewise, the IRQ thread may access uninitialized data (the ld_free,
    ld_queue, and ld_active lists), which may also lead to issues.
    
    Request the interrupts only after everything is set up. To keep the error
    path simpler, use dmam_alloc_coherent() instead of dma_alloc_coherent().
    
    Fixes: 5000d37042a6 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC")
    Cc: stable@vger.kernel.org
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Tested-by: John Madieu <john.madieu.xa@bp.renesas.com>
    Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
    Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
    Link: https://patch.msgid.link/20260526084710.3491480-2-claudiu.beznea@kernel.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    [tm: kept channel->irq (a struct field, not a local irq variable) and
     the sprintf()/pdev_irqname[5] pair in rz_dmac_chan_probe(), and the
     mandatory platform_get_irq_byname() call for the error IRQ in
     rz_dmac_probe(), since e0c51fd02f9c ("Make channel irq local"),
     c4d6dcb3b625 ("Avoid format-overflow warning") and b34f3fcae72a
     ("make error interrupt optional") are not yet backported to this
     tree]
    Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

dmaengine: sun6i-dma: Fix reclaim descriptors while terminating DMA [+ + +]
Author: Hongling Zeng <zenghongling@kylinos.cn>
Date:   Wed Jul 1 12:57:33 2026 +0800

    dmaengine: sun6i-dma: Fix reclaim descriptors while terminating DMA
    
    [ Upstream commit ab1150115e68a46b687eb38c1ab92782018c9f2c ]
    
    When terminating DMA transfers, active descriptors are not properly
    reclaimed. Only cyclic descriptors were handled, leaving non-cyclic
    descriptors and their LLI chains to be permanently leaked.
    
    Fix by using vchan_terminate_vdesc() which handles both cyclic and
    non-cyclic descriptors by adding them to desc_terminated queue for
    proper cleanup.
    
    Add pchan->desc != pchan->done check to prevent double-adding completed
    descriptors, which would corrupt the list.
    
    Fixes: 555859308723 ("dmaengine: sun6i: Add driver for the Allwinner A31 DMA controller")
    Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
    Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
    Suggested-by: Frank Li <Frank.li@oss.nxp.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Link: https://patch.msgid.link/20260701045733.33654-1-zenghongling@kylinos.cn
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dpaa2-eth: put MAC endpoint device on disconnect [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Wed Jul 8 19:17:37 2026 +0800

    dpaa2-eth: put MAC endpoint device on disconnect
    
    [ Upstream commit b4b201cc93ff70150853aba03e14d314d1980ca0 ]
    
    fsl_mc_get_endpoint() returns the MAC endpoint device with a reference
    taken through device_find_child(). The Ethernet connect path stores that
    device in mac->mc_dev and keeps it for the lifetime of the connected MAC
    object.
    
    However, the disconnect path only disconnects and closes the MAC before
    freeing the dpaa2_mac object. It does not drop the endpoint device
    reference stored in mac->mc_dev, so every successful connect leaks that
    device reference when the MAC is later disconnected.
    
    Drop the endpoint device reference after closing the MAC and before
    freeing the dpaa2_mac object.
    
    Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink")
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Link: https://patch.msgid.link/20260708111738.750391-1-lgs201920130244@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dpaa2-switch: put MAC endpoint device on disconnect [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Wed Jul 8 19:10:25 2026 +0800

    dpaa2-switch: put MAC endpoint device on disconnect
    
    [ Upstream commit 4c1eabbef7a1707635652e956e39db1269c3af2b ]
    
    fsl_mc_get_endpoint() returns the MAC endpoint device with a reference
    taken through device_find_child(). The switch port connect path stores
    that device in mac->mc_dev and keeps it for the lifetime of the connected
    MAC object.
    
    However, the disconnect path only closes the MAC and frees the dpaa2_mac
    object. It does not drop the endpoint device reference stored in
    mac->mc_dev, so every successful connect leaks that device reference when
    the MAC is later disconnected.
    
    Drop the endpoint device reference before freeing the dpaa2_mac object.
    
    Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support")
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260708111025.749311-1-lgs201920130244@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amd/pm/ci: Don't disable MCLK DPM on Bonaire 0x6658 (R7 260X) [+ + +]
Author: Timur Kristóf <timur.kristof@gmail.com>
Date:   Mon Jul 13 08:14:43 2026 +0200

    drm/amd/pm/ci: Don't disable MCLK DPM on Bonaire 0x6658 (R7 260X)
    
    commit 85371c5ef502d10add72eab38711e191dccea981 upstream.
    
    The old radeon driver has a documented workaround in ci_dpm.c
    which claims that Bonaire 0x6658 with old memory controller
    firmware is unstable with MCLK DPM, so as a precaution I
    disabled MCLK DPM on this ASIC in amdgpu.
    
    Note that the old MC firmware is not actually used with
    amdgpu, but in theory it's possible that the VBIOS sets
    up the ASIC with an old MC firmware that is already running
    when amdgpu initializes (in which case amdgpu doesn't
    load its own firmware).
    
    What I expected to happen is that the GPU would simply use
    its maximum memory clock, and indeed this is what seemed
    to happen according to amdgpu_pm_info which reads the
    current MCLK value from the SMU.
    However, some users reported a huge perf regression
    and upon a closer look it seems that the GPU seems to
    not actually use the highest MCLK value, despite the SMU
    reporting that it does.
    
    Let's not disable MCLK DPM on Bonaire 0x6658 (R7 260X).
    
    Keep MCLK DPM disabled on R9 M380 in the 2015 iMac
    because that still hangs if we enable it.
    
    Fixes: 9851f29cb06c ("drm/amd/pm/ci: Disable MCLK DPM on problematic CI ASICs")
    Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit d34acad064ee7d82bd18f5d87592c422d4d323ac)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu/gfx10: replace BUG_ON() with WARN_ON() [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jun 15 18:19:52 2026 -0400

    drm/amdgpu/gfx10: replace BUG_ON() with WARN_ON()
    
    commit d06c4173a7c38c7a39e98859f839ce714c7af2c9 upstream.
    
    There's no need to crash the kernel for these cases.
    
    Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit ac6f00beb658239bced4aaed9efbb04a35348d48)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu/gfx8: drop unecessary BUG_ON() [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jun 15 18:17:59 2026 -0400

    drm/amdgpu/gfx8: drop unecessary BUG_ON()
    
    commit 84a1a8a952ab4b8c23c5dd1f2eea4049cb4914f5 upstream.
    
    There's no need to crash the kernel for this case.
    
    Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 4d7c25208ca612b754f3bf39e9f16e725b828891)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu/gfx9: replace BUG_ON() with WARN_ON() [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jun 15 18:14:59 2026 -0400

    drm/amdgpu/gfx9: replace BUG_ON() with WARN_ON()
    
    commit 6302be10b521f5106ce01eb5a724b9e7945a5061 upstream.
    
    There's no need to crash the kernel for these cases.
    
    Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit b71604f8685b0eba07866f4e8dc30f93e1931054)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu/sdma5.0: replace BUG_ON() with WARN_ON() [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jun 15 18:26:28 2026 -0400

    drm/amdgpu/sdma5.0: replace BUG_ON() with WARN_ON()
    
    commit 9e98ed3113943257ad6e5c1e6beddbdb482a70ad upstream.
    
    There's no need to crash the kernel for these cases.
    
    Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 8d144a0eb09537055841af48c9e7c2d4cd48e84d)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu/sdma5.2: replace BUG_ON() with WARN_ON() [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jun 15 18:27:15 2026 -0400

    drm/amdgpu/sdma5.2: replace BUG_ON() with WARN_ON()
    
    commit b9dd618a635d39fbb211454b6e8837b2a7f10fb0 upstream.
    
    There's no need to crash the kernel for these cases.
    
    Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit ae658afc7f47f6147371ec42cc6b1a793dfdb5af)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu: cap GTT size to physical RAM on APUs [+ + +]
Author: Harkirat Gill <harkirat.gill@amd.com>
Date:   Mon Jul 27 14:37:56 2026 -0400

    drm/amdgpu: cap GTT size to physical RAM on APUs
    
    commit 5e70f6804b4d6256058c360b10e044ee04ea4a4e upstream.
    
    On APUs, the GTT pool is backed by system RAM, but its size is not bound
    to the non-carveout memory that actually backs it. A user can end up
    with GTT + VRAM exceeding total physical memory through the following
    sequence:
    
     - Have a large non-carveout memory space (~128GB) and accordingly set a
       large GTT (~100GB) via the ttm module parameter.
     - Lower the non-carveout memory space in BIOS by increasing the UMA
       Frame Buffer Size (VRAM) to 64GB.
     - The previously set GTT value (~100GB) persists, even though the new
       non-carveout space (64GB) can no longer back it.
    
    This leads to a case where kernel reports GTT (100GB) + VRAM (64GB)
    despite the sum being greater than total physical memory (128GB).
    
    Cap the GTT size to totalram_pages() on APUs. totalram_pages() already
    excludes the VRAM carveout, so the resulting GTT can never exceed the
    system RAM that actually backs it.
    
    Signed-off-by: Harkirat Gill <harkirat.gill@amd.com>
    Reviewed-by: David Francis <David.Francis@amd.com>
    Assisted-by: Claude:claude-opus-4
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 5dafdd649280c7dc6c22c8f877da3f54fcc441e1)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amdgpu: fix bo->pin leaking in amdgpu_bo_create_reserved [+ + +]
Author: Zhu Lingshan <lingshan.zhu@amd.com>
Date:   Wed Jul 1 18:53:21 2026 +0800

    drm/amdgpu: fix bo->pin leaking in amdgpu_bo_create_reserved
    
    commit a2f895f3c852063258d62e9f74b081de07ca95df upstream.
    
    amdgpu_bo_create_reserved() only allocates a new BO when
    *bo_ptr (struct amdgpu_bo **bo_ptr as input parameter) is
    NULL, it simply skips creation when *bo_ptr is non-NULL.
    But it unconditionally reserves, pins, gart allocates
    and maps the BO afterwards.
    
    When the same non-NULL BO pointer is passed in again,
    for example firmware buffers that live in adev and are
    re-loaded on every resume / cp_resume / start
    under AMDGPU_FW_LOAD_DIRECT, amdgpu_bo_pin() just increases
    pin_count unconditionally, however the matching teardown only unpins
    once, so pin_count never drops to zero, so TTM is not able
    to move, swap or evict a BO, causing BO leaks.
    
    This commit fixes this issue by only pinning the bo
    once at creation, and repeated calls no longer
    take additional pin references.
    
    Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 3ddc0ae76202c447b6aec61e907b852bc94671cf)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amdgpu: fix division by zero with invalid uvd dimensions [+ + +]
Author: Boyuan Zhang <boyuan.zhang@amd.com>
Date:   Tue May 12 10:29:36 2026 -0400

    drm/amdgpu: fix division by zero with invalid uvd dimensions
    
    commit 0c01c811be47e6b146552dd59bfedbea8f09b8f4 upstream.
    
    When width or height is less than 16, width_in_mb or height_in_mb
    becomes 0, leading to fs_in_mb being 0. This causes a division by
    zero when calculating num_dpb_buffer in H264 and H264 Perf decode
    paths.
    
    Add validation to reject frames with width < 16 or height < 16
    before performing any calculations that depend on these values.
    
    V2: Format change - move up all vaiable definitions.
    V3: Use warn_once to avoid spam.
    
    Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
    Reviewed-by: Leo Liu <leo.liu@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 3e41d26c70b0a459d041cc19482a226c4b7423cb)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amdgpu: Fix VFCT bus number matching with soft filter [+ + +]
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Wed Jul 8 14:35:14 2026 -0500

    drm/amdgpu: Fix VFCT bus number matching with soft filter
    
    commit db7e8108809a2245f0a17ba323f027cac0941ffb upstream.
    
    On systems where PCI bus renumbering occurs (e.g. pci=realloc,
    resource conflicts), the runtime bus number may differ from the
    BIOS POST bus number recorded in the VFCT table. This causes
    amdgpu_acpi_vfct_bios() to fail finding the VBIOS even though
    the correct device entry exists.
    
    Introduce amdgpu_acpi_vfct_match() which treats the bus number
    as a soft filter: vendor/device/function identity is the hard
    requirement, while exact bus match is the preferred path. When
    bus numbers disagree but device identity matches, accept the
    VFCT entry and log a dev_notice for diagnostics.
    
    Reported-by: Oz Tiram <oz@shift-computing.de>
    Closes: https://lore.kernel.org/amd-gfx/20260621173211.28443-1-oz@shift-computing.de/
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Link: https://patch.msgid.link/20260708193518.702584-2-mario.limonciello@amd.com
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 11c141672045ffc0187aa604f2c0f597bc334fb2)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amdgpu: invoke pm_genpd_remove() before freeing genpd [+ + +]
Author: Ce Sun <cesun102@amd.com>
Date:   Mon Jun 22 22:58:16 2026 +0800

    drm/amdgpu: invoke pm_genpd_remove() before freeing genpd
    
    commit 28c9b3c5dc35cc790d11e26ca3fc6e068be63998 upstream.
    
    Call pm_genpd_remove() to unregister from global list prior to releasing
    acp_genpd memory, and clear the pointer after free.
    
    Signed-off-by: Ce Sun <cesun102@amd.com>
    Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit cd8650d7a91ee8b768e202354672553faa5cc1f2)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amdgpu: restore UMD profile pstate after runtime resume [+ + +]
Author: Candice Li <candice.li@amd.com>
Date:   Tue Jul 21 21:38:58 2026 +0800

    drm/amdgpu: restore UMD profile pstate after runtime resume
    
    commit f931c54b241ce2f36bfc34955aec43a188276b8d upstream.
    
    Runtime suspend runs GFX hw_fini and clears perfmon clock gating while
    the UMD profile DPM level remains set in software.  Re-apply stable
    pstate after a successful runtime resume when a profile mode is active.
    
    Signed-off-by: Candice Li <candice.li@amd.com>
    Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
    Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 138531c8850cc247aa12b104bb29ea387bcdcbb1)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/i915/gem: Do not leak siblings[] on proto context error [+ + +]
Author: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Date:   Wed Jul 1 10:30:30 2026 +0300

    drm/i915/gem: Do not leak siblings[] on proto context error
    
    commit eed3de2acf6aa5154d49098b026710b646db67ee upstream.
    
    After a successful BALANCE/PARALLEL_SUBMIT extension on context
    creation, error during processing of next user extension leaks
    the siblings[] array. Fix that.
    
    Discovered using AI-assisted static analysis confirmed by
    Intel Product Security.
    
    Reported-by: Martin Hodo <martin.hodo@intel.com>
    Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
    Cc: Faith Ekstrand <faith.ekstrand@collabora.com>
    Cc: Simona Vetter <simona.vetter@ffwll.ch>
    Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Cc: <stable@vger.kernel.org> # v5.15+
    Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://lore.kernel.org/r/20260701073030.44850-1-joonas.lahtinen@linux.intel.com
    (cherry picked from commit aa65e0a4b51b3b54b53e4142aaa2d997aa1061ff)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/i915/gem: Fix NULL deref in I915_CONTEXT_PARAM_SSEU [+ + +]
Author: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Date:   Wed Jul 1 10:55:55 2026 +0300

    drm/i915/gem: Fix NULL deref in I915_CONTEXT_PARAM_SSEU
    
    commit 2b56757a9a7456825eb668fde92299e01c5e2721 upstream.
    
    Setting context engine slot N into I915_ENGINE_CLASS_INVALID /
    I915_ENGINE_CLASS_INVALID_NONE and attempting to apply
    I915_CONTEXT_PARAM_SSEU to the same slot N will deref NULL.
    Fix that.
    
    Discovered using AI-assisted static analysis confirmed by
    Intel Product Security.
    
    Reported-by: Martin Hodo <martin.hodo@intel.com>
    Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
    Cc: Faith Ekstrand <faith.ekstrand@collabora.com>
    Cc: Simona Vetter <simona.vetter@ffwll.ch>
    Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Cc: <stable@vger.kernel.org> # v5.15+
    Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
    Link: https://patch.msgid.link/20260701075555.52142-1-joonas.lahtinen@linux.intel.com
    (cherry picked from commit 36eda5b5c2d40da41cc0a5403c26986237cf9e87)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/i915/gt: use correct selftest config symbol [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Sun Jul 5 16:02:25 2026 +0800

    drm/i915/gt: use correct selftest config symbol
    
    [ Upstream commit a82f1bb8191aec98a971a2196136016ef70c0880 ]
    
    intel_engine_user.c checks CONFIG_DRM_I915_SELFTESTS before running
    the engine UABI isolation check. Kconfig defines DRM_I915_SELFTEST,
    without the trailing "S", and the rest of i915 uses
    CONFIG_DRM_I915_SELFTEST.
    
    Because CONFIG_DRM_I915_SELFTESTS is not backed by any Kconfig symbol,
    the IS_ENABLED() test is always false. Use the existing selftest symbol
    so the debug/selftest guarded path can be reached when selftests are
    enabled.
    
    This is a source-level fix. It does not claim dynamic hardware
    reproduction; the evidence is the Kconfig definition and the inconsistent
    guard in intel_engine_user.c.
    
    Fixes: 750e76b4f9f6 ("drm/i915/gt: Move the [class][inst] lookup for engines onto the GT")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://lore.kernel.org/r/20260705080225.436-1-pengpeng@iscas.ac.cn
    (cherry picked from commit 14a2012a490258f3f93857bc4f1b203405964be7)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/i915/selftests: Fix GT PM sort comparators [+ + +]
Author: Emre Cecanpunar <emreleno@gmail.com>
Date:   Wed Jul 15 01:04:30 2026 +0300

    drm/i915/selftests: Fix GT PM sort comparators
    
    [ Upstream commit 612978b83f45bf7018815209db5395d759db6f26 ]
    
    Compare the sampled clock values instead of their addresses. Comparing
    addresses leaves the samples unsorted, preventing the code from discarding
    the minimum and maximum samples.
    
    Fixes: 1a5392479207 ("drm/i915/selftests: Measure CS_TIMESTAMP")
    Signed-off-by: Emre Cecanpunar <emreleno@gmail.com>
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Link: https://lore.kernel.org/r/20260714220430.238433-1-emreleno@gmail.com
    (cherry picked from commit 682ea2d28d18bb06f9fc663cb5ab7e80dc0e606a)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/i915: Return NULL on error in active_instance [+ + +]
Author: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Date:   Wed Jun 24 12:09:40 2026 +0300

    drm/i915: Return NULL on error in active_instance
    
    commit 1e33f0de5fdcd09e51fdec1e5822448970b6420f upstream.
    
    Avoid returning &node->base when node is NULL due to OOM
    during GFP_ATOMIC allocation.
    
    Discovered using AI-assisted static analysis confirmed by
    Intel Product Security.
    
    Reported-by: Martin Hodo <martin.hodo@intel.com>
    Fixes: bfaae47db3c0 ("drm/i915: make lockdep slightly happier about execbuf.")
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Cc: Simona Vetter <simona.vetter@ffwll.ch>
    Cc: <stable@vger.kernel.org> # v5.13+
    Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Reviewed-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
    Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Link: https://patch.msgid.link/20260624090940.74840-1-joonas.lahtinen@linux.intel.com
    (cherry picked from commit 6029bc064f0b1bac184203a50fbaaf070fa18832)
    Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/mediatek: Check CRTC state before freeing [+ + +]
Author: Ruoyu Wang <ruoyuw560@gmail.com>
Date:   Tue Jul 7 23:05:28 2026 +0800

    drm/mediatek: Check CRTC state before freeing
    
    [ Upstream commit 233a4d3a39fc1585f5e271b2adab43c6af025ae0 ]
    
    mtk_crtc_reset() destroys the current CRTC state only when crtc->state
    is non-NULL, but it always converts crtc->state to struct mtk_crtc_state
    and passes the result to kfree().
    
    When reset is called without an existing state, container_of(NULL, ...)
    does not produce NULL. Keep the mtk state free in the same crtc->state
    guard as the helper state destruction.
    
    This issue was found by a static analysis checker and confirmed by
    manual source review.
    
    Fixes: 2d267b81898e ("drm/mtk: Use __drm_atomic_helper_crtc_reset")
    Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
    Reviewed-by: CK Hu <ck.hu@mediatek.com>
    Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20260707150528.2270739-1-ruoyuw560@gmail.com/
    Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/nouveau/acr: fix missing nvkm_done() in error path of nvkm_acr_oneinit() [+ + +]
Author: Wentao Liang <vulab@iscas.ac.cn>
Date:   Sat Jun 6 15:56:06 2026 +0000

    drm/nouveau/acr: fix missing nvkm_done() in error path of nvkm_acr_oneinit()
    
    commit c3027973f692077a1b66a9fb26d6a7c46c0dc72c upstream.
    
    In nvkm_acr_oneinit(), nvkm_kmap(acr->wpr) is invoked unconditionally
    at line 309 to obtain a mapping reference. Additionally, when both
    acr->wpr_fw and acr->wpr_comp are present, a second nvkm_kmap() is
    called inside the conditional block. Both mappings are expected to be
    released by nvkm_done(acr->wpr) at line 320 before the function returns
    successfully.
    
    However, when a mismatch is detected during the loop within the
    conditional block, the function returns -EINVAL at line 318 without
    calling nvkm_done(). This results in a leak of the kmap reference(s)
    acquired earlier.
    
    Fix the issue by invoking nvkm_done(acr->wpr) prior to the early return
    to ensure proper release of the mapping references.
    
    Fixes: 22dcda45a3d1 ("drm/nouveau/acr: implement new subdev to replace "secure boot"")
    Cc: stable@vger.kernel.org
    Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
    Link: https://patch.msgid.link/20260606155606.77593-1-vulab@iscas.ac.cn
    Signed-off-by: Danilo Krummrich <dakr@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/radeon: fix r100_copy_blit for large BOs [+ + +]
Author: Pavel Ondračka <pavel.ondracka@gmail.com>
Date:   Wed Jun 10 10:32:45 2026 +0200

    drm/radeon: fix r100_copy_blit for large BOs
    
    commit f896e86273dbbebb5eac966b4a201b5c62a02e9a upstream.
    
    r100_copy_blit() copies BOs as 1024-pixel-wide ARGB8888 blits, so one
    GPU page becomes one blit row. Large copies are split into chunks of at
    most 8191 rows.
    
    The kernel register header names the packet coordinate dwords SRC_Y_X
    and DST_Y_X. In the BITBLT_MULTI description in
    R5xx_Acceleration_v1.5.pdf docs, these correspond to [SRC_X1 | SRC_Y1]
    and [DST_X1 | DST_Y1], which are signed 13-bit coordinates in the
    -8192..8191 range. The old code kept SRC/DST_PITCH_OFFSET at the BO base
    and used SRC_Y_X/DST_Y_X as the chunk address, so large BO moves could
    exceed that coordinate range.
    
    Compute per-chunk SRC/DST_PITCH_OFFSET bases and emit zero source and
    destination coordinates. r100_copy_blit() already packs
    SRC/DST_PITCH_OFFSET as pitch plus base offset, so large chunk addresses
    belong there rather than in the coordinate fields.
    
    This fixes Prison Architect corruption with 4096x4096 mipped textures
    after they are evicted to GTT under memory pressure on RV530.
    
    Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/6716
    Acked-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 87be26aee76239c6da03e599f238a426897f78ad)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/rockchip: cdn-dp: add missing check in cdn_dp_config_video() [+ + +]
Author: Sergey Shtylyov <s.shtylyov@auroraos.dev>
Date:   Fri Jan 30 23:35:42 2026 +0300

    drm/rockchip: cdn-dp: add missing check in cdn_dp_config_video()
    
    commit 46c31e1604d121221167cb09380de8c7d53290b9 upstream.
    
    The result of cdn_dp_reg_write() is checked everywhere (with the error
    being logged by the callers) except one place in cdn_dp_config_video().
    Add the missing result check, bailing out early on error...
    
    Found by Linux Verification Center (linuxtesting.org) with the Svace static
    analysis tool.
    
    Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
    Signed-off-by: Sergey Shtylyov <s.shtylyov@auroraos.dev>
    Cc: stable@vger.kernel.org
    Reviewed-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Link: https://patch.msgid.link/adf6b313-f7db-4d8f-9000-8c65446ba041@auroraos.dev
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/vc4: Zero the tile state data array before each BIN job [+ + +]
Author: Maíra Canal <mcanal@igalia.com>
Date:   Mon Jul 27 11:32:29 2026 -0300

    drm/vc4: Zero the tile state data array before each BIN job
    
    commit 48a570c964d8e37d353381e4195106277e17f5cb upstream.
    
    The binner BO is a single 16MB buffer split into 512KB slots that are
    handed out to jobs at submission time and recycled as jobs complete,
    without ever being cleared. Each slot holds the job's Tile State Data
    Array (TSDA) at its start, followed by the tile allocation pool.
    
    While the tile allocation pool is only walked by the render thread
    through branches the binner generated during the current job, the
    TSDA is the PTB's own per-tile bookkeeping and is consumed by the
    hardware itself. Although the kernel sets the "Auto-initialise Tile
    State Data Array" flag in the tile binning mode configuration, the
    PTB demonstrably still acts on stale tile state left by the slot's
    previous user: the binner ends up creating invalid command streams
    with invalid primitive streams and branches, which can cause GPU hangs
    as observed in [1][2].
    
    Zero the TSDA when the job's binning slot is configured. This clears
    48 bytes per tile (~24KB for a 1080p frame) in the submission path, and
    guarantees the PTB never sees another job's tile state.
    
    The tile count is only checked for being non-zero today, so the 8-bit
    fields it comes from can describe a tile state array almost six times
    larger than the slot it has to live in. Bound it before the slot is
    handed out, since such size decides how much of the slot is left for
    the tile alloc pool.
    
    Link: https://github.com/raspberrypi/linux/issues/3221 [1]
    Link: https://github.com/raspberrypi/linux/issues/5780 [2]
    Fixes: 553c942f8b2c ("drm/vc4: Allow using more than 256MB of CMA memory.")
    Cc: stable@vger.kernel.org
    Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
    Link: https://patch.msgid.link/20260727-vc4-bin-oom-fixes-v2-2-0d8a5eddc7c9@igalia.com
    Signed-off-by: Maíra Canal <mcanal@igalia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/vmwgfx: bound DMA command body size against suffix pointer [+ + +]
Author: Zack Rusin <zack.rusin@broadcom.com>
Date:   Tue May 5 18:22:28 2026 -0400

    drm/vmwgfx: bound DMA command body size against suffix pointer
    
    commit f4f1db96bfd68b81053693ba53405b6f510ac16c upstream.
    
    vmw_cmd_dma() locates the DMA suffix at
    
            (unsigned long) &cmd->body + header->size - sizeof(*suffix)
    
    without checking that header->size is large enough to contain both
    cmd->body and the suffix.  An undersized header makes the suffix
    pointer underflow back into the previous command in the bounce
    buffer.  The verifier later writes suffix->maximumOffset, clobbering
    verified fields of an already-relocated earlier command -- a TOCTOU
    on the device-visible command stream that lets one command rewrite
    another's GMR id, surface id, or other authenticated fields.
    
    Reject the command if the body is too small for the suffix to fit.
    
    Fixes: 4e4ddd477743 ("drm/vmwgfx: Fix queries if no dma buffer thrashing is occuring.")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4.7
    Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
    Reviewed-by: Ian Forbes <ian.forbes@broadcom.com>
    Link: https://patch.msgid.link/20260505222728.519626-8-zack.rusin@broadcom.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/vmwgfx: validate DRAW_PRIMITIVES header size before division [+ + +]
Author: Zack Rusin <zack.rusin@broadcom.com>
Date:   Tue May 5 18:22:27 2026 -0400

    drm/vmwgfx: validate DRAW_PRIMITIVES header size before division
    
    commit 85891d174707d8bddcec7a888fb4e1d17def34f3 upstream.
    
    vmw_cmd_draw() computes
    
            maxnum = (header->size - sizeof(cmd->body)) / sizeof(*decl);
    
    where header->size is u32 and is taken straight from the user-supplied
    command stream.  When header->size is less than sizeof(cmd->body) the
    unsigned subtraction wraps to nearly 4 GiB, producing a huge maxnum.
    Any user-controlled cmd->body.numVertexDecls then passes the bound and
    the loop dereferences decl[i] far past the end of the kernel command
    bounce buffer, producing an out-of-bounds read of kernel memory.
    
    Reject undersized headers up front.
    
    Fixes: 7a73ba7469cb ("drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4.7
    Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
    Reviewed-by: Ian Forbes <ian.forbes@broadcom.com>
    Link: https://patch.msgid.link/20260505222728.519626-7-zack.rusin@broadcom.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/vmwgfx: Validate vmw_surface_metadata::array_size [+ + +]
Author: Ian Forbes <ian.forbes@broadcom.com>
Date:   Tue Jun 23 14:33:14 2026 -0500

    drm/vmwgfx: Validate vmw_surface_metadata::array_size
    
    commit a4f55260f7f7d4dc4d0ee55063dfb0c457b77991 upstream.
    
    This field comes from userspace and should be validated against specific
    limits depending on which Shader Model (SM) is available.
    
    Fixes: 504901dbb0b5 ("drm/vmwgfx: Refactor surface_define to use vmw_surface_metadata")
    Reported-by: Zero Day Initiative <zdi-disclosures@trendmicro.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
    Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
    Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
    Link: https://patch.msgid.link/20260623193314.506257-1-ian.forbes@broadcom.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
e1000: fix memory leak in e1000_probe() [+ + +]
Author: Dawei Feng <dawei.feng@seu.edu.cn>
Date:   Sun Jun 7 22:57:06 2026 +0800

    e1000: fix memory leak in e1000_probe()
    
    commit 816419dfea5c88126f35eb7a1b429a1bf546665e upstream.
    
    In the e1000_probe() path, e1000_sw_init() allocates adapter->tx_ring and
    adapter->rx_ring. If the subsequent CE4100-specific MDIO BAR mapping
    fails, the error handling jumps past the ring cleanup code, leaking both
    allocations.
    
    Fix this leak by moving the err_mdio_ioremap label above the ring
    deallocation logic. This guarantees the proper release of these resources
    and prevents the memory leak.
    
    The bug was first flagged by an experimental analysis tool we are
    developing for kernel memory-management bugs while analyzing
    v6.13-rc1. The tool is still under development and is not yet publicly
    available. Manual inspection confirms that the bug is still
    present in v7.1-rc6.
    
    An x86_64 allyesconfig build showed no new warnings. As we do not have a
    CE4100 reference platform to test with, no runtime testing was able to
    be performed.
    
    Fixes: 5377a4160bb65 ("e1000: Add support for the CE4100 reference platform")
    Cc: stable@vger.kernel.org
    Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
    Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
    Reviewed-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
exec: fix unsigned loop counter wrap in transfer_args_to_stack() [+ + +]
Author: Christian Brauner <brauner@kernel.org>
Date:   Tue Jul 21 12:08:49 2026 +0200

    exec: fix unsigned loop counter wrap in transfer_args_to_stack()
    
    commit 16cc4f5c1c4b9e45eca7f7deefa5410a292db599 upstream.
    
    The stop value is derived from bprm->p >> PAGE_SHIFT. The index variable
    is an unsigned long. If bprm->p drops below PAGE_SIZE and stop becomes
    zero the loop condition index >= stop is always true.
    
    After the index == 0 iteration the decrement wraps to ULONG_MAX and
    bprm->page[ULONG_MAX] reads sizeof(void *) bytes in front of the array.
    The pointer has wrapped to -1. That garbage pointer is then passed to
    kmap_local_page() and PAGE_SIZE bytes are copied from wherever that
    lands into the stack of the process being created. And the loop doesn't
    terminate either...
    
    Getting there only requires bprm->p < PAGE_SIZE. On !MMU
    bprm_set_stack_limit() and bprm_hit_stack_limit() are empty. So the only
    constraint on how far bprm->p is pushed down is valid_arg_len(), i.e.
    that each individual string still fits in what is left.
    
    bprm->p starts at PAGE_SIZE * MAX_ARG_PAGES - sizeof(void *) so a
    single argument or environment string of a little over 31 pages leaves
    it in the first page:
    
      Oops - load access fault [#1]
      CPU: 0 UID: 0 PID: 1 Comm: victim Not tainted 7.2.0-rc4 #1
      epc : __memcpy+0xd4/0xf8
       ra : transfer_args_to_stack+0xaa/0xae
       s4 : ffffffffffffffff   s2 : 0000000000000000
       a1 : ffffffdc98000000   a2 : 0000000000001000
      status: 0000000a00001880 badaddr: ffffffdc98000000 cause: 0000000000000005
      [<801a5324>] __memcpy+0xd4/0xf8
      [<800d5f6a>] load_flat_binary+0x43a/0x65e
      [<800a2de4>] bprm_execve+0x1d4/0x316
      [<800a351a>] do_execveat_common+0x12e/0x138
      [<800a3d44>] __riscv_sys_execve+0x38/0x4e
      Kernel panic - not syncing: Fatal exception in interrupt
    
    This is an arcane bug but we should still fix it.
    
    Count down from MAX_ARG_PAGES so the loop ends when index reaches stop,
    stop == 0 included. The iterations performed are unchanged for every
    other value of stop.
    
    Only CONFIG_MMU=n builds are affected, transfer_args_to_stack() is used
    by binfmt_flat and binfmt_elf_fdpic on nommu only.
    
    The loop predates git history. commit 7e7ec6a93434
    ("elf_fdpic_transfer_args_to_stack(): make it generic") only moved it
    from binfmt_elf_fdpic.c into fs/exec.c and narrowed the copy to the used
    part of the first page. The condition and the decrement are unchanged
    from 2.6.12-rc2.
    
    Link: https://patch.msgid.link/20260721-hochachtung-staumauer-pigmente-15d71f7d7d04@brauner
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
fbdev: bitblit: bound-check glyph index in bit_cursor() [+ + +]
Author: Rik van Riel <riel@surriel.com>
Date:   Fri Aug 7 22:19:56 2026 -0400

    fbdev: bitblit: bound-check glyph index in bit_cursor()
    
    commit e033cbf3975a8465f879ebd5989dc35b04423a4d upstream.
    
    bit_cursor() fetches the glyph under the cursor with
    
            c = scr_readw(vc_pos);
            src = vc_font.data + ((c & charmask) * w * height);
    
    where charmask is 0x1ff when vc_hi_font_mask is set. The screen buffer
    value comes directly from scr_readw() and may be larger than the current
    font's glyph count.
    
    Syzkaller triggers this via vcs_write(). The Call Trace shows
    vcs_write() in vc_screen.c writing an arbitrary 16-bit value with
    writev() to /dev/vcsa, which vcs_write_buf() in vc_screen.c stores via
    vcs_scr_writew() without checking charcount. The stored value is later
    read in bit_cursor() in bitblit.c.
    
    When the font is changed from a font with 512 glyphs to a font with
    256 glyphs, the screen buffer can retain characters with the high
    bit set from the previous mode, which could also produce the same
    out-of-bounds access.
    
      BUG: KASAN: global-out-of-bounds in soft_cursor+0x378/0x6bc drivers/video/fbdev/core/softcursor.c:70
      Read of size 16 at addr ffff800086c57970
    
      Call Trace:
       soft_cursor+0x378/0x6bc drivers/video/fbdev/core/softcursor.c:70
       bit_cursor+0xa90/0x1108 drivers/video/fbdev/core/bitblit.c:365
       fbcon_cursor+0x344/0x498 drivers/video/fbdev/core/fbcon.c:1427
       hide_cursor+0xdc/0x2d0 drivers/tty/vt/vt.c:883
       update_region+0x100/0x18c drivers/tty/vt/vt.c:669
       vcs_write+0x8ec/0xaf0 drivers/tty/vt/vc_screen.c:685
    
    bit_putcs_aligned() and bit_putcs_unaligned() already clamp the glyph
    index to vc_font.charcount. Apply the same clamp in bit_cursor() after
    extracting the attribute and masking, before indexing fontdata.
    
    The fix completes the bounds checking started in commit 18c4ef4e765a
    ("fbdev: bitblit: bound-check glyph index in bit_putcs*"), which missed
    the cursor path.
    
    This change should be safe because the clamp reuses the existing
    contract from fbcon: charcount is maintained under console_lock in
    con_font_set() and fbcon_font_set(), and hi_font_mask is cleared when
    switching from 512 to 256 glyphs. When stale screen data with high bits
    remains after a font switch, or when vcs_write() stores an arbitrary
    value, clamping the index to 0 prevents the out-of-bounds read without
    changing cursor semantics — the same fallback bit_putcs uses.
    
    Reported-by: syzbot+61b1db46218109869c14@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=61b1db46218109869c14
    Link: https://lore.kernel.org/all/6a75205c.01d0871a.3a0d52.0032.GAE@google.com/
    Fixes: 18c4ef4e765a ("fbdev: bitblit: bound-check glyph index in bit_putcs*")
    Cc: stable@vger.kernel.org
    Assisted-by: Hermes:muse-spark-1.2 syzkaller
    Signed-off-by: Rik van Riel <riel@surriel.com>
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
firewire: net: Fix fragmented datagram reassembly [+ + +]
Author: Ruoyu Wang <ruoyuw560@gmail.com>
Date:   Tue Jul 7 23:04:54 2026 +0800

    firewire: net: Fix fragmented datagram reassembly
    
    [ Upstream commit d52a13adbb8ccbab99cd3bad36804e87d8b5c052 ]
    
    fwnet_frag_new() keeps a sorted list of received fragments for a partial
    datagram. When a new fragment is adjacent to an existing fragment, the
    code checks whether the new fragment also closes the gap to the next or
    previous list entry.
    
    Those neighbor lookups currently assume that the current fragment always
    has a real next or previous fragment. At a list edge, the next or
    previous entry is the list head, not a struct fwnet_fragment_info.
    
    The gap checks also compare against the old edge of the current fragment
    instead of the edge after adding the new fragment. As a result, a
    fragment that bridges two existing ranges may leave two adjacent ranges
    unmerged, so fwnet_pd_is_complete() can miss a complete datagram.
    
    Check for the list head before looking up the neighboring fragment, and
    compare the neighbor against the new fragment's far edge when deciding
    whether to merge all three ranges.
    
    This issue was found by a static analysis checker and confirmed by
    manual source review.
    
    Fixes: c76acec6d551 ("firewire: add IPv4 support")
    Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
    Link: https://lore.kernel.org/r/20260707150454.2265951-1-ruoyuw560@gmail.com
    Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
firmware: arm_ffa: Fix NULL dereference in ffa_partition_info_get() [+ + +]
Author: Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>
Date:   Wed Jun 17 16:35:00 2026 -0700

    firmware: arm_ffa: Fix NULL dereference in ffa_partition_info_get()
    
    [ Upstream commit 8ae5f8e4836667fcaffdf2e3c6068b0a8b364dd8 ]
    
    ffa_partition_info_get() passes uuid_str directly to uuid_parse()
    without a NULL check. When a caller passes NULL, uuid_parse() ->
    __uuid_parse() -> uuid_is_valid() dereferences the pointer, causing
    a kernel panic:
    
      |  Unable to handle kernel NULL pointer dereference at virtual address
      |  0000000000000040
      |  pc : uuid_parse+0x40/0xac
      |  lr : ffa_partition_info_get+0x1c/0x94 [arm_ffa]
    
    Add a NULL guard before uuid_parse() so a NULL argument returns
    -ENODEV instead of crashing. Callers are expected to always supply
    a valid partition UUID, so NULL is not a supported input.
    
    Fixes: d0c0bce83122 ("firmware: arm_ffa: Setup in-kernel users of FFA partitions")
    Signed-off-by: Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260617-ffa_partition_nullptr_fix-v2-1-bc801b4ce34c@oss.qualcomm.com
    Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

firmware: arm_scmi: Rate-limit queue-full warnings in IRQ context [+ + +]
Author: Pushpendra Singh <pushpendra.singh@oss.qualcomm.com>
Date:   Wed Jul 8 12:53:39 2026 +0530

    firmware: arm_scmi: Rate-limit queue-full warnings in IRQ context
    
    [ Upstream commit a4447c0693830d5ecadd6e755cb7fdc55d86aacc ]
    
    The scmi_notify() function is called from interrupt context to queue
    received notification events onto a per-protocol kfifo. When the kfifo
    is full, it logs a warning via dev_warn() for every dropped event.
    
    Under conditions where the platform sends a burst of SCMI notifications
    faster than the deferred worker can drain the queue, this results in a
    flood of dev_warn() calls from IRQ context. Each call acquires the
    console lock and may execute blocking console writes, causing the CPU
    to be held in interrupt context for an extended period and leading to
    observable system stalls.
    
    Fix this by switching to dev_warn_ratelimited() to limit the frequency
    of log messages when the notification queue is full. This reduces
    console overhead in interrupt context and prevents CPU stalls caused by
    excessive logging, while still preserving diagnostic visibility.
    
    Fixes: bd31b249692e ("firmware: arm_scmi: Add notification dispatch and delivery")
    Signed-off-by: Pushpendra Singh <pushpendra.singh@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260708072339.3021140-1-pushpendra.singh@oss.qualcomm.com
    Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

firmware: stratix10-svc: fix memory leaks and list corruption bugs [+ + +]
Author: Tze Yee Ng <tze.yee.ng@altera.com>
Date:   Tue Aug 4 04:17:00 2026 -0700

    firmware: stratix10-svc: fix memory leaks and list corruption bugs
    
    [ Upstream commit 9119ceb76e987c2ec2b549ea100e3268ce3a1c7c ]
    
    Fix a memory leak when gen_pool_alloc() fails by freeing pmem on the error
    path. Switch pmem allocation from devm_kzalloc() to kzalloc() with
    explicit kfree() in the free path to match its list-managed lifetime.
    Remove the erroneous list_del(&svc_data_mem) which corrupted the list head
    on failed lookups.
    
    Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
    Cc: stable@vger.kernel.org#5.0+
    Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>
    Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
    (cherry picked from commit 9119ceb76e987c2ec2b549ea100e3268ce3a1c7c)
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
forcedeth: fix UAF of txrx_stats in nv_remove [+ + +]
Author: Chenguang Zhao <zhaochenguang@kylinos.cn>
Date:   Thu Jul 23 17:26:37 2026 +0800

    forcedeth: fix UAF of txrx_stats in nv_remove
    
    [ Upstream commit 22666ba1420164753d7b0f5a841986b25ace5435 ]
    
    nv_remove() frees the per-CPU txrx_stats before unregister_netdev().
    Until unregister completes, ndo_get_stats64, the NAPI/xmit data path,
    and nv_close()/drain may still access txrx_stats, leading to a
    use-after-free.
    
    Free the stats only after unregister_netdev().
    
    Fixes: f4b633b911fd ("forcedeth: use per cpu to collect xmit/recv statistics")
    Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
    Link: https://patch.msgid.link/20260723092637.2135095-1-chenguang.zhao@linux.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fscrypt: Replace mk_users keyring with simple list [+ + +]
Author: Eric Biggers <ebiggers@kernel.org>
Date:   Sat Aug 15 11:31:26 2026 -0700

    fscrypt: Replace mk_users keyring with simple list
    
    commit 696c030e1e3438955aba443b308ee8b6faa3983e upstream.
    
    Change mk_users (the set of user claims to an fscrypt master key) from a
    'struct key' keyring to a simple linked list.
    
    It's still a collection of 'struct key' for quota tracking.  It was
    originally thought to be natural that a collection of 'struct key'
    should be held in a 'struct key' keyring.  In reality, it's just been
    causing problems, similar to how using 'struct key' for the filesystem
    keyring caused problems and was removed in commit d7e7b9af104c
    ("fscrypt: stop using keyrings subsystem for fscrypt_master_key").
    
    Commit d3a7bd420076 ("fscrypt: clear keyring before calling key_put()")
    fixed mk_users cleanup to be synchronous.  But that apparently wasn't
    enough: the keyring subsystem's redundant locking is still generating
    lockdep false positives due to the interaction with filesystem reclaim.
    
    With the simple list, the redundant locking and lockdep issue goes away.
    
    Of course, searching a linked list is linear-time whereas the
    'struct key' keyring used a fancy constant-time associative array.  But
    that's fine here, since in practice there's just one entry in the list.
    In fact the new code is much faster in practice, since it's much smaller
    and doesn't have to convert the kuid_t into a string to search for it.
    
    Reported-by: syzbot+f55b043dacf43776b50c@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=f55b043dacf43776b50c
    Reported-by: Mohammed EL Kadiri <med08elkadiri@gmail.com>
    Closes: https://lore.kernel.org/keyrings/20260614150041.21172-1-med08elkadiri@gmail.com/
    Fixes: 23c688b54016 ("fscrypt: allow unprivileged users to add/remove keys for v2 policies")
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/20260618221921.87896-1-ebiggers@kernel.org
    Signed-off-by: Eric Biggers <ebiggers@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
futex: Prevent lockup in requeue-PI during signal/ timeout wakeup [+ + +]
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Wed Jul 22 20:47:48 2026 +0000

    futex: Prevent lockup in requeue-PI during signal/ timeout wakeup
    
    [ Upstream commit bc7304f3ae20972d11db6e0b1b541c63feda5f05 ]
    
    During wait-requeue-pi (task A) and requeue-PI (task B) the following
    race can happen:
    
         Task A                             Task B
      futex_wait_requeue_pi()
        futex_setup_timer()
        futex_do_wait()
                                       futex_requeue()
                                            CLASS(hb, hb1)(&key1);
                                            CLASS(hb, hb2)(&key2);
            *timeout*
        futex_requeue_pi_wakeup_sync()
            requeue_state = Q_REQUEUE_PI_IGNORE
    
        *blocks on hb->lock*
    
                                            futex_proxy_trylock_atomic()
                                              futex_requeue_pi_prepare()
                                                Q_REQUEUE_PI_IGNORE => -EAGAIN
                                            double_unlock_hb(hb1, hb2)
                                             *retry*
    
    Task B acquires both hb locks and attempts to acquire the PI-lock of the
    top most waiter (task B). Task A is leaving early due to a signal/
    timeout and started removing itself from the queue. It updates its
    requeue_state but can not remove it from the list because this requires
    the hb lock which is owned by task B.
    
    Usually task A is able to swoop the lock after task B unlocked it.
    However if task B is of higher priority then task A may not be able to
    wake up in time and acquire the lock before task B gets it again.
    Especially on a UP system where A is never scheduled.
    
    As a result task A blocks on the lock and task B busy loops, trying to
    make progress but live locks the system instead. Tragic.
    
    This can be fixed by removing the top most waiter from the list in this
    case. This allows task B to grab the next top waiter (if any) in the
    next iteration and make progress.
    
    Remove the top most waiter if futex_requeue_pi_prepare() fails.
    Let the waiter conditionally remove itself from the list in
    handle_early_requeue_pi_wakeup().
    
    Fixes: 07d91ef510fb1 ("futex: Prevent requeue_pi() lock nesting issue on RT")
    Reported-by: Moritz Klammler <Moritz.Klammler@ferchau.com>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Thomas Gleixner <tglx@kernel.org>
    Link: https://patch.msgid.link/20260428103425.dywXyPd3@linutronix.de
    Closes: https://lore.kernel.org/all/VE1PR06MB6894BE61C173D802365BE19DFF4CA@VE1PR06MB6894.eurprd06.prod.outlook.com
    [cmllamas: adapt to 5.15, apply hunk to kernel/futex/core.c prior to the
     requeue code split and use hb_waiters_dec() before the helper rename]
    Signed-off-by: Carlos Llamas <cmllamas@google.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

futex: Prevent robust futex exit race some more [+ + +]
Author: Keno Fischer <keno@juliacomputing.com>
Date:   Fri Aug 14 14:44:30 2026 +0200

    futex: Prevent robust futex exit race some more
    
    commit 6d4514ca9cdf61fec4ec634cf50386f6f7e69748 upstream.
    
    A robust futex unlock stores 0 over the whole futex value - wiping
    FUTEX_WAITERS - and wakes a single waiter. That wakeup is a one-shot
    notification: the protocol relies on its recipient to either acquire the
    futex (and eventually unlock while aware of the remaining contention) or
    re-arm FUTEX_WAITERS before sleeping again.  If the woken waiter is killed
    before it can do either, the kernel must jump in and wake the next task
    down the line.
    
    This is a known complication of the futex protocol with a previous
    partial fix in commit ca16d5bee598 ("futex: Prevent robust futex exit
    race"). Unfortunately, that fix is insufficient.
    
    If a third task re-acquired the futex through the uncontended fast
    path in the meantime, the notification is lost: robust exit processing
    sees that it is owned by another task and does nothing, while the new
    owner sees no FUTEX_WAITERS when it unlocks and wakes nobody.
    The remaining waiters sleep forever behind a free futex:
    
      A owns the futex, B and C sleep in FUTEX_WAIT
                                            uval == A | FUTEX_WAITERS
      A robust unlock: store 0, FUTEX_WAKE(1) wakes B
                                            uval == 0
      D fast path acquire: cmpxchg(0 -> D)
                                            uval == D, no FUTEX_WAITERS
      B killed before acting on the wakeup
      B exit walk, pending op: owner D != B -> no action
      D unlock: no FUTEX_WAITERS -> no wake
                                            C sleeps forever
    
    This is clearly a shortcoming in the implementation, which fails to keep
    the FUTEX_WAITERS bit consistent.
    
    Work around this by augmenting the robust list exit processing to also
    perform the extra wakeup if the futex word is owned by another thread but
    FUTEX_WAITERS is not set.
    
    This does not fix the problem of a non-contended take over/release and free
    sequence, which has been discussed for years and has been addressed by
    commit 3ca9595d9fb6 ("futex: Add support for unlocking robust futexes") and
    subsequent changes, but failed to take the problem described above into
    account.
    
    A more complete solution which is based on the in kernel unlock of
    contended robust futexes has been discussed in the context of this change
    and should show up in mainline sooner than later.
    
    [ tglx: Amend change log slightly and fixup coding style ]
    
    Fixes: ca16d5bee598 ("futex: Prevent robust futex exit race")
    Signed-off-by: Keno Fischer <keno@juliahub.com>
    Signed-off-by: Thomas Gleixner <tglx@kernel.org>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Thomas Gleixner <tglx@kernel.org>
    Assisted-by: ClaudeCode:claude-fable-5 tla+
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/20260730194705.38981-1-keno@juliacomputing.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
geneve: require CAP_NET_ADMIN in the device netns for changelink [+ + +]
Author: Doruk Tan Ozturk <doruk@0sec.ai>
Date:   Thu Jul 16 22:35:00 2026 +0200

    geneve: require CAP_NET_ADMIN in the device netns for changelink
    
    commit 8efb8f8bbb353b8f2fdf4f37534c6d96c9f69e01 upstream.
    
    A tunnel changelink() operates on at most two netns, dev_net(dev) and
    the sticky underlay netns geneve->net. They differ once the device is
    created in or moved to a netns other than the one the request runs in.
    The rtnl changelink path checks CAP_NET_ADMIN only against dev_net(dev),
    so a caller privileged there but not in geneve->net can rewrite a geneve
    device whose underlay lives in geneve->net.
    
    geneve_changelink() applies the new configuration against geneve->net:
    geneve_link_config() and the geneve_quiesce()/geneve_unquiesce() pair
    reopen the underlay sockets in that netns (geneve_sock_add() uses
    geneve->net), so the same reasoning as the tunnel changelink series
    applies here.
    
    Gate geneve_changelink() with rtnl_dev_link_net_capable(), at the top of
    the op before any attribute is parsed, matching ipgre_changelink() and
    the rest of the "require CAP_NET_ADMIN in the device netns for
    changelink" series.
    
    Found by 0sec automated security-research tooling (https://0sec.ai).
    
    Fixes: 5b861f6baa3a ("geneve: add rtnl changelink support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Link: https://patch.msgid.link/20260716203500.70573-3-doruk@0sec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
gpio: pch: use raw_spinlock_t for the register lock [+ + +]
Author: Junjie Cao <junjie.cao@intel.com>
Date:   Thu Aug 6 10:18:16 2026 +0800

    gpio: pch: use raw_spinlock_t for the register lock
    
    [ Upstream commit a02b8950d619123da64f69b70fe1dadef217dfe4 ]
    
    pch_irq_type() is registered as the irq_chip .irq_set_type callback and
    takes chip->spinlock with spin_lock_irqsave().  This callback is reached
    from __setup_irq() -> __irq_set_trigger() -> chip->irq_set_type() while
    the caller holds desc->lock, a raw_spinlock_t, with hardirqs disabled.
    That context is not sleepable, but on PREEMPT_RT a regular spinlock_t is
    an rtmutex-backed sleeping lock, so acquiring it there is invalid.
    
    This was confirmed on a PREEMPT_RT kernel with lockdep
    (PROVE_RAW_LOCK_NESTING and DEBUG_ATOMIC_SLEEP).  A grounded PoC mirrored
    pch_irq_type()'s locking and drove it through the real genirq carrier
    irq_set_irq_type() -> __irq_set_trigger() -> chip->irq_set_type(), i.e.
    the same __irq_set_trigger() edge that __setup_irq() takes for a
    requested IRQ.  With the original spin_lock_irqsave() edge lockdep
    reported an invalid wait context, immediately followed by:
    
      BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
      in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 95, name: insmod
      hardirqs last disabled at (3784): _raw_spin_lock_irqsave+0x4f/0x60
       rt_spin_lock+0x3a/0x1c0
       repro_irq_set_type+0x64/0xa0 [pch_repro]
       __irq_set_trigger+0x69/0x140
       irq_set_irq_type+0x78/0xd0
    
    Switching the mirrored lock to raw_spinlock_t made both splats go away.
    
    Convert the register lock to raw_spinlock_t.  The same lock also
    serializes the GPIO direction/value callbacks and the suspend/resume
    register save/restore, but all of those critical sections only perform
    MMIO register accesses (ioread32()/iowrite32()) and
    irq_set_handler_locked(); none of them contain sleepable operations.
    Keeping this register lock non-sleeping is therefore appropriate for the
    irqchip callbacks and does not change the GPIO-side locking contract.
    
    This is the same class of issue and fix as recently addressed for other
    GPIO controllers, e.g. commit 286533cb14a3 ("gpio: sch: use raw_spinlock_t
    in the irq startup path") and commit 90f0109019e6 ("gpio: eic-sprd: use
    raw_spinlock_t in the irq startup path").
    
    Fixes: 38eb18a6f92d ("gpio-pch: Support interrupt function")
    Cc: stable@vger.kernel.org
    Signed-off-by: Junjie Cao <junjie.cao@intel.com>
    Reviewed-by: Linus Walleij <linusw@kernel.org>
    Link: https://patch.msgid.link/20260723014129.1129730-1-junjie.cao@intel.com
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    (cherry picked from commit a02b8950d619123da64f69b70fe1dadef217dfe4)
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
gve: fix Rx queue stall on alloc failure [+ + +]
Author: Eddie Phillips <eddiephillips@google.com>
Date:   Thu Jul 30 22:43:37 2026 -0700

    gve: fix Rx queue stall on alloc failure
    
    commit b65352a1bac64442ad95e64f385b40ccb9f1b0db upstream.
    
    When the system is under extreme memory pressure, page allocations can
    fail during the Rx buffer refill loop. If the number of buffers posted
    to hardware falls below a critical low threshold and the refill loop
    exits due to allocation failures, the queue can stall:
    
    1. The device drops incoming packets because there are no descriptors.
    2. Since no packets are processed, no Rx completions are generated.
    3. Because no completions occur, NAPI is never scheduled, preventing
       the refill loop from running again even after memory is freed.
    
    This results in a permanent queue stall.
    
    Resolve this by introducing a starvation recovery timer for each Rx queue.
    If the number of buffers posted to hardware falls below a critical low
    threshold, start a timer to periodically reschedule NAPI. Once NAPI runs
    and successfully refills the queue above the threshold, the timer is
    not rescheduled.
    
    The threshold is set to 32 because a single maximum-sized Receive Segment
    Coalescing (RSC) packet can consume up to 19 descriptors in the Rx path.
    Lower thresholds (such as 8 or 16) would be insufficient to process a
    complete maximum-sized RSC packet, risking packet drops or unexpected
    hardware behavior under memory pressure. Setting the threshold to 32
    guarantees a safe margin to handle at least one full RSC packet.
    
    Cc: stable@vger.kernel.org
    Fixes: 9b8dd5e5ea48 ("gve: DQO: Add RX path")
    Reviewed-by: Jordan Rhee <jordanrhee@google.com>
    Signed-off-by: Eddie Phillips <eddiephillips@google.com>
    Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
    Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
    Link: https://patch.msgid.link/20260709211906.3322883-1-hramamurthy@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
HID: logitech-dj: Fix maxfield check in DJ short report validation [+ + +]
Author: HyeongJun An <sammiee5311@gmail.com>
Date:   Thu Jun 18 15:37:37 2026 +0900

    HID: logitech-dj: Fix maxfield check in DJ short report validation
    
    commit 590cc4d782487632a52f37c2171bee1eeea29627 upstream.
    
    Commit b6a57912854e ("HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT
    related user initiated OOB write") added validation for the DJ short
    output report, but the error path dereferences rep->field[0] even when
    rep->maxfield is zero.
    
    Commit 8b9a097eb2fc ("HID: logitech-dj: fix wrong detection of bad
    DJ_SHORT output report") made the check conditional on rep being present,
    but a crafted descriptor can still create report ID 0x20 with only padding
    output items. hid-core registers the report, ignores the padding field,
    and leaves rep->maxfield as zero.
    
    In that case the validation enters the rep->maxfield < 1 branch and then
    dereferences rep->field[0]->report_count while printing the error message,
    causing a NULL pointer dereference during probe. This is reproducible with
    uhid by emulating a Logitech receiver with a padding-only DJ short output
    report:
    
      BUG: KASAN: null-ptr-deref in logi_dj_probe+0xb1/0x754 [hid_logitech_dj]
      Read of size 4 at addr 0000000000000028 by task kworker/4:1/129
      ...
      Call Trace:
       logi_dj_probe+0xb1/0x754 [hid_logitech_dj]
       hid_device_probe+0x329/0x3f0 [hid]
       really_probe+0x162/0x570
       __device_attach+0x137/0x2c0
       bus_probe_device+0x38/0xc0
       device_add+0xa56/0xce0
       hid_add_device+0x19c/0x280 [hid]
       uhid_device_add_worker+0x2c/0xb0 [uhid]
    
    Reject the zero-field report before printing the field report_count.
    
    Fixes: b6a57912854e ("HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT related user initiated OOB write")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

HID: logitech-dj: fix wrong detection of bad DJ_SHORT output report [+ + +]
Author: Benjamin Tissoires <bentiss@kernel.org>
Date:   Fri Apr 10 16:03:07 2026 +0200

    HID: logitech-dj: fix wrong detection of bad DJ_SHORT output report
    
    [ Upstream commit 8b9a097eb2fc37b486afd81388c693bf3ab44466 ]
    
    commit b6a57912854e ("HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT
    related user initiated OOB write") assumed that all HID devices attached
    to the logitech-dj driver was having an output report of DJ_SHORT.
    
    However, on the receiver itself, we have 2 other HID device we attach
    here: the mouse emulation and the keyboard emulation. For those devices
    the value of rep is NULL and we are triggered a segfault here.
    
    This is doubly required because logitech-dj also handles non DJ devices
    that might not have the DJ collection.
    
    Fixes: b6a57912854e ("HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT related user initiated OOB write")
    Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT related user initiated OOB write [+ + +]
Author: Lee Jones <lee@kernel.org>
Date:   Tue Mar 24 14:36:44 2026 +0000

    HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT related user initiated OOB write
    
    [ Upstream commit b6a57912854e7ea36f3b270032661140cc4209cd ]
    
    logi_dj_recv_send_report() assumes that all incoming REPORT_ID_DJ_SHORT
    reports are 14 Bytes (DJREPORT_SHORT_LENGTH - 1) long.  It uses that
    assumption to load the associated field's 'value' array with 14 Bytes of
    data.  However, if a malicious user only sends say 1 Byte of data,
    'report_count' will be 1 and only 1 Byte of memory will be allocated to
    the 'value' Byte array.  When we come to populate 'value[1-13]' we will
    experience an OOB write.
    
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: logitech-dj: Standardise hid_report_enum variable nomenclature [+ + +]
Author: Lee Jones <lee@kernel.org>
Date:   Tue Mar 24 14:36:43 2026 +0000

    HID: logitech-dj: Standardise hid_report_enum variable nomenclature
    
    [ Upstream commit a940aee176437046598dfc786b719bd96db3c74c ]
    
    Since we will need to differentiate between the two report_enum types
    soon, let's unify the naming conventions now to save confusion and/or
    unnecessary/unrelated changes in upcoming commits.
    
    {input,output}_report_enum is used in other places to let's conform.
    
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
hinic: remove unused ethtool RSS user configuration buffers [+ + +]
Author: Chenguang Zhao <zhaochenguang@kylinos.cn>
Date:   Wed Jul 22 10:53:53 2026 +0800

    hinic: remove unused ethtool RSS user configuration buffers
    
    [ Upstream commit fe0c002928c6749b7f4a726f6f600f6dd70280ea ]
    
    rss_indir_user and rss_hkey_user are allocated and filled in
    __set_rss_rxfh() when the user configures RSS via ethtool, but
    nothing ever reads them. hinic_get_rxfh() fetches the state from
    the device, and the hardware is programmed from the original
    indir/key arguments. These buffers only leaked on driver unload.
    
    Drop the unused allocations, memcpys, and struct fields.
    
    Fixes: 4fdc51bb4e92 ("hinic: add support for rss parameters with ethtool")
    Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
    Reviewed-by: Joe Damato <joe@dama.to>
    Link: https://patch.msgid.link/20260722025353.328179-1-chenguang.zhao@linux.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
hwmon: (adt7470) Fix busy-loop and I2C flooding in update thread [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:19 2026 -0300

    hwmon: (adt7470) Fix busy-loop and I2C flooding in update thread
    
    [ Upstream commit cb0b7f9c43b0abbd422a7e4c2c85e91db429207c ]
    
    When userspace configures 'auto_update_interval' to 0 via sysfs, the
    background kthread executes schedule_timeout_interruptible(0), which
    returns immediately.
    
    If 'num_temp_sensors' is concurrently or previously set to 0, the
    msleep_interruptible() delay inside adt7470_read_temperatures() also
    becomes 0. This combination forces the background thread into a tight,
    unbounded busy-loop, hogging the CPU and flooding the I2C bus with a
    continuous stream of transactions.
    
    Fix this vulnerability by raising the lower limit of the clamp_val in
    auto_update_interval_store() from 0 to 500 milliseconds. This guarantees
    a reasonable minimum sleep window between sensor updates, protecting the
    system from intentional or accidental I2C bus denial of service.
    
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/r/20260716213252.EACA71F000E9@smtp.kernel.org
    Fixes: 89fac11cb3e7 ("adt7470: make automatic fan control really work")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-3-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (adt7470) Fix cache updated before hardware write on I2C error [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:18 2026 -0300

    hwmon: (adt7470) Fix cache updated before hardware write on I2C error
    
    [ Upstream commit 05270bd38d9bf88a2f4c212246a8fa29f4032078 ]
    
    adt7470_temp_write() and adt7470_pwm_write() update the driver's
    cached values (temp_min, temp_max, pwm_input, pwm_enable) before issuing
    the corresponding regmap_write(), and never check whether the write
    succeeded before committing that update. If the I2C transaction fails,
    the function correctly propagates the error to the caller, but the cache
    silently keeps the new value, which was never actually applied to the
    hardware. Subsequent reads then report a value that does not match the
    device state.
    
    Reorder both write paths to update the cache only after a successful
    regmap_write(), so the cache always reflects what was actually
    written to the hardware.
    
    Fixes: ef67959c4253 ("hwmon: (adt7470) Convert to use regmap")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-2-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (adt7470) Fix divide-by-zero TOCTOU crash in fan speed read [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:23 2026 -0300

    hwmon: (adt7470) Fix divide-by-zero TOCTOU crash in fan speed read
    
    [ Upstream commit 1b46fe9dc8f8de59310f37e6c5e5c0e05ded46c3 ]
    
    If the fan data becomes 0 between the FAN_DATA_VALID() check and the
    FAN_PERIOD_TO_RPM() conversion, it will result in a divide-by-zero crash
    due to a race with a concurrent update of the cached fan value.
    
    Fix a TOCTOU issue by reading fan data once.
    
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/r/20260727034929.E29B71F000E9@smtp.kernel.org/
    Fixes: fc958a61ff6d ("hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-7-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (adt7470) Fix fans stuck in manual mode on I2C errors [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:17 2026 -0300

    hwmon: (adt7470) Fix fans stuck in manual mode on I2C errors
    
    [ Upstream commit 625a2c02a1c04571232a746fe188b4d9a8d63edd ]
    
    During adt7470_read_temperatures(), the driver temporarily switches
    the PWM channels to manual mode, performs the temperature collection,
    and then restores the original configuration registers.
    
    However, if an I2C transaction fails at any point after entering manual
    mode, the function aborts and returns immediately. This leaves the
    configuration registers un-restored, permanently trapping the fans in
    manual mode.
    
    Introduce a recovery path to ensure that the original PWM configuration
    registers are always restored, even when intermediate I2C operations
    fail.
    
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/r/20260716213252.EACA71F000E9@smtp.kernel.org
    Fixes: ef67959c4253 ("hwmon: (adt7470) Convert to use regmap")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-1-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (adt7470) Fix PWM auto temp state array and bounds check [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:24 2026 -0300

    hwmon: (adt7470) Fix PWM auto temp state array and bounds check
    
    [ Upstream commit 92413f439d1ec5e55b73ede8d66a7b971cbd1ced ]
    
    In pwm_auto_temp_store(), the parsed user input was missing bounds
    checks, allowing values > 0xF to overflow into the adjacent channel's
    bits. Furthermore, the value was being incorrectly written to the
    pwm_automatic state array instead of pwm_auto_temp.
    
    Fix this by rejecting values > 0xF with -EINVAL, and assigning the
    value to the correct array only after a successful I2C write.
    
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/all/20260727034932.0B7C41F000E9@smtp.kernel.org/#t
    Fixes: 6f9703d0be16 ("hwmon: add support for adt7470")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-8-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (adt7470) Fix swapped PWM3 and PWM4 auto mode masks [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:20 2026 -0300

    hwmon: (adt7470) Fix swapped PWM3 and PWM4 auto mode masks
    
    [ Upstream commit a3850231521b06bbbb18c8ebea100320c14a08be ]
    
    The ADT7470_PWM3_AUTO_MASK and ADT7470_PWM4_AUTO_MASK macros are
    currently defined with swapped bit values.
    
    According to Table 22 of the ADT7470 datasheet, the Fan Control Mode
    Configuration for register 0x69 follows the exact same bit position
    layout as register 0x68:
    - 0x68 Bit[7] corresponds to BHVR1 (PWM1) -> 0x80
    - 0x68 Bit[6] corresponds to BHVR2 (PWM2) -> 0x40
    - 0x69 Bit[7] corresponds to BHVR3 (PWM3) -> 0x80
    - 0x69 Bit[6] corresponds to BHVR4 (PWM4) -> 0x40
    
    Consequently, PWM3 should use mask 0x80 and PWM4 should use 0x40.
    
    This typo did not cause any functional bugs because these specific
    macros are never referenced in the driver code. Instead, the driver
    correctly applies the configuration by relying on the modulo parity of
    the channel index (e.g., `channel % 2`) to selectively apply either
    ADT7470_PWM1_AUTO_MASK (0x80) or ADT7470_PWM2_AUTO_MASK (0x40).
    Since the bit layout is identical between the two configuration
    registers, the hardware is currently configured correctly.
    
    Fix the macro definitions to reflect the datasheet accurately and
    prevent future bugs or confusion during code review and refactoring.
    As this is a purely cosmetic fix with no functional impact, a backport
    to stable kernels is not necessary.
    
    Fixes: 6f9703d0be16 ("hwmon: add support for adt7470")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-4-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (adt7470) Fix temperature alarm logic in hwmon_temp_read() [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:21 2026 -0300

    hwmon: (adt7470) Fix temperature alarm logic in hwmon_temp_read()
    
    [ Upstream commit 1a18c79c4bc44cc5349c60e16b0b744dc6ec5f77 ]
    
    During the conversion the alarm callback started interpreting the
    channel index as an alarm bitmask, resulting in incorrect alarm
    reporting. Compute the proper alarm bit instead.
    
    Reported-by: sashiko-bot@kernel.org
    Closes: https://lore.kernel.org/r/20260717211224.B9E291F000E9@smtp.kernel.org
    Fixes: fc958a61ff6d ("hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-5-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (adt7470) Use cached PWM frequency value [+ + +]
Author: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date:   Mon Jul 27 21:22:22 2026 -0300

    hwmon: (adt7470) Use cached PWM frequency value
    
    [ Upstream commit 60677cd4c28f44d5b307d3029dccece38fcce90f ]
    
    adt7470_pwm_read() currently ignores failures returned by
    pwm1_freq_get(). If the register read fails, the negative error code is
    returned through *val while the function itself reports success,
    potentially exposing a negative PWM frequency through sysfs.
    
    Fix this by using the cached PWM frequency maintained by the driver,
    eliminating the register access from the read path.
    
    Apart from the corrected error propagation and using the cached value,
    no functional change is intended.
    
    Fixes: ef67959c4253 ("hwmon: (adt7470) Convert to use regmap")
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-6-598e38a46ba6@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (corsair-cpro) Stop device IO before calling hid_hw_stop [+ + +]
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Tue Jul 7 17:52:54 2026 -0700

    hwmon: (corsair-cpro) Stop device IO before calling hid_hw_stop
    
    [ Upstream commit 94c87871b051d7ad758828a805215a2ec194512a ]
    
    Calling hid_hw_stop() does not stop the device IO.
    This results in a race condition between hid_input_report() and the point
    immediately following the execution of hid_device_io_start() within
    the driver probe function. If the probe operation fails after "io start"
    has been initiated, this race condition will result in a UAF vulnerability.
    
    Fix the problem by calling hid_device_io_stop() before calling
    hid_hw_stop().
    
    Reported-by: Sashiko <sashiko-bot@kernel.org>
    Fixes: 40c3a44542257 ("hwmon: add Corsair Commander Pro driver")
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (corsair-psu) fix possible out-of-bounds access on missing string termination [+ + +]
Author: Wilken Gottwalt <wilken.gottwalt@posteo.net>
Date:   Wed Aug 5 07:19:20 2026 +0000

    hwmon: (corsair-psu) fix possible out-of-bounds access on missing string termination
    
    [ Upstream commit 36c4d73ce05d1d8896c2669eb0730d35a02a2ec1 ]
    
    In theory it could be possible that the REPLY_SIZE sized buffers for
    holding the vendor and product strings could be end up missing the null
    termination (for example by malicious hardware built on purpose)
    required by the seq_printf() call. That limits the debugfs printf calls
    to a maximum string length of REPLY_SIZE.
    
    Fixes: d115b51e0e567 ("hwmon: add Corsair PSU HID controller driver")
    Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>
    Link: https://lore.kernel.org/r/anLj9gPWRoRDbQBV@monster.localdomain
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (corsair-psu) Stop device IO before calling hid_hw_stop [+ + +]
Author: Edward Adam Davis <eadavis@qq.com>
Date:   Tue Apr 28 12:12:26 2026 +0800

    hwmon: (corsair-psu) Stop device IO before calling hid_hw_stop
    
    [ Upstream commit 9ab8656548cd737b98d0b19c4253aff8d68e97f4 ]
    
    hid_hw_stop() does not stop the device IO.
    
    This results in a race condition between hid_input_report() and the point
    immediately following the execution of hid_device_io_start() within
    corsairpsu_probe(). If the probe operation fails after "io start" has
    been initiated, this race condition will result in a uaf vulnerability
    [1].
    
    CPU0                            CPU1
    ====                            ====
    corsairpsu_probe()
     hid_device_io_start()
      ... unlock driver_input_lock
     hid_hw_stop()
      kfree(hidraw)                 __hid_input_report()
                                     ... acquire driver_input_lock
                                     hid_report_raw_event()
                                      hidraw_report_event()
                                       ... access hidraw's list_lock // trigger uaf
    
    Consequently, when corsairpsu_probe() fails and hid_hw_stop() needs to
    be executed, the io_started flag is first cleared while holding the
    driver_input_lock to prevent potential race conditions involving input
    reports.
    
    [1]
    BUG: KASAN: slab-use-after-free in rt_spin_lock+0x83/0x400 kernel/locking/spinlock_rt.c:56
    Call Trace:
     hidraw_report_event+0x5d/0x3a0 drivers/hid/hidraw.c:577
     hid_report_raw_event+0x311/0x1730 drivers/hid/hid-core.c:2076
     __hid_input_report drivers/hid/hid-core.c:2152 [inline]
     hid_input_report+0x44e/0x580 drivers/hid/hid-core.c:2174
     hid_irq_in+0x47e/0x6d0 drivers/hid/usbhid/hid-core.c:286
     __usb_hcd_giveback_urb+0x3b3/0x5e0 drivers/usb/core/hcd.c:1657
     dummy_timer+0x8a9/0x47d0 drivers/usb/gadget/udc/dummy_hcd.c:2005
    
    Allocated by task 10:
     hidraw_connect+0x57/0x430 drivers/hid/hidraw.c:606
     hid_connect+0x5bf/0x19d0 drivers/hid/hid-core.c:2277
     hid_hw_start+0xa8/0x120 drivers/hid/hid-core.c:2387
     corsairpsu_probe+0xd9/0x3c0 drivers/hwmon/corsair-psu.c:782
    
    Freed by task 10:
     hidraw_disconnect+0x4f/0x60 drivers/hid/hidraw.c:662
     hid_disconnect drivers/hid/hid-core.c:2362 [inline]
     hid_hw_stop+0x101/0x1e0 drivers/hid/hid-core.c:2407
     corsairpsu_probe+0x327/0x3c0 drivers/hwmon/corsair-psu.c:826
    
    Fix the problem by calling hid_device_io_stop() before calling
    hid_hw_stop().
    
    Fixes: d115b51e0e56 ("hwmon: add Corsair PSU HID controller driver")
    Reported-by: syzbot+9eebf5f6544c5e873858@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=9eebf5f6544c5e873858
    Tested-by: syzbot+9eebf5f6544c5e873858@syzkaller.appspotmail.com
    Signed-off-by: Edward Adam Davis <eadavis@qq.com>
    Link: https://lore.kernel.org/r/tencent_BB7C33EB9EA41B7B4B5F1B8B25C0BA13BB08@qq.com
    [groeck: Updated subject and description;
     call hid_device_io_stop() only if IO has been started]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (nct6775-core) Prevent access to unsupported weight registers [+ + +]
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Mon Jul 27 13:35:37 2026 -0700

    hwmon: (nct6775-core) Prevent access to unsupported weight registers
    
    [ Upstream commit d0b704e569ac3b8416d8e02270cdc9bf830ed395 ]
    
    Sashiko reports:
    
    During initialization of the nct6116 chip, the driver sets data->pwm_num
    to 5. However, it assigns several NCT6106 register arrays (such as
    NCT6106_REG_WEIGHT_DUTY_STEP, NCT6106_REG_WEIGHT_TEMP_SEL, and
    NCT6106_REG_WEIGHT_TEMP_*) to data->REG_PWM and data->REG_WEIGHT_TEMP.
    These arrays only contain 3 elements.
    
    In nct6775_update_pwm(), the driver iterates up to data->pwm_num. If
    data->has_pwm has bits 3 or 4 set (which is structurally possible for
    nct6116), the loop attempts to read elements at index 3 and 4 from these
    3-element arrays. This results in a global out-of-bounds read, which can
    be caught by KASAN.
    
    Furthermore, the driver uses these garbage out-of-bounds values as
    hardware register addresses for subsequent read and write operations. This
    leads to invalid hardware register access, potentially causing hardware
    misconfiguration or system crashes.
    
    The underlying problem is that the chip does support up to five fan
    control channels, but only the first three support weight control.
    Fix the problem by extending the affected weight register arrays with
    zeroed fields. The driver uses zeroed register addresses to determine
    if a register is supported or not, and skips accesses for unsupported
    registers.
    
    Reported-by: Sashiko <sashiko-bot@kernel.org>
    Fixes: 29c7cb485b32 ("hwmon: (nct6775) Integrate new model nct6116")
    Cc: Björn Gerhart <gerhart@posteo.de>
    Cc: Florian Bezdeka <florian.bezdeka@siemens.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (npcm750-pwm-fan): stop fan timer on device detach [+ + +]
Author: Hongyan Xu <getshell@seu.edu.cn>
Date:   Wed Jul 29 18:01:16 2026 +0800

    hwmon: (npcm750-pwm-fan): stop fan timer on device detach
    
    commit f27f6976ea269219c1259a7c2f8c6dfe782540a3 upstream.
    
    When a fan tach channel is present, npcm7xx_pwm_fan_probe() starts
    fan_timer. The timer callback polls tach state and rearms the timer, but
    the driver has no remove callback or devm cleanup action to stop it. On
    device detach, the devm-managed driver data and I/O mappings can be
    released while the timer is still pending or running.
    
    Register a devm cleanup action before starting the timer and shut the
    timer down synchronously from that action.
    
    This issue was found by a static analysis tool.
    
    Fixes: f1fd4a4db777 ("hwmon: Add NPCM7xx PWM and Fan driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
    Link: https://lore.kernel.org/r/20260729100116.790-1-getshell@seu.edu.cn
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

hwmon: (occ) Add sysfs entries for additional extended status bits [+ + +]
Author: Eddie James <eajames@linux.ibm.com>
Date:   Tue Feb 15 09:10:21 2022 -0600

    hwmon: (occ) Add sysfs entries for additional extended status bits
    
    [ Upstream commit a03d8969887325167d5fe47ead99d280bbbc6b06 ]
    
    Add sysfs entries for DVFS due to a VRM Vdd over-temperature condition,
    and add the GPU throttling condition bits (such that if bit 1 is set,
    GPU1 is throttling).
    
    Signed-off-by: Eddie James <eajames@linux.ibm.com>
    Reviewed-by: Joel Stanley <joel@jms.id.au>
    Link: https://lore.kernel.org/r/20220215151022.7498-4-eajames@linux.ibm.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Stable-dep-of: 70e76e700fc6 ("hwmon: occ: validate poll response sensor blocks")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (occ) Add sysfs entry for IPS (Idle Power Saver) status [+ + +]
Author: Eddie James <eajames@linux.ibm.com>
Date:   Tue Feb 15 09:10:19 2022 -0600

    hwmon: (occ) Add sysfs entry for IPS (Idle Power Saver) status
    
    [ Upstream commit 6109c3e1905c3f8d0a3909c5f6a9ad5186822b2b ]
    
    BMC control applications need to check the Idle Power Saver status
    byte returned by the OCC poll response, so export it in sysfs with
    the other OCC-specific data.
    
    Signed-off-by: Eddie James <eajames@linux.ibm.com>
    Reviewed-by: Joel Stanley <joel@jms.id.au>
    Link: https://lore.kernel.org/r/20220215151022.7498-2-eajames@linux.ibm.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Stable-dep-of: 70e76e700fc6 ("hwmon: occ: validate poll response sensor blocks")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (occ) Add sysfs entry for OCC mode [+ + +]
Author: Eddie James <eajames@linux.ibm.com>
Date:   Tue Feb 15 09:10:20 2022 -0600

    hwmon: (occ) Add sysfs entry for OCC mode
    
    [ Upstream commit a25126fc32890a2a03ba5ddd1189aa8a4bcf4591 ]
    
    BMC control applications need to check the OCC mode returned by the
    OCC poll response, so export it in sysfs with the other OCC-specific
    data.
    
    Signed-off-by: Eddie James <eajames@linux.ibm.com>
    Reviewed-by: Joel Stanley <joel@jms.id.au>
    Link: https://lore.kernel.org/r/20220215151022.7498-3-eajames@linux.ibm.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Stable-dep-of: 70e76e700fc6 ("hwmon: occ: validate poll response sensor blocks")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (occ) Delay hwmon registration until user request [+ + +]
Author: Eddie James <eajames@linux.ibm.com>
Date:   Wed Apr 27 09:04:43 2022 -0500

    hwmon: (occ) Delay hwmon registration until user request
    
    [ Upstream commit 849b0156d9960da628a06756bb920d9571c15e66 ]
    
    Instead of registering the hwmon device at probe time, use the
    existing "occ_active" sysfs file to control when the driver polls
    the OCC for sensor data and registers with hwmon. The reason for
    this change is that the SBE, which is the device by which the
    driver communicates with the OCC, cannot handle communications
    during certain system state transitions, resulting in
    unrecoverable system errors.
    
    Signed-off-by: Eddie James <eajames@linux.ibm.com>
    Link: https://lore.kernel.org/r/20220427140443.11428-1-eajames@linux.ibm.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Stable-dep-of: 70e76e700fc6 ("hwmon: occ: validate poll response sensor blocks")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (pmbus) Fix return value from pmbus_update_byte_data() [+ + +]
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Tue Jul 28 08:41:40 2026 -0700

    hwmon: (pmbus) Fix return value from pmbus_update_byte_data()
    
    [ Upstream commit a19038a200f18d9e74ac30081797917d0886e16b ]
    
    pmbus_update_byte_data() is supposed to return a negative error code or 0.
    However, if no change is made to the register, it actually returns the
    register value. This can result in problems if the calling code explicitly
    expects to see an error code or 0.
    
    Fix it to return 0 on success or the error code as expected.
    
    Fixes: 11c119986f270 ("hwmon: (pmbus) add helpers for byte write and read modify write")
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: occ: validate poll response sensor blocks [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Mon Jul 20 19:58:26 2026 +0800

    hwmon: occ: validate poll response sensor blocks
    
    [ Upstream commit 70e76e700fc6c46afb4e17aec099a1ea089b4a22 ]
    
    The OCC poll response parser walks a counted list of sensor data blocks.
    It used the static backing-array capacity as the parse boundary, but a
    transport response makes only data_length bytes current and valid. A
    truncated response can therefore make the parser consume a block header or
    block extent outside the current response.
    
    Use data_length as the parent boundary, prove the fixed poll header and
    each current block header before reading them, and prove the complete block
    before advancing. Keep parsed sensor metadata local until the complete
    response has passed validation, then publish it. Propagate
    malformed-response errors before publishing the OCC as active.
    
    Fixes: aa195fe49b03 ("hwmon (occ): Parse OCC poll response")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Link: https://lore.kernel.org/r/20260720115826.14813-1-pengpeng@iscas.ac.cn
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
i2c: amd-mp2: Unregister callback on adapter add failure [+ + +]
Author: Myeonghun Pak <mhun512@gmail.com>
Date:   Tue Jul 21 23:41:47 2026 +0900

    i2c: amd-mp2: Unregister callback on adapter add failure
    
    commit 82048795242f04275a3f49ffc66ad851b6120954 upstream.
    
    amd_mp2_register_cb() stores the platform I2C context in the MP2 PCI
    driver's callback table before the adapter is registered. If
    i2c_add_adapter() fails, probe returns and devres frees the context,
    but the PCI driver can still dereference the stale pointer from its IRQ
    and system-sleep callbacks.
    
    Unregister the callback before returning the adapter registration error.
    
    Fixes: 529766e0a011 ("i2c: Add drivers for the AMD PCIe MP2 I2C controller")
    Co-developed-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
    Cc: <stable@vger.kernel.org> # v5.2+
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20260721144147.31150-1-mhun512@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: imx: Cancel hrtimer before clearing slave pointer [+ + +]
Author: Liem <liem16213@gmail.com>
Date:   Mon Jun 29 10:38:29 2026 +0800

    i2c: imx: Cancel hrtimer before clearing slave pointer
    
    commit 6ac7702b6cc2b94aaed9ef2d95bfbefcdc90061f upstream.
    
    In i2c_imx_unreg_slave(), the slave pointer is set to NULL after
    disabling interrupts.  However, a pending interrupt might already
    have started the hrtimer (i2c_imx_slave_timeout) before the pointer
    was cleared.  If the hrtimer fires after i2c_imx->slave is set to
    NULL, the timer callback i2c_imx_slave_finish_op() will call
    i2c_imx_slave_event() with a NULL slave pointer, which results in a
    use-after-free / NULL pointer dereference.
    
    Fix by canceling the hrtimer and waiting for it to complete after
    disabling interrupts, before clearing the slave pointer.
    
    Fixes: f7414cd6923f ("i2c: imx: support slave mode for imx I2C driver")
    Signed-off-by: Liem <liem16213@gmail.com>
    Cc: <stable@vger.kernel.org> # v5.11+
    Acked-by: Carlos Song <carlos.song@nxp.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20260629023829.152651-3-liem16213@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: jz4780: Cache host clock rate at probe to prevent CCF prepare_lock deadlock [+ + +]
Author: H. Nikolaus Schaller <hns@goldelico.com>
Date:   Sun Jul 19 22:19:43 2026 +0200

    i2c: jz4780: Cache host clock rate at probe to prevent CCF prepare_lock deadlock
    
    commit d99607c888f26e8a4e9fe9772860cef4aff86bb4 upstream.
    
    Fix a severe AB/BA deadlock between the Common Clock Framework (CCF)
    and the I2C adapter lock, which triggers when an I2C-controlled clock
    generator client (like the Si5351) is registered or modified under the CCF.
    
    During an i2c client clock (generator) frequency change, the CCF acquires its global
    'prepare_lock' mutex and the driver calls i2c_transfer() to update the client's
    chip registers, stalling for the adapter's I2C bus lock.
    
    Concurrently, an independent, parallel transfer on the same bus (e.g., a GPIO
    expander handling LEDs) can hold the I2C adapter lock. Inside this parallel
    transfer path, jz4780_i2c_set_speed() calls clk_get_rate() on the host
    controller's input clock to calculate bus timings. This call attempts to acquire
    the blocked CCF 'prepare_lock', creating a circular dependency that freezes
    the system.
    
    The jz4780 host controller clock itself is static and never changes at runtime.
    
    However, calling clk_get_rate() inside the active transfer path introduces
    an unnecessary dependency on the CCF internal locks.
    
    Eliminate this synchronous clk_get_rate() call from the active transfer
    path by caching the static host peripheral clock rate once - inside the private
    jz4780_i2c structure during jz4780_i2c_probe(). Update jz4780_i2c_set_speed()
    to use this cached value, safely decoupling active I2C transactions from the
    CCF internal locks without any risk of stale timings.
    
    Assisted-by web based Google AI (pinpointing the bug and writing the message).
    
    Fixes: ba92222ed63a12 ("i2c: jz4780: Add i2c bus controller driver for Ingenic JZ4780")
    Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
    Cc: <stable@vger.kernel.org> # v4.1+
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/2db6fd233aceb7238474e4833f4d25ca681c3ffb.1784492382.git.hns@goldelico.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
IB/mad: Drop unmatched RMPP responses before reassembly [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sat Jun 6 16:01:55 2026 -0400

    IB/mad: Drop unmatched RMPP responses before reassembly
    
    [ Upstream commit d2e52d610b9b09694261632340b801a421e0b0c5 ]
    
    Kernel-handled RMPP receive processing starts reassembly for active
    DATA responses before the response is matched to an outstanding send.
    The normal match happens later, after ib_process_rmpp_recv_wc() has
    either assembled a complete message or consumed the segment.
    
    That ordering lets an unsolicited response that routes to a kernel
    RMPP agent by the high TID bits allocate or extend RMPP receive state
    before the full TID and source address are checked against a real
    request. A reordered burst can therefore reach the receive-side
    insertion path even though the response would not match any send.
    
    For kernel-handled RMPP DATA responses, require the existing
    ib_find_send_mad() match before entering RMPP reassembly. The matcher
    already checks the full TID, management class and source address/GID
    against the agent wait, backlog and in-flight send lists. If there is
    no match, drop the response without creating RMPP state.
    
    This leaves the RMPP window behavior unchanged and only rejects
    responses that have no corresponding request.
    
    Fixes: fa619a77046b ("[PATCH] IB: Add RMPP implementation")
    Assisted-by: Codex:gpt-5-5-xhigh
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Link: https://patch.msgid.link/3170ff3bc389a930bb1641f2caa394a0b2241579.1780774907.git.michael.bommarito@gmail.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ice: use READ_ONCE() to access cached PHC time [+ + +]
Author: Sergey Temerkhanov <sergey.temerkhanov@intel.com>
Date:   Fri Jul 17 11:53:30 2026 -0700

    ice: use READ_ONCE() to access cached PHC time
    
    commit 2915681b89f817677ab9f1166d95b595bc144f5f upstream.
    
    ptp.cached_phc_time is a 64-bit value updated by a periodic work item
    on one CPU and read locklessly on another.  On 32-bit or non-atomic
    architectures this can result in a torn read.  Use READ_ONCE() to
    enforce a single atomic load.
    
    Fixes: 77a781155a65 ("ice: enable receive hardware timestamping")
    Cc: stable@vger.kernel.org
    Signed-off-by: Sergey Temerkhanov <sergey.temerkhanov@intel.com>
    Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20260717185340.3595286-9-anthony.l.nguyen@intel.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
igbvf: Fix leak in TX DMA error cleanup [+ + +]
Author: Matt Vollrath <tactii@gmail.com>
Date:   Thu Apr 16 23:34:52 2026 -0400

    igbvf: Fix leak in TX DMA error cleanup
    
    commit 0565052b7e2f436b7f1541f4849da96dc0aa7a0e upstream.
    
    If an error is encountered while mapping TX buffers, the driver should
    unmap any buffers already mapped for that skb.
    
    Because count is incremented before each frag mapping, it will always
    match the correct number of unmappings needed when dma_error is reached.
    Decrementing count before the while loop in dma_error causes an
    off-by-one error. If any mapping was successful before an unsuccessful
    mapping, exactly one DMA mapping (the head) would leak.
    
    This bug was introduced by a 2010 fix for an endless loop in dma_error.
    All other affected drivers have already been fixed.
    
    Fixes: c1fa347f20f1 ("e1000/e1000e/igb/igbvf/ixgb/ixgbe: Fix tests of unsigned in *_tx_map()")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-4-7-opus
    Signed-off-by: Matt Vollrath <tactii@gmail.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ila: reload IPv6 header after pskb_may_pull in checksum adjust [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Tue Jul 14 07:49:03 2026 -0400

    ila: reload IPv6 header after pskb_may_pull in checksum adjust
    
    commit 92d3817649df2b0b6a008a686c8275c88d7ef594 upstream.
    
    ila_csum_adjust_transport() caches ip6h = ipv6_hdr(skb) before calling
    pskb_may_pull(). On a non-linear skb whose transport header sits in a page
    fragment, pskb_may_pull() can call __pskb_pull_tail() / pskb_expand_head()
    and free the old skb head, leaving ip6h dangling; the following
    get_csum_diff(ip6h, p) then reads freed memory. ila_update_ipv6_locator()
    uses ip6h (and the iaddr derived from it) again after the csum-adjust
    call and additionally writes the new locator through that pointer.
    
    Impact: a remote IPv6 packet routed through a configured ILA
    csum-adjust-transport route or receive-side mapping triggers a
    slab-use-after-free in ila_update_ipv6_locator() (KASAN). The route or
    mapping requires CAP_NET_ADMIN to configure, but trigger packets are
    unauthenticated once it exists.
    
    Reload ip6h after each pskb_may_pull() in ila_csum_adjust_transport()
    before the csum-diff read. In ila_update_ipv6_locator() only the
    ILA_CSUM_ADJUST_TRANSPORT case pulls the skb, so reload ip6h and iaddr in
    that case alone before the destination-address write; the neutral-map
    modes never pull and keep their cached pointers.
    
    Fixes: 33f11d16142b ("ila: Create net/ipv6/ila directory")
    Cc: stable@vger.kernel.org
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Reviewed-by: Antoine Tenart <atenart@kernel.org>
    Link: https://patch.msgid.link/20260714114903.3763420-1-michael.bommarito@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ima: fix out-of-bounds read in xattr_verify() [+ + +]
Author: Lincoln Wallace <locnnil0@gmail.com>
Date:   Mon Aug 3 10:50:21 2026 -0300

    ima: fix out-of-bounds read in xattr_verify()
    
    commit 5ff232d31106f45ac87c3b64e1d35a0667777797 upstream.
    
    The digest-length check in xattr_verify() mixes int and size_t:
    
            if (xattr_len - sizeof(xattr_value->type) - hash_start >=
                            iint->ima_hash->length)
    
    sizeof() yields size_t, so the usual arithmetic conversions promote
    the whole left-hand side to unsigned 64-bit before the subtraction
    runs. For a truncated xattr this underflows instead of going negative:
    a 1-byte IMA_XATTR_DIGEST_NG xattr (xattr_len == 1, hash_start == 1)
    turns "1 - 1 - 1" into SIZE_MAX, which is trivially >= ima_hash->length.
    The check then passes and the following memcmp() reads
    iint->ima_hash->length bytes starting past the end of the buffer
    vfs_getxattr_alloc() allocated for it.
    
    Nothing upstream clamps xattr_len back into a safe range first:
    ima_get_hash_algo() only special-cases xattr_len < 2 to pick a default
    algorithm, and evm_verifyxattr() returns INTEGRITY_UNKNOWN rather than
    failing when no HMAC key is loaded, so a truncated security.ima value
    reaches the length check as-is.
    
    Rewrite the comparison so every operand stays a signed int and no
    implicit conversion to size_t can occur.
    
    Fixes: 3ea7a56067e6 ("ima: provide hash algo info in the xattr")
    Cc: stable@vger.kernel.org
    Signed-off-by: Lincoln Wallace <locnnil0@gmail.com>
    Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Input: evdev - fix information leak in evdev_pass_values() [+ + +]
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Wed Jul 29 11:30:45 2026 -0700

    Input: evdev - fix information leak in evdev_pass_values()
    
    commit 90f305f2c7a30257c683e13f4bf7c798eea992a0 upstream.
    
    In evdev_pass_values(), the input_event structure is allocated on the
    kernel stack and populated field-by-field. However, it is never fully
    initialized. On architectures where struct input_event contains explicit
    or implicit padding (such as the 32-bit __pad field on SPARC64), these
    padding bytes are left uninitialized.
    
    When this event structure is subsequently passed to the client buffer
    and later copied to userspace, the uninitialized padding bytes leak
    kernel stack memory, potentially exposing sensitive information.
    
    Similar issues exist in __evdev_queue_syn_dropped and __pass_event.
    
    Fix this by explicitly zeroing the entire event structure with memset()
    before populating its fields. This ensures all padding bytes are cleared
    before the data crosses the security boundary.
    
    Reported-by: sashiko-bot@kernel.org
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/ampGGKo4UMKru6f5@google.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: evdev - sanitize event type index when fetching event masks [+ + +]
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Mon Aug 3 18:41:49 2026 -0700

    Input: evdev - sanitize event type index when fetching event masks
    
    commit 3abd29c61d2ef37c4102cf755b18be53bb9dbea6 upstream.
    
    The user-supplied event type index passed to EVIOCGMASK / EVIOCSMASK
    ioctls is used to index the static counts array in evdev_get_mask_cnt()
    and client evmasks array in evdev_get_mask().
    
    While the event type is architecturally bounded by EV_CNT, speculative
    execution may mispredict bounds checks and perform out-of-bounds loads.
    
    Sanitize the event type index in evdev_get_mask_cnt() branchlessly using
    array_index_mask_nospec(). This clamps the index to 0 for safe array
    access and forces the returned count to 0 speculatively when the index
    is out of bounds.
    
    We do not need additional array_index_nospec() calls in evdev_get_mask()
    because evdev_get_mask_cnt() speculatively forces the count (and
    resulting xfer_size) to 0 for out-of-bounds types, preventing any
    speculative memory access to client evmasks array.
    
    Reported-by: "Wagenaar, C.C.J. (Chris)" <c.c.j.wagenaar@vu.nl>
    Cc: stable@vger.kernel.org
    Assisted-by: Antigravity:gemini-3.6-flash
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Link: https://patch.msgid.link/anFCAfvxwXB5eJF1@google.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: ims-pcu - fix heap-buffer-overflow in ims_pcu_process_data() [+ + +]
Author: Seungjin Bae <eeodqql09@gmail.com>
Date:   Wed Apr 8 09:03:59 2026 -0700

    Input: ims-pcu - fix heap-buffer-overflow in ims_pcu_process_data()
    
    [ Upstream commit 875115b82c295277b81b6dfee7debc725f44e854 ]
    
    The `ims_pcu_process_data()` processes incoming URB data byte by byte.
    However, it fails to check if the `read_pos` index exceeds
    IMS_PCU_BUF_SIZE.
    
    If a malicious USB device sends a packet larger than IMS_PCU_BUF_SIZE,
    `read_pos` will increment indefinitely. Moreover, since `read_pos` is
    located immediately after `read_buf`, the attacker can overwrite
    `read_pos` itself to arbitrarily control the index.
    
    This manipulated `read_pos` is subsequently used in
    `ims_pcu_handle_response()` to copy data into `cmd_buf`, leading to a
    heap buffer overflow.
    
    Specifically, an attacker can overwrite the `cmd_done.wait.head` located
    at offset 136 relative to `cmd_buf` in the `ims_pcu_handle_response()`.
    Consequently, when the driver calls `complete(&pcu->cmd_done)`, it
    triggers a control flow hijack by using the manipulated pointer.
    
    Fix this by adding a bounds check for `read_pos` before writing to
    `read_buf`. If the packet is too long, discard it, log a warning,
    and reset the parser state.
    
    Fixes: 628329d524743 ("Input: add IMS Passenger Control Unit driver")
    Co-developed-by: Sanghoon Choi <csh0052@gmail.com>
    Signed-off-by: Sanghoon Choi <csh0052@gmail.com>
    Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>
    Link: https://patch.msgid.link/20251221211442.841549-2-eeodqql09@gmail.com
    [dtor: factor out resetting packet state, reset checksum as well]
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Input: ims-pcu - fix logic error in packet reset [+ + +]
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Fri May 22 10:29:41 2026 -0700

    Input: ims-pcu - fix logic error in packet reset
    
    [ Upstream commit 2c9b85a14abb4811e8d4773ccd13559e59792efb ]
    
    ims_pcu_reset_packet() incorrectly sets have_stx to true, which implies
    that the start-of-packet delimiter has already been received. This
    causes the protocol parser to skip waiting for the next STX byte and
    potentially process garbage data.
    
    Correctly set have_stx to false when resetting the packet state.
    
    Fixes: 875115b82c29 ("Input: ims-pcu - fix heap-buffer-overflow in ims_pcu_process_data()")
    Cc: stable@vger.kernel.org
    Reported-by: Sashiko bot <sashiko-bot@kernel.org>
    Assisted-by: Gemini:gemini-3.1-pro
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
intel_th: fix MSC output device reference leak [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Wed Jul 15 15:08:51 2026 +0800

    intel_th: fix MSC output device reference leak
    
    commit 761b785a0cfbce43761227bc42a7f984f31f8921 upstream.
    
    intel_th_output_open() looks up the output device with
    bus_find_device_by_devt(), which returns the device with a reference that
    must be dropped after use.
    
    commit 95fc36a234da ("intel_th: fix device leak on output open()")
    attempted to drop the reference from intel_th_output_release(). However,
    a successful open replaces file->f_op with the output driver file
    operations before returning, so close runs the output driver release
    callback instead.
    
    For MSC outputs, close runs intel_th_msc_release(), which only removes
    the per-file iterator and does not drop the device reference taken by
    intel_th_output_open(). Consequently, every successful MSC output open
    leaks one device reference.
    
    Drop the device reference from intel_th_msc_release(), which is the
    release path actually used for MSC output files. Remove the now-unused
    intel_th_output_release() callback from intel_th_output_fops.
    
    Fixes: 95fc36a234da ("intel_th: fix device leak on output open()")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Reviewed-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260715070851.2077965-1-lgs201920130244@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
iommu/amd: Bound the early ACPI HID map [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Mon Jul 20 19:46:13 2026 +0800

    iommu/amd: Bound the early ACPI HID map
    
    [ Upstream commit fb80117fddb5b477218dc99bb53911b72c3847f8 ]
    
    The ivrs_acpihid command-line parser appends entries to a fixed
    four-element early_acpihid_map array. Unlike the sibling IOAPIC and HPET
    parsers, it does not reject a fifth entry before incrementing the map size.
    
    Check the capacity at the common found label before parsing the HID and
    UID or writing the entry.
    
    Fixes: ca3bf5d47cec ("iommu/amd: Introduces ivrs_acpihid kernel parameter")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
iommu/intel: Fix out-of-bounds memset in dmar_latency_disable() [+ + +]
Author: Li RongQing <lirongqing@baidu.com>
Date:   Tue Jul 21 17:34:10 2026 +0800

    iommu/intel: Fix out-of-bounds memset in dmar_latency_disable()
    
    [ Upstream commit 754f8efe45f87e3a9c6871b645b2f9d46d1b407b ]
    
    dmar_latency_disable() intends to zero out only the single
    latency_statistic entry for the given type, but the memset size was
    computed as sizeof(*lstat) * DMAR_LATENCY_NUM, which clears the entire
    array starting from &lstat[type].
    
    When type > 0, this writes beyond the end of the allocated array,
    corrupting adjacent memory.
    
    Fix by using sizeof(*lstat) to clear only the target entry.
    
    Fixes: 55ee5e67a59a ("iommu/vt-d: Add common code for dmar latency performance monitors")
    Signed-off-by: Li RongQing <lirongqing@baidu.com>
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
iommu/vt-d: Disallow SVA if page walk is not coherent [+ + +]
Author: Lu Baolu <baolu.lu@linux.intel.com>
Date:   Thu Jul 16 13:35:53 2026 +0800

    iommu/vt-d: Disallow SVA if page walk is not coherent
    
    commit 780dfed688622ea01be3c9c2c55eec2207f05e04 upstream.
    
    Hardware implementations report Scalable-Mode Page-walk Coherency Support
    via the SMPWCS field in the extended capability register. If the hardware
    does not support page-walk coherency, a clflush is required every time
    the page table entries (which are walked by the IOMMU hardware) are
    updated.
    
    In the SVA case, page tables are managed by the CPU mm core, not by the
    IOMMU driver. Because the IOMMU driver has no way of knowing whether the
    CPU page table management code has ensured coherency via clflush, the
    driver must deny SVA if the hardware does not support coherent paging.
    
    Fixes: ff3dc6521f78 ("iommu/vt-d: Fix CPU and IOMMU SVM feature matching checks")
    Cc: stable@vger.kernel.org
    Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
    Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ip6_tunnel: clear skb2->cb[] in ip6ip6_err() [+ + +]
Author: Zhiling Zou <zhilinz@nebusec.ai>
Date:   Mon Aug 3 14:12:33 2026 +0800

    ip6_tunnel: clear skb2->cb[] in ip6ip6_err()
    
    commit f803c086399da277b5d0ff36a107d0f162751800 upstream.
    
    ip6ip6_err() clones an outer IPv6 ICMP error skb, pulls it to the
    quoted inner IPv6 packet, and then passes the clone to icmpv6_send().
    The clone still carries the outer packet's inet6_skb_parm in skb->cb.
    
    If the outer packet had a Home Address Option, IP6CB(skb2)->dsthao
    remains non-zero after skb_pull(). icmpv6_send() later calls
    mip6_addr_swap(), which uses that stale dsthao offset against the quoted
    inner packet. A malformed inner destination-options header can then make
    the HAO lookup and address swap run past the end of the quoted packet
    and corrupt skb_shared_info.
    
    Clear skb2->cb[] before pulling the quoted inner IPv6 packet so the
    reply path does not reuse metadata left by the outer IPv6 stack.
    
    Fixes: e490d1d85cf5 ("[IPV6] IP6TUNNEL: Split out generic routine in ip6ip6_err().")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/fe1a5e765fbca88d69391887f0ed26a19e3e4d39.1785736562.git.zhilinz@nebusec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ipv4: fib: free fib_alias with kfree_rcu() on insert error path [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Sat Jul 4 10:14:21 2026 -0700

    ipv4: fib: free fib_alias with kfree_rcu() on insert error path
    
    [ Upstream commit f2f152e94a67bc746afaf05a1b2702c195553112 ]
    
    fib_table_insert() publishes new_fa into the leaf's fa_list with
    fib_insert_alias() before calling the fib entry notifiers. When a
    notifier fails, the error path removes new_fa with fib_remove_alias()
    (hlist_del_rcu) and frees it right away with kmem_cache_free().
    
    fib_table_lookup() walks that list under rcu_read_lock() only, so a
    concurrent lookup that already reached new_fa keeps reading it after the
    free:
    
     BUG: KASAN: slab-use-after-free in fib_table_lookup (net/ipv4/fib_trie.c:1601)
     Read of size 1 at addr ffff88810676d4eb by task exploit/297
     Call Trace:
      fib_table_lookup (net/ipv4/fib_trie.c:1601)
      ip_route_output_key_hash_rcu (net/ipv4/route.c:2814)
      ip_route_output_key_hash (net/ipv4/route.c:2705)
      __ip4_datagram_connect (net/ipv4/datagram.c:49)
      udp_connect (net/ipv4/udp.c:2144)
      __sys_connect (net/socket.c:2167)
      __x64_sys_connect (net/socket.c:2173)
      do_syscall_64
      entry_SYSCALL_64_after_hwframe
     which belongs to the cache ip_fib_alias of size 56
    
    Triggering the error path needs CAP_NET_ADMIN and a registered fib
    notifier that can reject a route; a netdevsim device whose IPv4 FIB
    resource is exhausted is enough.
    
    Free new_fa with alias_free_mem_rcu(), as fib_table_delete() already
    does for a fib_alias removed from the trie.
    
    Fixes: a6c76c17df02 ("ipv4: Notify route after insertion to the routing table")
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260704171421.1786806-1-bestswngs@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipv4: Fix fib_nlmsg_size() for RTA_VIA nexthops [+ + +]
Author: Zihan Xi <zihanx@nebusec.ai>
Date:   Thu Jul 30 12:59:26 2026 +0000

    ipv4: Fix fib_nlmsg_size() for RTA_VIA nexthops
    
    commit 4ff9548d84945d2cbf9e4c207288063a200ea397 upstream.
    
    fib_nlmsg_size() still estimates nexthop space as if every gateway is
    encoded as an IPv4 RTA_GATEWAY attribute. IPv4 routes can also carry an
    IPv6 gateway, which fib_nexthop_info() dumps as RTA_VIA.
    
    As a result, route notifications can allocate an skb that is too small.
    fib_dump_info() then fails with -EMSGSIZE and rtmsg_fib() hits the
    WARN_ON() that marks such failures as a fib_nlmsg_size() bug. With
    panic_on_warn set, this becomes a kernel panic.
    
    Mirror the actual nexthop dump layout in fib_nlmsg_size(): account for
    IPv6 nexthop gateways dumped as RTA_VIA, for the no-header rtnexthop
    layout used inside RTA_MULTIPATH, and for RTA_FLOW only when it is
    actually present.
    
    Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/6f53fa797fcaeb26966432ed7ae9bb87c4961f37.1785411220.git.zihanx@nebusec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipv4: fix use-after-free in fib_nhc_update_mtu() [+ + +]
Author: Chengfeng Ye <nicoyip.dev@gmail.com>
Date:   Sat Aug 8 02:17:10 2026 +0800

    ipv4: fix use-after-free in fib_nhc_update_mtu()
    
    commit bc5bde9ce3cc36502839dfe98e068f7303a50982 upstream.
    
    fib_nhc_update_mtu() walks the nexthop exception table under RTNL, but
    RTNL does not serialize this walk with PMTU exception updates. The walk
    uses rcu_dereference_protected() with a constant true condition without
    holding fnhe_lock.
    
    The following interleaving can therefore occur:
    
      CPU 0                              CPU 1
      fib_nhc_update_mtu()               update_or_create_fnhe()
        load fnhe                          spin_lock_bh(&fnhe_lock)
                                           fnhe_remove_oldest()
                                             unlink fnhe
                                             kfree_rcu(fnhe, rcu)
        <quiescent state>
        access fnhe after grace period
    
    KASAN reported:
    
      BUG: KASAN: slab-use-after-free in fib_nhc_update_mtu+0x3df/0x410
      Read of size 8 at addr ffff888107d49000 by task poc/90
      Call Trace:
       fib_nhc_update_mtu+0x3df/0x410
       fib_sync_mtu+0x7a/0xd0
       fib_netdev_event+0x229/0x3f0
       netif_set_mtu_ext+0x33a/0x570
       dev_set_mtu+0x88/0x120
    
    The same walk updates fnhe_pmtu and fnhe_mtu_locked. These fields form a
    pair and other writers serialize them with fnhe_lock. RCU alone prevents
    reclamation, but would still allow concurrent writers to leave a mixed
    pair.
    
    Walk the table under RCU and acquire fnhe_lock only while updating each
    exception. RCU keeps the current entry alive while the short critical
    section serializes its paired PMTU fields. This avoids holding the global
    lock while scanning all 2048 buckets for every nexthop.
    
    Fixes: af7d6cce5369 ("net: ipv4: update fnhe_pmtu when first hop's MTU changes")
    Cc: stable@vger.kernel.org
    Suggested-by: Ido Schimmel <idosch@nvidia.com>
    Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260807181710.1178747-1-nicoyip.dev@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipv4: icmp: fill flow parameters in icmp_route_lookup decoy lookup [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Wed Jul 22 10:42:36 2026 +0000

    ipv4: icmp: fill flow parameters in icmp_route_lookup decoy lookup
    
    [ Upstream commit 853e164c2b321f0711361bc23505aaeb7dc432c3 ]
    
    When Linux forwards a packet and needs to generate an ICMP error,
    icmp_route_lookup() performs a reverse-path relookup. For non-local
    destinations, it performs a decoy lookup to find the expected egress
    interface (rt2->dst.dev) before validating the path with ip_route_input().
    
    Currently, the decoy flow structure (fl4_2) only sets .daddr = fl4_dec.saddr,
    leaving .saddr, .flowi4_dscp, .flowi4_proto, .flowi4_mark, .flowi4_oif,
    .fl4_sport, .fl4_dport, and .flowi4_uid zeroed out.
    
    When policy routing rules (such as ip rule add from $SRC lookup 100, or
    dscp/fwmark/ipproto/port rules, or VRF bindings) are configured:
    1. The decoy lookup fails to match the policy rule because saddr and other
       key flow selectors are missing in fl4_2.
    2. It resolves a route using the default table instead, returning an incorrect
       egress netdev.
    3. Passing the wrong netdev to ip_route_input() causes strict reverse-path
       filtering (rp_filter=1) to fail, logging false-positive "martian source"
       warnings and causing the relookup to fail.
    
    Fix this by initializing fl4_2 from fl4_dec and:
    - Swapping source/destination IP addresses.
    - Swapping L4 ports for transport protocols with ports (TCP, UDP, SCTP, DCCP)
      so port-based policy routing matches correctly. Non-port protocols (such as
      ICMP or GRE) leave the flowi_uli union fields intact to prevent corruption.
    - Setting .flowi4_oif = l3mdev_master_ifindex(route_lookup_dev) to ensure
      VRF routing tables are respected.
    - Setting .flowi4_flags |= FLOWI_FLAG_ANYSRC to allow output route lookups
      for non-local source IP addresses.
    - Using __ip_route_output_key() instead of ip_route_output_key() for fl4_2
      so that raw FIB routing is used without triggering spurious XFRM policy
      lookups on the decoy flow (the actual XFRM lookup is performed later using
      fl4_dec).
    
    Fixes: 415b3334a21a ("icmp: Fix regression in nexthop resolution during replies.")
    Reported-by: Muhammad Ziad <muhzi100@gmail.com>
    Closes: https://lore.kernel.org/netdev/CAOAwikA60AYKdFr_UDLyja3oU4hqyAE7uFZWqum5uRdaQsgRYg@mail.gmail.com/
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: David Ahern <dsahern@kernel.org>
    Link: https://patch.msgid.link/20260722104236.2938082-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ipv6: fix Route Information option length validation [+ + +]
Author: Yuejie Shi <syjcnss@gmail.com>
Date:   Thu Jul 30 11:52:32 2026 +0800

    ipv6: fix Route Information option length validation
    
    commit d1ad8fb2ac6a1afb71dc22d9ae8efb4dda96c824 upstream.
    
    rt6_route_rcv() validates the Route Information option (RFC 4191) length
    against the prefix length, but both checks are off by one.
    
    rinfo->length is the ND option length in units of 8 octets and it
    *includes* the 8-byte option header, so an option carrying N bytes of
    prefix has length == 1 + N/8.  RFC 4191 section 2.3 requires length 3
    when Prefix Length is greater than 64, and 2 or 3 when it is greater
    than 0.  The code accepts length >= 2 and length >= 1 respectively.
    
    ipv6_addr_prefix() then copies prefix_len/8 bytes out of rinfo->prefix,
    so a Router Advertisement with (prefix_len=128, length=2) or
    (prefix_len=64, length=1) makes the kernel read up to 8 bytes past the
    end of the option.  Those bytes end up in the prefix of the route that
    gets installed, so they are visible to userspace:
    
      # RA with a Route Information option (prefix_len=128, length=2)
      # followed by a source link-layer address option, 01 01 de ad be ef ca fe
      $ ip -6 route show
      2001:db8:dead:beef:101:dead:beef:cafe via fe80::1234 dev veth0 proto ra
                         ^^^^^^^^^^^^^^^^^^ the next option, read out of bounds
    
    When the Route Information option is the last one in the packet, those
    eight bytes come from the skb tail room instead.
    
    Reject the option lengths RFC 4191 does not allow.
    
    Fixes: 70ceb4f53929 ("[IPV6]: ROUTE: Add experimental support for Route Information Option in RA (RFC4191).")
    Cc: stable@vger.kernel.org
    Signed-off-by: Yuejie Shi <syjcnss@gmail.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260730035310.74584-1-syjcnss@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipv6: prevent in6_dev_get() from resurrecting inet6_dev [+ + +]
Author: Kyle Zeng <kylebot@openai.com>
Date:   Mon Aug 3 12:27:57 2026 +0000

    ipv6: prevent in6_dev_get() from resurrecting inet6_dev
    
    commit 0e243671bc7b8eaf00f83dd2f4367436dc0cff98 upstream.
    
    in6_dev_get() reads dev->ip6_ptr under RCU and then unconditionally
    increments its refcount. Device teardown can clear the pointer and drop
    the last reference between these operations. The increment then
    resurrects an object whose RCU free has already been queued, so callers
    can use it after it is freed.
    
    Use refcount_inc_not_zero() and return NULL when the object has already
    reached zero. RCU keeps the memory accessible through the attempted
    reference acquisition, and a successful increment pins the object for
    the caller.
    
    An independent run on the exact unpatched 6f5156d7a31a (v7.2-rc3)
    kernel reproduced the invalid reference acquisition as UID 1000:
    
      refcount_t: addition on 0; use-after-free.
      ip6_mc_source+0xef4/0x17e0
    
    It was followed by the corresponding reference underflow in
    ip6_mc_source(). The supplied trace from the same unpatched revision
    additionally shows the access after the RCU read-side section ends:
    
      BUG: KASAN: slab-use-after-free in mutex_lock+0x76/0xe0
      Write of size 8 at addr ffff888015b50240 by task poc/1219
    
    Bug found and triaged by OpenAI Security Research and
    validated by Trail of Bits.
    
    Fixes: 8814c4b53381 ("[IPV6] ADDRCONF: Convert addrconf_lock to RCU.")
    Cc: stable@vger.kernel.org
    Signed-off-by: Kyle Zeng <kylebot@openai.com>
    Co-developed-by: David Lee <david.lee@trailofbits.com>
    Signed-off-by: David Lee <david.lee@trailofbits.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260803122758.666112-1-david.lee@trailofbits.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ipvs: add totalconns for dest [+ + +]
Author: Julian Anastasov <ja@ssi.bg>
Date:   Fri Jul 31 22:27:41 2026 +0800

    ipvs: add totalconns for dest
    
    commit 04d2feaed8d0103c498727191ba04001d5100e67 upstream.
    
    Replace the inactconns dest counter with totalconns, now
    inactconns can be obtained from totalconns - activeconns.
    This reduces the atomic inc/dec ops for TCP/SCTP from
    6 to 4 if the connection is established and then closed.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipvs: clear IPv4 options after rebasing tunnel ICMP errors [+ + +]
Author: Kyle Zeng <kylebot@openai.com>
Date:   Tue Aug 4 06:10:55 2026 +0000

    ipvs: clear IPv4 options after rebasing tunnel ICMP errors
    
    commit e0ba936287dfe9783426aac27e5fd76fe35b38c9 upstream.
    
    ip_vs_in_icmp() rebases an skb from the outer ICMP packet to the
    quoted original request before passing it to icmp_send(). However,
    IPCB(skb)->opt still describes the outer IPv4 header.
    
    A timestamp option in the outer header can therefore leave an offset
    that points into the quoted transport header after the rebase.
    __ip_options_echo() treats a byte at that stale location as the option
    length and copies it into the fixed-size option storage on the
    __icmp_send() stack, causing a stack out-of-bounds write.
    
    Clear the stale option metadata after resetting the network header.
    Keep the remaining control block fields, including the ingress
    interface used by the ICMP response path.
    
    Fixes: f2edb9f7706d ("ipvs: implement passive PMTUD for IPIP packets")
    Cc: stable@vger.kernel.org
    Assisted-by: Codex:gpt-5.6-sol Codex:gpt-5.5-cyber
    Signed-off-by: Kyle Zeng <kylebot@openai.com>
    Co-developed-by: David Lee <david.lee@trailofbits.com>
    Signed-off-by: David Lee <david.lee@trailofbits.com>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipvs: do not propagate one-packet flag to synced conns [+ + +]
Author: Zhiling Zou <roxy520tt@gmail.com>
Date:   Mon Jul 13 19:52:32 2026 +0800

    ipvs: do not propagate one-packet flag to synced conns
    
    commit a63d2dbaeb50a85d4c976b15a36e6b0c7113db5b upstream.
    
    Synced connections can be created before their destination exists. When
    the destination is later added, ip_vs_bind_dest() copies connection flags
    from the destination into cp->flags.
    
    IP_VS_CONN_F_ONE_PACKET connections are not synced. If a synced
    connection inherits IP_VS_CONN_F_ONE_PACKET while it is already hashed,
    expiry can treat it as a one-packet connection and skip unlinking the
    existing conn_tab node, leaving stale hash nodes pointing at a freed
    struct ip_vs_conn.
    
    Drop IP_VS_CONN_F_ONE_PACKET from destination flags when binding synced
    connections.
    
    Fixes: 26ec037f9841 ("IPVS: one-packet scheduling")
    Cc: stable@vger.kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Suggested-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Zhiling Zou <roxy520tt@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipvs: properly update the overload flag on dest edit [+ + +]
Author: Julian Anastasov <ja@ssi.bg>
Date:   Fri Jul 31 22:27:42 2026 +0800

    ipvs: properly update the overload flag on dest edit
    
    commit 8f843441c4e7eae8ea83491e8c203c2b192edcf5 upstream.
    
    The upper/lower connection thresholds for dest can be changed,
    so use ip_vs_dest_update_overload() to properly update the
    dest overload flag.
    
    The thresholds were not limited, fit them in the 0 .. INT_MAX
    range as already done in ipvsadm.
    
    As the thresholds are also read when connections are created
    and expired, use WRITE_ONCE/READ_ONCE to access them.
    
    As the lower threshold is optional, use (u - (u >> 2)) to
    calculate the 75% default value based on the upper threshold
    by preserving the integer rounding, as suggested by Yizhou Zhao.
    
    Trigger flag update when totalconns reaches one of the
    thresholds and use dst_lock to serialize the updating.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
keys: fix out-of-bounds read in keyring_get_key_chunk() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sun Jul 19 12:15:03 2026 -0400

    keys: fix out-of-bounds read in keyring_get_key_chunk()
    
    [ Upstream commit 63918731f9ae25b5deb022f118e941e6dddfcef4 ]
    
    For description-level chunks keyring_get_key_chunk() advances the read
    pointer by level * sizeof(long) past the inline prefix but only
    bounds-checks the prefix, so a long enough key description is read past
    its kmemdup(desc, desc_len + 1) allocation.  Compute the full byte
    offset and bounds-check the description against it before reading.
    
    The walk only reaches a description-level chunk when two keys collide
    through the hash, x, type and domain_tag chunks, so this is reached from
    an unprivileged add_key(2) with a crafted pair of same-type keys whose
    index hashes collide; KASAN reports a slab-out-of-bounds read.
    
    Fixes: f771fde82051 ("keys: Simplify key description management")
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
    Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
    Link: https://lore.kernel.org/r/20260719161505.2423935-2-michael.bommarito@gmail.com
    Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

keys: make keyring key-chunk byte order agree with keyring_diff_objects() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sun Jul 19 12:15:04 2026 -0400

    keys: make keyring key-chunk byte order agree with keyring_diff_objects()
    
    [ Upstream commit 58565eef0f8d861aae92abfb7658458d661cee17 ]
    
    keyring_get_key_chunk() loads description bytes into the index chunk low
    address first, while keyring_diff_objects() numbers the first differing
    bit from the low end and folds the absolute byte index into the level
    without removing the inline-prefix offset the level already carries.
    The two disagree on byte order and bit position, so the array can be
    told two keys first differ at a bit that does not differ in the chunk
    the walker uses, letting crafted descriptions collide into one node.
    
    Load the chunk in the order keyring_diff_objects() assumes and drop the
    inline-prefix length when folding the byte index into the level.  This
    only changes the in-memory ordering used to place keys within a keyring;
    add, search and read of non-colliding keys are unaffected.
    
    Fixes: f771fde82051 ("keys: Simplify key description management")
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
    Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
    Link: https://lore.kernel.org/r/20260719161505.2423935-3-michael.bommarito@gmail.com
    Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ksmbd: validate compound request size before reading StructureSize2 [+ + +]
Author: Xiang Mei (Microsoft) <xmei5@asu.edu>
Date:   Mon Jul 13 21:55:10 2026 +0000

    ksmbd: validate compound request size before reading StructureSize2
    
    [ Upstream commit 15b38176fd1530372905c602fde51fe89ec8c877 ]
    
    When ksmbd validates a compound (chained) SMB2 request,
    ksmbd_smb2_check_message() reads pdu->StructureSize2 without first
    checking that the compound element is large enough to contain it.
    StructureSize2 is a 2-byte field at offset 64
    (__SMB2_HEADER_STRUCTURE_SIZE) from the start of each element.
    
    The compound-walking logic only guarantees that a full 64-byte SMB2
    header is present for the trailing element: when NextCommand is 0, len is
    reduced to the number of bytes remaining after next_smb2_rcv_hdr_off. A
    remote client can craft a compound request whose last element has exactly
    64 bytes, so the 2-byte StructureSize2 read at offset 64 extends one byte
    past the receive buffer, producing a slab-out-of-bounds read.
    
      BUG: KASAN: slab-out-of-bounds in ksmbd_smb2_check_message (fs/smb/server/smb2misc.c:402)
      Read of size 2 at addr ffff888012ae31ac by task kworker/0:1/14
      The buggy address is located 172 bytes inside of allocated 173-byte region
      Workqueue: ksmbd-io handle_ksmbd_work
      Call Trace:
       ...
       kasan_report (mm/kasan/report.c:595)
       ksmbd_smb2_check_message (fs/smb/server/smb2misc.c:402)
       handle_ksmbd_work (fs/smb/server/server.c:119)
       process_one_work (kernel/workqueue.c:3314)
       worker_thread (kernel/workqueue.c:3397)
       kthread (kernel/kthread.c:436)
       ret_from_fork (arch/x86/kernel/process.c:158)
       ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
    
    Reject any compound element that is too small to hold StructureSize2
    before dereferencing it.
    
    Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
    Acked-by: Namjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
KVM: nVMX: Hide shadow VMCS right after VMCLEAR [+ + +]
Author: Hyunwoo Kim <imv4bel@gmail.com>
Date:   Fri Jul 17 12:30:11 2026 +0200

    KVM: nVMX: Hide shadow VMCS right after VMCLEAR
    
    commit 622ebfac01ba4f9c0060cebd41257fe46fc4a0b3 upstream.
    
    free_nested() frees the shadow VMCS while vmcs01 still points to it. But
    because it is asynchronous with respect to loaded_vmcs_clear(), the vCPU
    might migrate before the pointer is cleared and __loaded_vmcs_clear()
    may then execute VMCLEAR.
    
    The VMCS needs to stay attached until its explicit VMCLEAR completes, but
    then it can be hidden and the page safely freed.
    
    Fixes: 355f4fb1405e ("kvm: nVMX: VMCLEAR an active shadow VMCS after last use")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

KVM: VMX: Make vmread_error_trampoline() uncallable from C code [+ + +]
Author: Sean Christopherson <seanjc@google.com>
Date:   Sun Jul 26 18:44:59 2026 +0800

    KVM: VMX: Make vmread_error_trampoline() uncallable from C code
    
    [ Upstream commit 0b5e7a16a0a79a3742f0df9e45bca46f01b40e6a ]
    
    Declare vmread_error_trampoline() as an opaque symbol so that it cannot
    be called from C code, at least not without some serious fudging.  The
    trampoline always passes parameters on the stack so that the inline
    VMREAD sequence doesn't need to clobber registers.  regparm(0) was
    originally added to document the stack behavior, but it ended up being
    confusing because regparm(0) is a nop for 64-bit targets.
    
    Opportunustically wrap the trampoline and its declaration in #ifdeffery
    to make it even harder to invoke incorrectly, to document why it exists,
    and so that it's not left behind if/when CONFIG_CC_HAS_ASM_GOTO_OUTPUT
    is true for all supported toolchains.
    
    No functional change intended.
    
    Cc: Uros Bizjak <ubizjak@gmail.com>
    Signed-off-by: Sean Christopherson <seanjc@google.com>
    Link: https://lore.kernel.org/r/20220928232015.745948-1-seanjc@google.com
    [ Vivian: Adjust context. Remove check for CONFIG_CC_HAS_ASM_GOTO_OUTPUT
      which does not apply for old kernel. ]
    Signed-off-by: Vivian Wang <dramforever@live.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

KVM: x86/mmu: Fix use-after-free on vendor module reload [+ + +]
Author: Phil Rosenthal <phil@phil.gs>
Date:   Sat Jul 18 12:50:23 2026 -0400

    KVM: x86/mmu: Fix use-after-free on vendor module reload
    
    commit 52f2f7c30126037975389aa04d24c506a5177c35 upstream.
    
    mmu_destroy_caches() destroys pte_list_desc_cache and
    mmu_page_header_cache, but leaves both pointers unchanged.  The pointers
    live in kvm.ko, and therefore survive when a vendor module is unloaded
    while kvm.ko remains loaded.
    
    If creation of pte_list_desc_cache fails during a subsequent vendor
    module load, its assignment sets pte_list_desc_cache to NULL and the
    error path calls mmu_destroy_caches().  mmu_page_header_cache still
    points to the cache destroyed during the preceding vendor module
    unload.  Passing that stale pointer to kmem_cache_destroy() causes a
    slab use-after-free.
    
    Reproduce the issue on a v7.1.3 kernel with CONFIG_KASAN=y,
    CONFIG_KASAN_GENERIC=y, CONFIG_KVM=m, and CONFIG_KVM_INTEL=m.  A
    one-shot test hook forces pte_list_desc_cache to NULL on the second
    invocation of kvm_mmu_vendor_module_init():
    
      1. Load kvm.ko and kvm-intel.ko, creating both caches.
      2. Unload only kvm_intel, leaving kvm.ko loaded.
      3. Reload kvm_intel and force initialization through the -ENOMEM path.
    
    KASAN reports:
    
      BUG: KASAN: slab-use-after-free in
      kvm_mmu_vendor_module_init+0x5b/0x170 [kvm]
      ...
      kmem_cache_destroy+0x21/0x1d0
      kvm_mmu_vendor_module_init+0x5b/0x170 [kvm]
      ...
      Allocated by task 16817:
      __kmem_cache_create_args+0x12c/0x3b0
      __kmem_cache_create.constprop.0+0xb6/0xf0 [kvm]
      kvm_mmu_vendor_module_init+0x13b/0x170 [kvm]
      ...
      Freed by task 16820:
      kmem_cache_destroy+0x117/0x1d0
      kvm_mmu_vendor_module_exit+0x21/0x30 [kvm]
    
    Clear both pointers immediately after destroying their caches so that
    the stored state reflects the caches' lifetime and repeated cleanup is
    safe.
    
    With the fix applied, the same injected vendor module reload fails with
    -ENOMEM as expected and produces no KASAN report.
    
    Fixes: cb498ea2ce1d ("KVM: Portability: Combine kvm_init and kvm_init_x86")
    Cc: stable@vger.kernel.org
    Signed-off-by: Phil Rosenthal <phil@phil.gs>
    Message-ID: <20260718-kvm-mmu-cache-uaf-v3-1-e103b93c74e1@phil.gs>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
libceph: bound get_version reply decode to front len [+ + +]
Author: Douya Le <ldy3087146292@gmail.com>
Date:   Sun Jun 7 17:35:49 2026 +0800

    libceph: bound get_version reply decode to front len
    
    commit d3c32939fa0e3ee9b883b9a0fd1972c5c444e3d0 upstream.
    
    handle_get_version_reply() uses msg->front_alloc_len as the decode
    boundary for MON_GET_VERSION_REPLY.  That is the size of the reused
    reply buffer, not the number of bytes actually received.
    
    A truncated reply can therefore pass ceph_decode_need() and decode the
    second u64 from stale tail bytes left in the buffer by an earlier
    message, causing an uninitialized memory read.
    
    Use msg->front.iov_len as the receive-side decode boundary, matching
    other libceph reply handlers and limiting decoding to the bytes that
    were actually read from the wire.
    
    Cc: stable@vger.kernel.org
    Fixes: 513a8243d67f ("libceph: mon_get_version request infrastructure")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Assisted-by: Codex:GPT-5.4
    Signed-off-by: Douya Le <ldy3087146292@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

libceph: Fix multiplication overflow in decode_new_up_state_weight() [+ + +]
Author: Raphael Zimmer <raphael.zimmer@tu-ilmenau.de>
Date:   Wed May 27 16:06:17 2026 +0200

    libceph: Fix multiplication overflow in decode_new_up_state_weight()
    
    commit 98917a499ec7064c14fc56d180a4fd636fc2784c upstream.
    
    If a message of type CEPH_MSG_OSD_MAP contains a (maliciously) corrupted
    osdmap, out-of-bounds memory accesses may occur in
    decode_new_up_state_weight(). This happens because the bounds check for
    the new_state part is based on calculating its length depending on a len
    value read from the incoming message. This calculation may overflow
    leading to an incorrect bounds check. Subsequently, out-of-bounds reads
    may occur when decoding this part.
    
    This patch switches the multiplication to use check_mul_overflow() to
    abort processing the osdmap if an overflow occurred. Therefore,
    osdmaps/messages containing large values for len that result in a
    multiplication overflow are treated as invalid.
    
    [ idryomov: rename new_state_len -> new_state_item_size, formatting ]
    
    Cc: stable@vger.kernel.org
    Fixes: 930c53286977 ("libceph: apply new_state before new_up_client on incrementals")
    Signed-off-by: Raphael Zimmer <raphael.zimmer@tu-ilmenau.de>
    Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

libceph: guard missing CRUSH type name lookup [+ + +]
Author: Zhao Zhang <zzhan461@ucr.edu>
Date:   Fri Jun 19 15:40:03 2026 +0800

    libceph: guard missing CRUSH type name lookup
    
    commit bbeae12fda3384a90fbebc8a19ba9d33f85b5361 upstream.
    
    Localized read selection can walk a parent bucket whose name exists in
    the CRUSH map while its type has no matching entry in type_names.
    get_immediate_parent() then dereferences a NULL type_cn and passes an
    invalid pointer into strcmp(), causing a null-ptr-deref.
    
    Skip such malformed parent buckets unless both the bucket name and type
    name metadata are present. This keeps malformed hierarchy data from
    crashing locality lookup and safely falls back to "not local".
    
    [ idryomov: add WARN_ON_ONCE ]
    
    Cc: stable@vger.kernel.org
    Fixes: 117d96a04f00 ("libceph: support for balanced and localized reads")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Assisted-by: Codex:GPT-5.4
    Signed-off-by: Zhao Zhang <zzhan461@ucr.edu>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

libceph: refresh auth->authorizer_buf{,_len} after authorizer update [+ + +]
Author: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
Date:   Mon Jun 29 13:14:22 2026 -0400

    libceph: refresh auth->authorizer_buf{,_len} after authorizer update
    
    commit 937d61f86d377a3aa578adae7a3dfcecdddf9d89 upstream.
    
    ceph_x_create_authorizer() caches au->buf->vec.iov_base and
    au->buf->vec.iov_len in struct ceph_auth_handshake.  These
    cached values are then used by the messenger connect code when
    sending the authorizer.
    
    ceph_x_update_authorizer() can rebuild the authorizer when a newer
    service ticket is available.  If the rebuilt authorizer no longer
    fits in the existing buffer, ceph_x_build_authorizer() drops its
    reference to au->buf and allocates a new one.  If this is the final
    reference, ceph_buffer_put() frees the old ceph_buffer and its
    vec.iov_base, but auth->authorizer_buf still points at that freed
    memory.
    
    A subsequent msgr1 reconnect can therefore queue the stale pointer
    and trigger a KASAN slab-use-after-free in _copy_from_iter() while
    tcp_sendmsg() copies the authorizer.
    
    Refresh auth->authorizer_buf and auth->authorizer_buf_len after a
    successful authorizer rebuild so the messenger sends the current
    buffer.
    
    Cc: stable@vger.kernel.org
    Fixes: 0bed9b5c523d ("libceph: add update_authorizer auth method")
    Closes: https://lore.kernel.org/all/E378850E-106C-427B-A241-970EB2D054D7@gmail.com/
    Signed-off-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
    Reviewed-by: Alex Markuze <amarkuze@redhat.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

libceph: Reject monmaps advertising zero monitors [+ + +]
Author: Raphael Zimmer <raphael.zimmer@tu-ilmenau.de>
Date:   Fri May 29 09:42:57 2026 +0200

    libceph: Reject monmaps advertising zero monitors
    
    commit 40480eee361ed9676b3f844d532ac28b47251634 upstream.
    
    A message of type CEPH_MSG_MON_MAP contains a monmap that is sent from a
    monitor to the client. This monmap contains information about the
    existing monitors in the cluster. Currently, a monmap indicating that
    there are zero monitors in the cluster is treated as valid. However, it
    is impossible to have zero monitors in the cluster and still receive a
    valid monmap from a monitor. Therefore, such a monmap must be corrupted
    and should be treated as invalid. Furthermore, a monmap with a monitor
    count of zero can subsequently crash the client when attempting to open
    a session with a monitor in __open_session(). This happens because the
    "BUG_ON(monc->monmap->num_mon < 1)" assertion in pick_new_mon() is
    triggered.
    
    This patch extends a check in ceph_monmap_decode() to also reject
    arriving mon_maps with num_mon == 0 rather than only with
    num_mon > CEPH_MAX_MON.
    
    [ idryomov: drop "log output for unusual values of num_mon" part ]
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Raphael Zimmer <raphael.zimmer@tu-ilmenau.de>
    Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

libceph: reject zero bucket types in crush_decode [+ + +]
Author: Douya Le <ldy3087146292@gmail.com>
Date:   Fri May 29 16:11:44 2026 +0800

    libceph: reject zero bucket types in crush_decode
    
    commit 05f90284223381005d6bcddab3fda4a97f9c3401 upstream.
    
    CRUSH bucket type 0 is reserved for devices.  The mapper relies on
    that invariant and uses type 0 to identify leaf devices.
    
    If crush_decode() accepts a bucket with type 0, a malformed CRUSH map
    can make the mapper treat a negative bucket ID as a device and pass it
    to is_out(), which then indexes the OSD weight array with a negative
    value.
    
    Reject zero bucket types while decoding the CRUSH map so the invalid
    state never reaches the mapper.
    
    Cc: stable@vger.kernel.org
    Fixes: f24e9980eb86 ("ceph: OSD client")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Assisted-by: Codex:GPT-5.4
    Signed-off-by: Douya Le <ldy3087146292@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

libceph: remove debugfs files before client teardown [+ + +]
Author: Douya Le <ldy3087146292@gmail.com>
Date:   Mon Jun 15 14:31:06 2026 +0800

    libceph: remove debugfs files before client teardown
    
    commit e4c804726c4afce3ba648b982d564f6af2cfa328 upstream.
    
    ceph_destroy_client() tears down the monitor client before removing
    the per-client debugfs files. A concurrent read of the monmap debugfs
    file can enter monmap_show() after ceph_monc_stop() has freed
    monc->monmap, triggering a use-after-free.
    
    Remove the debugfs files before stopping the OSD and monitor clients.
    debugfs_remove() drains active handlers and prevents new accesses, so
    the debugfs callbacks can no longer race the rest of client teardown.
    
    Cc: stable@vger.kernel.org
    Fixes: 76aa844d5b2f ("ceph: debugfs")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Assisted-by: Codex:GPT-5.4
    Signed-off-by: Douya Le <ldy3087146292@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Linux: Linux 5.15.216 [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Aug 19 17:14:18 2026 +0200

    Linux 5.15.216
    
    Link: https://lore.kernel.org/r/20260817132539.792407575@linuxfoundation.org
    Tested-by: Pavel Machek (CIP) <pavel@nabladev.com>
    Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Tested-by: Barry K. Nathan <barryn@pobox.com>
    Tested-by: Ron Economos <re@w6rz.net>
    Tested-by: Brett A C Sheffield <bacs@librecast.net>
    Tested-by: Mark Brown <broonie@kernel.org>
    Tested-by: Shuah Khan <skhan@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mac802154: llsec: reject frames shorter than the authentication tag [+ + +]
Author: Doruk Tan Ozturk <doruk@0sec.ai>
Date:   Thu Jul 16 21:34:23 2026 +0200

    mac802154: llsec: reject frames shorter than the authentication tag
    
    commit fd3a3f28ed60c6af4b2a39933b151d6b27842c3b upstream.
    
    llsec_do_decrypt_auth() computes the associated-data length for the
    AEAD request as
    
            assoclen += datalen - authlen;
    
    where datalen is the number of bytes after the MAC header and authlen
    (4, 8 or 16) is the length of the authentication tag. Nothing verifies
    that the frame actually carries at least authlen payload bytes. A
    secured frame whose payload is shorter than the tag makes
    datalen - authlen negative; assoclen is then passed to
    aead_request_set_ad() as an unsigned value close to 4 GiB, so
    crypto_aead_decrypt() walks far off the end of the scatterlist that
    only spans the real frame.
    
    The frame is fully attacker-controlled and reaches this path from any
    IEEE 802.15.4 peer in radio range. Reject frames whose payload is
    shorter than the authentication tag before the subtraction.
    
    Dynamically reproduced on a KASAN kernel as a general-protection-fault
    in the AEAD scatterwalk, and the fix confirmed.
    
    Fixes: 4c14a2fb5d14 ("mac802154: add llsec decryption method")
    Cc: stable@vger.kernel.org
    Reviewed-by: Simon Horman <horms@kernel.org>
    Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
    Link: https://patch.msgid.link/20260716193423.32498-1-doruk@0sec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
macsec: don't read an unset MAC header in macsec_encrypt() [+ + +]
Author: Daehyeon Ko <4ncienth@gmail.com>
Date:   Wed Jul 22 08:40:44 2026 +0900

    macsec: don't read an unset MAC header in macsec_encrypt()
    
    commit f5089008f90c0a7c5520dff3934e0af00adf322d upstream.
    
    macsec_encrypt() reads the Ethernet header via eth_hdr(skb)
    (skb->head + skb->mac_header) to memmove() the 12 source/destination MAC
    bytes forward and make room for the SecTAG.
    
    On the AF_PACKET SOCK_RAW + PACKET_QDISC_BYPASS transmit path the skb
    reaches the macsec ndo_start_xmit() with the MAC header unset, so
    eth_hdr(skb) resolves to skb->head + (u16)~0 and the read is out of
    bounds: a 12-byte heap over-read that is also emitted on the wire as the
    frame's outer source/destination MAC. KASAN reports a slab-out-of-bounds
    read in macsec_start_xmit() on 6.0; on current mainline a CONFIG_DEBUG_NET
    build flags it as an unset mac header in skb_mac_header().
    
    On the TX path the L2 header is at skb->data, so use skb_eth_hdr(), added
    by commit 96cc4b69581d ("macvlan: do not assume mac_header is set in
    macvlan_broadcast()") for exactly this purpose.
    
    Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
    Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
    Link: https://patch.msgid.link/20260703083634.2035145-1-4ncienth@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
media: airspy: Return queued buffers on start_streaming() failure [+ + +]
Author: Valery Borovsky <vebohr@gmail.com>
Date:   Mon May 11 20:12:06 2026 +0300

    media: airspy: Return queued buffers on start_streaming() failure
    
    commit 04344d0b4929caa94c0df72f767752aa0935ef5d upstream.
    
    The vb2 framework hands buffers to the driver via buf_queue() before
    calling start_streaming().  If start_streaming() returns an error
    without first returning those buffers via vb2_buffer_done(),
    vb2_start_streaming() fires WARN_ON(owned_by_drv_count) and the queued
    buffers leak.
    
    airspy_start_streaming() returned -ENODEV early when the USB device had
    been disconnected (s->udev == NULL) without returning any buffers that
    buf_queue() had already accepted.  Take v4l2_lock first and jump to the
    existing err_clear_bit label, which already drains s->queued_bufs via
    vb2_buffer_done(..., VB2_BUF_STATE_QUEUED) before unlocking.
    
    This mirrors the uvcvideo fix in commit 4cf3b6fd54eb ("media: uvcvideo:
    Return queued buffers on start_streaming() failure").
    
    Fixes: 634fe5033951 ("[media] airspy: AirSpy SDR driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Valery Borovsky <vebohr@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: cec: seco: unregister adapter on IR probe failure [+ + +]
Author: Myeonghun Pak <mhun512@gmail.com>
Date:   Fri Apr 24 23:36:01 2026 +0900

    media: cec: seco: unregister adapter on IR probe failure
    
    commit c3a78691be8245e52ced489f268e413f18061ac2 upstream.
    
    If secocec_ir_probe() fails after cec_register_adapter() succeeds,
    probe returns an error and the driver remove callback is not called.
    The current unwind path unregisters the notifier and then falls through
    to cec_delete_adapter(), which violates the CEC adapter lifetime rules
    after a successful registration.
    
    Add a registered-adapter unwind path that unregisters the notifier and
    the adapter instead.
    
    Fixes: daef95769b3a ("media: seco-cec: add Consumer-IR support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: cedrus: clean up media device on probe failure [+ + +]
Author: Myeonghun Pak <mhun512@gmail.com>
Date:   Wed May 6 21:41:16 2026 +0900

    media: cedrus: clean up media device on probe failure
    
    commit 2c869b6969f3061cbbdab587f4c0a88bd7fc3cc9 upstream.
    
    cedrus_probe() initializes the media device before registering the video
    device, the media controller, and the media device. If any of those later
    steps fails, probe returns without calling media_device_cleanup(), so the
    media device internals initialized by media_device_init() are left behind.
    
    Add a media-device cleanup label to the probe unwind path and route video
    registration failures through it as well.
    
    Fixes: 50e761516f2b8c ("media: platform: Add Cedrus VPU decoder driver")
    Cc: stable@vger.kernel.org
    Reviewed-by: Paul Kocialkowski <paulk@sys-base.io>
    Co-developed-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
    Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: cedrus: Fix missing cleanup in error path [+ + +]
Author: Samuel Holland <samuel@sholland.org>
Date:   Tue Apr 7 01:14:02 2026 +0300

    media: cedrus: Fix missing cleanup in error path
    
    commit d99732334aaf33b9f93926b70b6a11c2cef3de39 upstream.
    
    According to the documentation struct v4l2_fh has to be cleaned up with
    v4l2_fh_exit() before being freed. [1]
    Currently there is no actual bug here, when v4l2_fh_exit() isn't called.
    v4l2_fh_exit() in this case only destroys internal mutex. But it may
    change in the future, when v4l2_fh_init/v4l2_fh_exit will be enhanced.
    
    1. https://docs.kernel.org/driver-api/media/v4l2-fh.html
    
    Signed-off-by: Samuel Holland <samuel@sholland.org>
    Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
    Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver")
    Cc: stable@vger.kernel.org
    Acked-by: Paul Kocialkowski <paulk@sys-base.io>
    Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: cedrus: skip invalid H.264 reference list entries [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Tue Mar 24 16:08:56 2026 +0800

    media: cedrus: skip invalid H.264 reference list entries
    
    commit 10358ea986c3c85516d1c8206486464f79d36e76 upstream.
    
    Cedrus consumes H.264 ref_pic_list0/ref_pic_list1 entries from the
    stateless slice control and later uses their indices to look up
    decode->dpb[] in _cedrus_write_ref_list().
    
    Rejecting such controls in cedrus_try_ctrl() would break existing
    userspace, since stateless H.264 reference lists may legitimately carry
    out-of-range indices for missing references. Instead, guard the actual
    DPB lookup in Cedrus and skip entries whose indices do not fit the fixed
    V4L2_H264_NUM_DPB_ENTRIES array.
    
    This keeps the fix local to the driver use site and avoids out-of-bounds
    reads from malformed or unsupported reference list entries.
    
    Fixes: e000e1fa4bdbd ("media: uapi: h264: Update reference lists")
    Cc: stable@vger.kernel.org
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
    Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
    Tested-by: Chen-Yu Tsai <wens@kernel.org>
    Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: cx231xx: fix devres lifetime [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Mon Mar 30 11:37:27 2026 +0200

    media: cx231xx: fix devres lifetime
    
    commit 7d6358ab02866e5b7ed8d3a00805297617bbb0ec upstream.
    
    USB drivers bind to USB interfaces and any device managed resources
    should have their lifetime tied to the interface rather than parent USB
    device. This avoids issues like memory leaks when drivers are unbound
    without their devices being physically disconnected (e.g. on probe
    deferral or configuration changes).
    
    Fix the driver state lifetime so that it is released on driver unbind.
    
    Fixes: 184a82784d50 ("[media] cx231xx: use devm_ functions to allocate memory")
    Cc: stable@vger.kernel.org      # 3.17
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: cx23885: add ioremap return check and cleanup [+ + +]
Author: Wang Jun <1742789905@qq.com>
Date:   Fri Mar 20 15:04:53 2026 +0800

    media: cx23885: add ioremap return check and cleanup
    
    commit a0701e387b46e2481c05b47f1235b954bfc2af3e upstream.
    
    Add a check for the return value of pci_ioremap_bar()
    in cx23885_dev_setup().
    If ioremap for BAR0 fails, release the already allocated
    PCI memory region,
    decrement the device count, and return -ENODEV.
    
    This prevents a potential null pointer dereference and
    ensures proper cleanup
    on memory mapping failure.
    
    Fixes: d19770e5178a ("V4L/DVB (6150): Add CX23885/CX23887 PCIe bridge driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Wang Jun <1742789905@qq.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: meson: vdec: Fix memory leak in error path of vdec_open [+ + +]
Author: Anand Moon <linux.amoon@gmail.com>
Date:   Wed May 20 10:10:41 2026 +0530

    media: meson: vdec: Fix memory leak in error path of vdec_open
    
    commit 940f161f734b25f175a95d2684c2021f6323693a upstream.
    
    The vdec_open() function previously jumped directly to
    err_m2m_release when vdec_init_ctrls() failed, skipping
    release of the m2m context. This caused a resource leak.
    
    Fix it by introducing a proper err_m2m_ctx_release label
    that calls v4l2_m2m_ctx_release(sess->m2m_ctx) before
    releasing the m2m device.
    
    This was identified via kmemleak:
    unreferenced object 0xffff0000205d6878 (size 8):
      comm "v4l_id", pid 5289, jiffies 4294938580
      hex dump (first 8 bytes):
        40 d2 49 18 00 00 ff ff                          @.I.....
      backtrace (crc d3204599):
        kmemleak_alloc+0xc8/0xf0
        __kvmalloc_node_noprof+0x60c/0x850
        v4l2_ctrl_handler_init_class+0x1b4/0x2e8 [videodev]
        vdec_open+0x1f4/0x788 [meson_vdec]
        v4l2_open+0x144/0x460 [videodev]
        chrdev_open+0x1ac/0x500
        do_dentry_open+0x3f0/0xfe8
        vfs_open+0x68/0x320
        do_open+0x2d8/0x9a8
        path_openat+0x1d0/0x4f0
        do_filp_open+0x190/0x380
        do_sys_openat2+0xf8/0x1b0
        __arm64_sys_openat+0x13c/0x1e8
        invoke_syscall+0xdc/0x268
        el0_svc_common.constprop.0+0x178/0x258
        do_el0_svc+0x4c/0x70
    
    Fixes: 3e7f51bd9607 ("media: meson: add v4l2 m2m video decoder driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Anand Moon <linux.amoon@gmail.com>
    Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: msi2500: Return queued buffers on start_streaming() failure [+ + +]
Author: Valery Borovsky <vebohr@gmail.com>
Date:   Mon May 11 20:12:07 2026 +0300

    media: msi2500: Return queued buffers on start_streaming() failure
    
    commit 7201c17786a498497bca57752883b90914d405ac upstream.
    
    The vb2 framework hands buffers to the driver via buf_queue() before
    calling start_streaming().  If start_streaming() returns an error
    without first returning those buffers via vb2_buffer_done(),
    vb2_start_streaming() fires WARN_ON(owned_by_drv_count) and the queued
    buffers leak.
    
    msi2500_start_streaming() had five error paths that all hit this trap
    and were further tangled by ret-overwriting between calls:
    
      - -ENODEV when the USB device was already disconnected
      - -ERESTARTSYS when mutex_lock_interruptible() was interrupted
      - msi2500_set_usb_adc() failure: ret was silently overwritten by
        the next call (msi2500_isoc_init), so the error was lost entirely
      - msi2500_isoc_init() failure: cleanup_queued_bufs was called, but
        the function then fell through to msi2500_ctrl_msg() and again
        masked the original error by overwriting ret
      - msi2500_ctrl_msg(CMD_START_STREAMING) failure: no cleanup at all,
        leaving isoc URBs submitted with no way for the driver to consume
        them
    
    Consolidate the error paths into a small goto chain.  Every failure
    now stops the function, drains the queued-buffer list, and returns
    the real error code.  The ctrl_msg failure path also rolls back the
    preceding msi2500_isoc_init() via msi2500_isoc_cleanup() before
    unlocking and draining.
    
    The cleanup helper takes a vb2_buffer_state argument so that the
    start_streaming error paths can pass VB2_BUF_STATE_QUEUED (as
    expected by userspace on start_streaming failure) while stop_streaming
    keeps its existing VB2_BUF_STATE_ERROR semantics.
    
    This mirrors the uvcvideo fix in commit 4cf3b6fd54eb ("media: uvcvideo:
    Return queued buffers on start_streaming() failure").
    
    Fixes: 977e444f59ad ("[media] Mirics MSi3101 SDR Dongle driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Valery Borovsky <vebohr@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: pci: dm1105: Free allocated workqueue [+ + +]
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Date:   Tue Apr 28 16:50:08 2026 +0200

    media: pci: dm1105: Free allocated workqueue
    
    commit 1a65db225b25bb8c8febf16974c060e0cc242eb9 upstream.
    
    Destroy allocated workqueue in remove() callback to free its resources,
    thus fixing memory leak.
    
    Fixes: 519a4bdcf822 ("V4L/DVB (11984): Add support for yet another SDMC DM1105 based DVB-S card.")
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: pwc: Drain fill_buf on start_streaming() failure [+ + +]
Author: Valery Borovsky <vebohr@gmail.com>
Date:   Wed May 13 08:42:44 2026 +0300

    media: pwc: Drain fill_buf on start_streaming() failure
    
    commit 906e410dcffbbd99fb4081abab817a830033aa28 upstream.
    
    pwc_isoc_init() submits its isochronous URBs with
    usb_submit_urb(.., GFP_KERNEL) in a loop. After the first URB is
    submitted, its completion handler pwc_isoc_handler() can run on another
    CPU before the loop finishes:
    
      start_streaming()
        pwc_isoc_init()
          usb_submit_urb(urbs[0], GFP_KERNEL)
                                      pwc_isoc_handler(urbs[0])
                                        pdev->fill_buf =
                                          pwc_get_next_fill_buf(pdev)
          usb_submit_urb(urbs[i>0], ..)  -> fails
          pwc_isoc_cleanup(pdev)           /* kills URBs */
          return ret;
        pwc_cleanup_queued_bufs(pdev, VB2_BUF_STATE_QUEUED)
    
    pwc_get_next_fill_buf() detaches a buffer from pdev->queued_bufs and
    stores it in pdev->fill_buf. The error path in start_streaming() only
    drains pdev->queued_bufs, so the buffer parked in pdev->fill_buf is
    leaked. vb2_start_streaming() then triggers
    WARN_ON(owned_by_drv_count).
    
    stop_streaming() already handles this since commit 80b0963e1698
    ("[media] pwc: fix WARN_ON"), which added the fill_buf drain in the
    teardown path but not in the start_streaming() error path. Mirror that
    handling on failure so start_streaming() returns with no buffer owned
    by the driver.
    
    Issue identified by automated review of the INV-003 series at
    https://sashiko.dev/
    
    Fixes: 885fe18f5542 ("[media] pwc: Replace private buffer management code with videobuf2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Valery Borovsky <vebohr@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: pwc: Return queued buffers on start_streaming() failure [+ + +]
Author: Valery Borovsky <vebohr@gmail.com>
Date:   Mon May 11 20:12:08 2026 +0300

    media: pwc: Return queued buffers on start_streaming() failure
    
    commit 975b2ee20e569d47821e4f6c9761b4664d48a6a4 upstream.
    
    The vb2 framework hands buffers to the driver via buf_queue() before
    calling start_streaming().  If start_streaming() returns an error
    without first returning those buffers via vb2_buffer_done(),
    vb2_start_streaming() fires WARN_ON(owned_by_drv_count) and the queued
    buffers leak.
    
    pwc's start_streaming() had two early returns that hit this trap:
    -ENODEV when the USB device was already disconnected, and -ERESTARTSYS
    when mutex_lock_interruptible() was interrupted by a signal.  Call the
    existing pwc_cleanup_queued_bufs() helper with VB2_BUF_STATE_QUEUED
    before returning (matching the state already used by the
    pwc_isoc_init() error path in the same function).
    
    This mirrors the uvcvideo fix in commit 4cf3b6fd54eb ("media: uvcvideo:
    Return queued buffers on start_streaming() failure").
    
    Fixes: ceede9fa8939 ("[media] pwc: Fix locking")
    Cc: stable@vger.kernel.org
    Signed-off-by: Valery Borovsky <vebohr@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: radio-si476x: Unregister v4l2_device on probe failure [+ + +]
Author: Myeonghun Pak <mhun512@gmail.com>
Date:   Wed May 13 16:02:37 2026 +0900

    media: radio-si476x: Unregister v4l2_device on probe failure
    
    commit 436a693af04ffb889aaf87cb69ec1f2b21d3569c upstream.
    
    si476x_radio_probe() registers radio->v4l2dev before allocating the V4L2
    controls and before registering the video device. If any of those later
    steps fails, probe returns through the exit label after freeing only the
    control handler.
    
    A failed probe does not call si476x_radio_remove(), so the
    v4l2_device_unregister() there is not reached. This leaves the parent
    device reference taken by v4l2_device_register() behind on the error path.
    
    Unregister the V4L2 device in the probe error path after freeing the
    controls.
    
    Fixes: b879a9c2a755 ("[media] v4l2: Add a V4L2 driver for SI476X MFD")
    Cc: stable@vger.kernel.org
    Co-developed-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: rtl2832: fix use-after-free in rtl2832_remove() [+ + +]
Author: Deepanshu Kartikey <kartikey406@gmail.com>
Date:   Wed Apr 22 20:17:34 2026 +0530

    media: rtl2832: fix use-after-free in rtl2832_remove()
    
    commit 680daf40a82d483949f87f0d8f98639dc47e610c upstream.
    
    cancel_delayed_work_sync() is called before i2c_mux_del_adapters()
    in rtl2832_remove(). While the cancel waits for any running instance
    of i2c_gate_work to finish, it does not prevent the timer from being
    rescheduled by a concurrent thread.
    
    During probe, the r820t_attach() call attempts I2C transfers through
    the mux adapter. These transfers go through i2c_mux_master_xfer(),
    which calls rtl2832_deselect() after the transfer completes,
    rescheduling i2c_gate_work via schedule_delayed_work(). If this
    transfer is still in flight when rtl2832_remove() runs,
    rtl2832_deselect() can reschedule i2c_gate_work after it has been
    cancelled, causing a use-after-free when kfree(dev) is called.
    
    Fix this by calling i2c_mux_del_adapters() before
    cancel_delayed_work_sync(). Once the mux adapter is unregistered, no
    new I2C transfers can go through it, so rtl2832_deselect() can no
    longer reschedule i2c_gate_work. The subsequent
    cancel_delayed_work_sync() is then guaranteed to be final.
    
    Fixes: cddcc40b1b15 ("[media] rtl2832: convert to use an explicit i2c mux core")
    Cc: stable@vger.kernel.org
    Reported-by: syzbot+019ced393ab913002b75@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=019ced393ab913002b75
    Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: rtl2832_sdr: Return queued buffers on start_streaming() failure [+ + +]
Author: Valery Borovsky <vebohr@gmail.com>
Date:   Mon May 11 20:12:09 2026 +0300

    media: rtl2832_sdr: Return queued buffers on start_streaming() failure
    
    commit 33ca0aab6f4bd90921fc1395478f38f72c4d19af upstream.
    
    The vb2 framework hands buffers to the driver via buf_queue() before
    calling start_streaming().  If start_streaming() returns an error
    without first returning those buffers via vb2_buffer_done(),
    vb2_start_streaming() fires WARN_ON(owned_by_drv_count) and the queued
    buffers leak.
    
    rtl2832_sdr_start_streaming() had multiple error paths that hit this
    trap: two direct early returns (-ENODEV, -ERESTARTSYS), plus six
    `goto err` paths covering subdev s_power, tuner setup, ADC setup,
    stream-buffer allocation, urb allocation, and urb submission failures.
    None of them returned the queued buffers.
    
    The original function had no distinct success exit and fell straight
    through into the err label, which previously only did mutex_unlock and
    "return ret".  Adding queued-buffer cleanup at err must therefore be
    paired with an explicit success return; otherwise every successful
    start would also drain the buffer queue and kill streaming.  Add that
    success return, then add rtl2832_sdr_cleanup_queued_bufs() at the err
    label and before each early return.
    
    The cleanup helper takes a vb2_buffer_state argument so that the
    start_streaming error paths can pass VB2_BUF_STATE_QUEUED (as
    expected by userspace on start_streaming failure) while stop_streaming
    keeps its existing VB2_BUF_STATE_ERROR semantics.
    
    This mirrors the uvcvideo fix in commit 4cf3b6fd54eb ("media: uvcvideo:
    Return queued buffers on start_streaming() failure").
    
    The err label still does not roll back power_ctrl(), frontend_ctrl(),
    the POWER_ON flag, or stream/URB allocations that may have happened
    before the failing step.  Those are pre-existing leaks of a different
    class and are not addressed here.
    
    Fixes: 771138920eaf ("[media] rtl2832_sdr: Realtek RTL2832 SDR driver module")
    Cc: stable@vger.kernel.org
    Signed-off-by: Valery Borovsky <vebohr@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: saa7134: Fix a possible memory leak in saa7134_video_init1 [+ + +]
Author: Ma Ke <make24@iscas.ac.cn>
Date:   Thu Apr 2 15:35:29 2026 +0800

    media: saa7134: Fix a possible memory leak in saa7134_video_init1
    
    commit f86ed548386e3050e5f8f25b450d09dc009d9a88 upstream.
    
    In saa7134_video_init1(), the return value of the first
    saa7134_pgtable_alloc() is not checked. If it fails, the function
    continues as if successful, leaving the driver with an invalid page
    table. Additionally, if vb2_queue_init() for the VBI queue fails after
    the video queue page table has been allocated, the allocated memory is
    not freed before returning. The second saa7134_pgtable_alloc() also
    lacks a return value check. Errors occur during device probing before
    the device is fully registered, the normal cleanup path in
    saa7134_finidev() is not executed, leading to memory leaks and
    potential use of uninitialized DMA resources.
    
    Check the return value of both saa7134_pgtable_alloc() calls and
    propagate errors. On failure of any later step, free allocated page
    tables to avoid memory leaks. Ensure control handlers are also
    released on error to prevent further resource leakage.
    
    Found by code review.
    
    Signed-off-by: Ma Ke <make24@iscas.ac.cn>
    Cc: stable@vger.kernel.org
    Fixes: a00e68888d5d ("[media] saa7134: move saa7134_pgtable to saa7134_dmaqueue")
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: sun4i-csi: Return queued buffers on start_streaming() failure [+ + +]
Author: Valery Borovsky <vebohr@gmail.com>
Date:   Mon May 11 20:12:11 2026 +0300

    media: sun4i-csi: Return queued buffers on start_streaming() failure
    
    commit bbba3e260a62810a717b4442a3bb96d0ec0f6309 upstream.
    
    The vb2 framework hands buffers to the driver via buf_queue() before
    calling start_streaming().  If start_streaming() returns an error
    without first returning those buffers via vb2_buffer_done(),
    vb2_start_streaming() fires WARN_ON(owned_by_drv_count) and the queued
    buffers leak.
    
    sun4i_csi_start_streaming() returned -EINVAL when no matching CSI
    format could be found, before any setup (scratch buffer allocation,
    pipeline start) had been performed.  The remaining error paths already
    converge on the err_clear_dma_queue label, which calls
    return_all_buffers(..., VB2_BUF_STATE_QUEUED) under csi->qlock.  Jump
    to that label directly: the intermediate err_disable_device /
    err_disable_pipeline / err_free_scratch_buffer labels are skipped,
    which is correct because nothing they would undo has happened yet.
    
    This mirrors the uvcvideo fix in commit 4cf3b6fd54eb ("media: uvcvideo:
    Return queued buffers on start_streaming() failure").
    
    Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Valery Borovsky <vebohr@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: tegra-video: vi: fix invalid u32 return value in format lookup [+ + +]
Author: Hungyu Lin <dennylin0707@gmail.com>
Date:   Thu May 7 02:22:13 2026 +0000

    media: tegra-video: vi: fix invalid u32 return value in format lookup
    
    commit d5b50055338e131a1a99f923ebb0361974a00f36 upstream.
    
    tegra_get_format_fourcc_by_idx() returns a u32 but uses -EINVAL to
    signal an out-of-bounds index. This results in a large unsigned
    value being returned, which may be interpreted as a valid fourcc.
    
    Returning 0 is not a valid fourcc either. This condition should
    never happen, so use WARN_ON_ONCE() to catch unexpected out-of-bounds
    access and return a valid fallback format instead.
    
    Suggested-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Fixes: 3d8a97eabef0 ("media: tegra-video: Add Tegra210 Video input driver")
    Cc: stable@vger.kernel.org
    Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
    Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: uvcvideo: Fix sequence number when no EOF [+ + +]
Author: Ricardo Ribalda <ribalda@chromium.org>
Date:   Fri Jul 31 10:48:33 2026 +0000

    media: uvcvideo: Fix sequence number when no EOF
    
    commit f078966ca1fb1b3865d8e6bbe2705cfd277fc637 upstream.
    
    If the driver could not detect the EOF, the sequence number is increased
    twice:
     1) When we enter uvc_video_decode_start() with the old buffer and FID has
       flipped => We return -EAGAIN and last_fid is not flipped
     2) When we enter uvc_video_decode_start() with the new buffer.
    
    Fix this issue by moving the new frame detection logic earlier in
    uvc_video_decode_start().
    
    This also has some nice side affects:
    
    - The error status from the new packet will no longer get propagated
      to the previous frame-buffer.
    - uvc_video_clock_decode() will no longer update the previous frame
      buf->stf with info from the new packet.
    - uvc_video_clock_decode() and uvc_video_stats_decode() will no longer
      get called twice for the same packet.
    
    Cc: stable@kernel.org
    Fixes: 650b95feee35 ("[media] uvcvideo: Generate discontinuous sequence numbers when frames are lost")
    Reported-by: Hans de Goede <hansg@kernel.org>
    Closes: https://lore.kernel.org/linux-media/CANiDSCuj4cPuB5_v2xyvAagA5FjoN8V5scXiFFOeD3aKDMqkCg@mail.gmail.com/T/#me39fb134e8c2c085567a31548c3403eb639625e4
    Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
    Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

media: uvcvideo: Implement dual stream quirk to fix loss of usb packets [+ + +]
Author: Isaac Scott <isaac.scott@ideasonboard.com>
Date:   Fri Jul 31 10:48:32 2026 +0000

    media: uvcvideo: Implement dual stream quirk to fix loss of usb packets
    
    commit c2eda35e675b6ea4a0a21a4b1167b121571a9036 upstream.
    
    Some cameras, such as the Sonix Technology Co. 292A, exhibit issues when
    running two parallel streams, causing USB packets to be dropped when an
    H.264 stream posts a keyframe while an MJPEG stream is running
    simultaneously. This occasionally causes the driver to erroneously
    output two consecutive JPEG images as a single frame.
    
    To fix this, we inspect the buffer, and trigger a new frame when we
    find an SOI.
    
    Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
    Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
    Link: https://lore.kernel.org/r/20241128145144.61475-2-isaac.scott@ideasonboard.com
    Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    [Added JPEG_MARKER_SOI definition, jpeg header does not exist yet]
    Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

media: v4l2-ctrls-request: add NULL check in v4l2_ctrl_request_complete() [+ + +]
Author: Sergey Shtylyov <s.shtylyov@auroraos.dev>
Date:   Fri May 1 23:28:31 2026 +0300

    media: v4l2-ctrls-request: add NULL check in v4l2_ctrl_request_complete()
    
    commit caced3578bf9f104a4aaad8f46c4c719e705d9a6 upstream.
    
    If CONFIG_MEDIA_CONTROLLER is undefined, media_request_object_find() will
    always return NULL, so its 2nd call in v4l2_ctrl_request_complete() would
    fail as well as the 1st one and thus cause hdl to have a wrong value (at
    the top of memory) and list_for_each_entry() to iterate over the garbage
    data located there. Add NULL check for the 2nd call and place the error
    cleanup at the end of v4l2_ctrl_request_complete()...
    
    Found by Linux Verification Center (linuxtesting.org) with the Svace static
    analysis tool.
    
    Fixes: c3bf5129f339 ("media: v4l2-ctrls: always copy the controls on completion")
    Cc: stable@vger.kernel.org
    Signed-off-by: Sergey Shtylyov <s.shtylyov@auroraos.dev>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: vb2: use ssize_t for vb2_read/vb2_write [+ + +]
Author: Zile Xiong <xiongzile99@gmail.com>
Date:   Fri Mar 20 14:54:45 2026 +0800

    media: vb2: use ssize_t for vb2_read/vb2_write
    
    commit a562d6dc86bdfdd299e1b4734977a8d63e803583 upstream.
    
    vb2_read() and vb2_write() return size_t, but propagate
    negative errno values from __vb2_perform_fileio().
    
    This relies on implicit signed/unsigned conversions in callers
    (e.g. vb2_fop_read()) to recover error codes:
    
        __vb2_perform_fileio() -> -EINVAL
        vb2_read()             -> (size_t)-EINVAL
        vb2_fop_read()         -> -EINVAL
    
    This relies on implicit conversions that are not obvious.
    
    These helpers are exported (EXPORT_SYMBOL_GPL) and part of the
    vb2 API, so changing their return type may affect existing users.
    
    However, they conceptually follow read/write semantics, where
    ssize_t is typically used to return either a byte count or a
    negative error code.
    
    Switch vb2_read() and vb2_write() to ssize_t, and update
    __vb2_perform_fileio() accordingly.
    
    Signed-off-by: Zile Xiong <xiongzile99@gmail.com>
    Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Fixes: b25748fe6126 ("[media] v4l: videobuf2: add read() and write() emulator")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: vidtv: fix reference leak on failed device registration [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Wed Apr 15 23:28:26 2026 +0800

    media: vidtv: fix reference leak on failed device registration
    
    commit 9aa21e1549db8882ff77b691e7714153df21dff0 upstream.
    
    When platform_device_register() fails in vidtv_bridge_init(), the
    embedded struct device in vidtv_bridge_dev has already been initialized
    by device_initialize(), but the failure path returns the error without
    dropping the device reference for the current platform device:
    
      vidtv_bridge_init()
        -> platform_device_register(&vidtv_bridge_dev)
           -> device_initialize(&vidtv_bridge_dev.dev)
           -> setup_pdev_dma_masks(&vidtv_bridge_dev)
           -> platform_device_add(&vidtv_bridge_dev)
    
    This leads to a reference leak when platform_device_register() fails.
    Fix this by calling platform_device_put() before returning the error.
    
    The issue was identified by a static analysis tool I developed and
    confirmed by manual review.
    
    Fixes: f90cf6079bf67 ("media: vidtv: add a bridge driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: vimc: fix reference leak on failed device registration [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Wed Apr 15 23:45:37 2026 +0800

    media: vimc: fix reference leak on failed device registration
    
    commit 33e2b833c66b890a0d71c4fa82d4c97143f7f75f upstream.
    
    When platform_device_register() fails in vimc_init(), the embedded
    struct device in vimc_pdev has already been initialized by
    device_initialize(), but the failure path returns the error without
    dropping the device reference for the current platform device:
    
      vimc_init()
        -> platform_device_register(&vimc_pdev)
           -> device_initialize(&vimc_pdev.dev)
           -> setup_pdev_dma_masks(&vimc_pdev)
           -> platform_device_add(&vimc_pdev)
    
    This leads to a reference leak when platform_device_register() fails.
    Fix this by calling platform_device_put() before returning the error.
    
    The issue was identified by a static analysis tool I developed and
    confirmed by manual review.
    
    Fixes: 4babf057c143f ("media: vimc: allocate vimc_device dynamically")
    Cc: stable@vger.kernel.org
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: vivid: check for vb2_is_busy() when toggling caps [+ + +]
Author: Hans Verkuil <hverkuil+cisco@kernel.org>
Date:   Wed May 20 09:22:41 2026 +0200

    media: vivid: check for vb2_is_busy() when toggling caps
    
    commit c2d1a2130c93f6d758af58590b86b2254c7a1dec upstream.
    
    The vivid_update_format_cap/out() functions must only be called if the
    capture/output queue are not busy. But for the controls that select
    the CROP/COMPOSE/SCALE capability that is not checked.
    
    Only when streaming starts will they be set to 'grabbed' and it is
    impossible to change the control, but between REQBUFS and STREAMON you
    are still allowed to set these controls. Since vivid_update_format_cap/out
    will change the format, this can cause unexpected results.
    
    Besides adding these checks, also add a WARN_ON in
    vivid_update_format_cap/out() if the queue is busy.
    
    I'm 90% certain that this is the cause of this syzbot bug:
    
    https://syzkaller.appspot.com/bug?extid=dac8f5eaa46837e97b89
    
    But since we never have reproducers, it is hard to be certain. In any case,
    these checks are needed regardless.
    
    Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
    Fixes: 73c3f48230cd ("[media] vivid: add the control handling code")
    Cc: stable@vger.kernel.org
    Reported-by: syzbot+dac8f5eaa46837e97b89@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=dac8f5eaa46837e97b89
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
misc: fastrpc: fix channel ctx ref leak when session alloc fails [+ + +]
Author: Anandu Krishnan E <anandu.e@oss.qualcomm.com>
Date:   Fri Jul 24 23:33:40 2026 +0100

    misc: fastrpc: fix channel ctx ref leak when session alloc fails
    
    commit 310f7868399668c6d99d88acc9c4cf3462e69d5b upstream.
    
    fastrpc_channel_ctx_get() is called in fastrpc_device_open() before
    fastrpc_session_alloc(). If session alloc fails, the error path
    returns -EBUSY without calling fastrpc_channel_ctx_put(), leaking
    the reference. Fix by adding the missing put.
    
    Fixes: 278d56f970ae ("misc: fastrpc: Reference count channel context")
    Cc: stable@kernel.org
    Signed-off-by: Anandu Krishnan E <anandu.e@oss.qualcomm.com>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
    Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
    Link: https://patch.msgid.link/20260724223342.629168-5-srini@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

misc: fastrpc: fix memory leak in fastrpc_channel_ctx_free [+ + +]
Author: Eddie Lin <eddie.lin@oss.qualcomm.com>
Date:   Fri Jul 24 23:33:41 2026 +0100

    misc: fastrpc: fix memory leak in fastrpc_channel_ctx_free
    
    commit 2fae94ee14f7fea11d3f95e10383a87c01d21518 upstream.
    
    The 'ctx_idr' is initialized but never destroyed when
    the channel context is freed, leading to a memory leak.
    Add idr_destroy() to properly clean up the IDR resources.
    
    Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
    Cc: stable@vger.kernel.org
    Signed-off-by: Eddie Lin <eddie.lin@oss.qualcomm.com>
    Reviewed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
    Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
    Link: https://patch.msgid.link/20260724223342.629168-6-srini@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/huge_memory: unlock i_mmap_rwsem before releasing after-split folios [+ + +]
Author: Kiryl Shutsemau (Meta) <kas@kernel.org>
Date:   Wed Aug 5 14:45:12 2026 +0100

    mm/huge_memory: unlock i_mmap_rwsem before releasing after-split folios
    
    [ Upstream commit e923bd21058ea02fd0dcd3549d151d143fd036e5 ]
    
    __folio_split() keeps dereferencing the mapping after the split:
    shmem_uncharge(mapping->host) and remap_page() while the folios are still
    frozen/locked, and i_mmap_unlock_read(mapping) at the very end, after the
    after-split folios have been unlocked and freed.
    
    Nothing holds an inode reference across that.  The split relies on @folio
    -- which the beyond-EOF drop loop never removes, as it starts at
    folio_next(folio) -- staying locked and in the page cache to hold off
    eviction.  But the unlock loop unlocks @folio before i_mmap_unlock_read()
    runs.  If the caller's @lock_at is a tail beyond EOF, as memory_failure()
    passes when splitting a poisoned tail of a shmem THP that reaches past
    i_size during truncation, it too is gone from the page cache; so once
    @folio is unlocked no locked, in-cache folio pins the inode, and a
    concurrent final iput() can evict and RCU-free it before
    i_mmap_unlock_read() touches i_mmap_rwsem:
    
      BUG: KASAN: slab-use-after-free in __up_read+0x634/0x790
       i_mmap_unlock_read include/linux/fs.h:537 [inline]
       __folio_split+0x732/0x1640 mm/huge_memory.c:4100
       try_to_split_thp_page+0xab/0x390 mm/memory-failure.c:1675
       memory_failure+0x1394/0x26e0 mm/memory-failure.c:2470
    
      Freed by task 4601:
       shmem_free_in_core_inode+0x54/0xb0 mm/shmem.c:5177
       evict+0x57f/0xac0 fs/inode.c:870
    
    Do every mapping dereference while @folio still pins the inode: drop
    i_mmap_rwsem right after remap_page(), before the loop that unlocks and
    frees the after-split folios, and clear @mapping so the exit path does not
    unlock it again.  shmem_uncharge() and remap_page() already run before
    that point, so after this nothing past the unlock loop touches the inode
    or the mapping.
    
    This is now a rule the split depends on, alongside keeping @folio frozen
    until the page cache is updated: no inode or mapping dereference once the
    after-split folios start being unlocked.
    
    Link: https://lore.kernel.org/20260716095424.471052-1-kirill@shutemov.name
    Fixes: baa355fd3314 ("thp: file pages support for split_huge_page()")
    Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
    Reported-by: Hao Zhang <zhanghao1@kylinos.cn>
    Closes: https://lore.kernel.org/linux-mm/20260710071344.GA106129@zh-pc
    Co-developed-by: Hao Zhang <zhanghao1@kylinos.cn>
    Signed-off-by: Hao Zhang <zhanghao1@kylinos.cn>
    Acked-by: David Hildenbrand (Arm) <david@kernel.org>
    Reviewed-by: Zi Yan <ziy@nvidia.com>
    Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
    Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
    Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Barry Song <baohua@kernel.org>
    Cc: Dev Jain <dev.jain@arm.com>
    Cc: Lance Yang <lance.yang@linux.dev>
    Cc: Liam R. Howlett <liam@infradead.org>
    Cc: Lorenzo Stoakes <ljs@kernel.org>
    Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
    Cc: Nico Pache <npache@redhat.com>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    
    (cherry picked from commit e923bd21058ea02fd0dcd3549d151d143fd036e5)
    [ kas: adapt to the __split_huge_page()/split_huge_page_to_list()
      two-function split: pass @mapping into __split_huge_page() and drop it
      there, before the loop that frees the after-split subpages while the
      head is still locked; the caller then skips its own i_mmap unlock ]
    Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
mm/hugetlb: fix list corruption in allocate_file_region_entries() [+ + +]
Author: Xiangfeng Cai <caixiangfeng@bytedance.com>
Date:   Tue Jul 14 01:14:55 2026 +0800

    mm/hugetlb: fix list corruption in allocate_file_region_entries()
    
    commit dd9623f58ec702a07b2d67179d6fcea79c52231a upstream.
    
    allocate_file_region_entries() tops up resv->region_cache with freshly
    allocated file_region descriptors.  The allocation uses GFP_KERNEL, so
    resv->lock is dropped around it: the new entries are gathered on a
    stack-local list head, allocated_regions, and spliced into
    resv->region_cache once the lock is re-acquired.
    
    The splice used list_splice(), which moves the entries but does not
    re-initialize the source head, so allocated_regions is left pointing at an
    entry that now lives on resv->region_cache.  The top-up runs in a while
    loop that re-checks the cache deficit after re-acquiring the lock.  For a
    shared mapping the resv_map is shared by every mapper of the hugetlbfs
    inode, so a concurrent region_chg()/region_add()/region_del() on the same
    resv_map can consume cache entries during the unlocked window and force a
    second iteration.  That iteration calls list_add() on the stale head and
    corrupts the list; with CONFIG_DEBUG_LIST the __list_add_valid() check
    trips:
    
      list_add corruption. next->prev should be prev (ffffc900011ff7f8),
      but was ffff88814c281460. (next=ffff88814c545640).
      kernel BUG at lib/list_debug.c:31!
       allocate_file_region_entries+0x191/0x420
       region_chg+0x267/0x300
       hugetlb_reserve_pages+0x387/0xc80
       hugetlbfs_file_mmap+0x2ce/0x3f0
       mmap_region+0x1348/0x1a80
       do_mmap+0x85e/0xb90
       vm_mmap_pgoff+0x18c/0x330
       ksys_mmap_pgoff+0x2a1/0x3e0
       do_syscall_64+0xd7/0x420
    
    Without CONFIG_DEBUG_LIST the bad list_add() silently links a kernel-stack
    address into resv->region_cache, leading to later use-after-free.
    
    This was observed as a real host panic on a dense KVM host where a QEMU
    guest-RAM hugetlbfs file was mapped MAP_SHARED by both QEMU and a separate
    SPDK/DPDK vhost-user target, generating concurrent region_* traffic on one
    shared resv_map.
    
    Use list_splice_init() so the source head is re-initialized empty after
    each splice, making the retry loop safe.
    
    Link: https://lore.kernel.org/20260713171456.300518-2-caixiangfeng@bytedance.com
    Fixes: d3ec7b6e09e5 ("mm/hugetlb: use list_splice to merge two list at once")
    Signed-off-by: Xiangfeng Cai <caixiangfeng@bytedance.com>
    Reviewed-by: Muchun Song <muchun.song@linux.dev>
    Cc: Baoquan He <baoquan.he@linux.dev>
    Cc: David Hildenbrand <david@kernel.org>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/page_reporting: use system_freezable_wq to fix UAF during suspend [+ + +]
Author: Link Lin <linkl@google.com>
Date:   Tue Jul 21 00:55:33 2026 +0000

    mm/page_reporting: use system_freezable_wq to fix UAF during suspend
    
    commit 0b45f6927a14914ff685fe0e6f9d11232a1e03df upstream.
    
    During PM freeze (e.g.  S3 suspend or S4 hibernation), device drivers like
    virtio_balloon reset their underlying virtio devices and delete their
    virtqueues via vdev->config->del_vqs().
    
    However, page reporting work (page_reporting_process) was scheduled on the
    global system_wq.  Because system_wq lacks the WQ_FREEZABLE flag, the PM
    freezer skips it, leaving page_reporting_process active during suspend.
    
    If pages are freed into the buddy allocator while suspending (for example,
    when core MM invokes the balloon shrinker during S4 hibernation image
    saving), page reporting triggers virtballoon_free_page_report() on deleted
    virtqueues, resulting in a Use-After-Free / General Protection Fault:
    
        [  196.795226] general protection fault, probably for non-canonical address 0xaa1436fe70dae6df: 0000 [#1] SMP NOPTI
        [  196.825967] Workqueue: events page_reporting_process
        [  196.831038] RIP: 0010:virtqueue_add_split+0x233/0x4c0 [virtio_ring]
        [  196.927073] virtballoon_free_page_report+0x3a/0xe0 [virtio_balloon]
        [  196.946943] page_reporting_process+0x370/0x4f0
    
    Fix this by switching page reporting work to system_freezable_wq.  This
    ensures that the PM freezer pauses page_reporting_process before device
    drivers destroy their reporting virtqueues.  Because the reporting worker
    is frozen, memory reclamation/freeing (e.g.  via shrinker execution) can
    safely return pages to MM during freeze without triggering unfrozen
    reporting work on deleted virtqueues.
    
    This aligns with the driver's existing design. The comment in
    virtballoon_freeze() states:
        /*
         * The workqueue is already frozen by the PM core before this
         * function is called.
         */
    
    Testing:
    I have verified these fixes using Google’s virtualization infrastructure
    by running continuous suspend/resume iterations (40+ cycles) while
    churning memory using stress-ng (`stress-ng --vm 4 --vm-bytes 60%
    --timeout 1`) to constantly create free pages for the buddy allocator.  We
    also set the `page_reporting_order` parameter to 0 to make the page
    reporting worker highly sensitive, forcing it to pick up any 4K free
    pages.  This confirmed that the UAF crashes are no longer reproducible.
    
    Link: https://lore.kernel.org/20260721005603.1710551-1-linkl@google.com
    Fixes: 36e66c554b5c ("mm: introduce Reported pages")
    Signed-off-by: Link Lin <linkl@google.com>
    Suggested-by: David Hildenbrand (Arm) <david@kernel.org>
    Suggested-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: David Rientjes <rientjes@google.com>
    Acked-by: David Hildenbrand (Arm) <david@kernel.org>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Cc: Greg Thelen <gthelen@google.com>
    Cc: James Houghton <jthoughton@google.com>
    Cc: Jason Wang <jasowang@redhat.com>
    Cc: Jiaqi Yan <jiaqiyan@google.com>
    Cc: Vlastimil Babka <vbabka@kernel.org>
    Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/percpu-km: fix bitmap overflow and accounting in pcpu_create_chunk() [+ + +]
Author: Zi Yan <ziy@nvidia.com>
Date:   Thu Jul 9 15:12:01 2026 -0400

    mm/percpu-km: fix bitmap overflow and accounting in pcpu_create_chunk()
    
    commit 89b1b79c308818a715e75f28744b70d8940a07c9 upstream.
    
    In pcpu_create_chunk(), nr_pages is the total contiguous backing
    allocation, i.e., nr_units * pcpu_unit_pages, but pcpu_chunk_populated()
    uses it to set chunk->populated, whose size is pcpu_unit_pages, bitmap.
    Since bit N in chunk->populated means page offset N inside every unit is
    backed.  When nr_units > 1, the function writes beyond chunk->populated.
    Fix it by using chunk->nr_pages.
    
    It also fixes the global pcpu_nr_empty_pop_pages accounting, since
    pcpu_balance_free() only iterates up to chunk->nr_pages.
    
    Commit a63d4ac4ab609 ("percpu: make percpu-km set chunk->populated bitmap
    properly") introduced the bitmap overflow issue.  Later, commit
    b539b87fed37f ("percpu: implmeent pcpu_nr_empty_pop_pages and
    chunk->nr_populated") added pcpu_nr_empty_pop_pages and caused the
    accounting issue.
    
    Link: https://lore.kernel.org/20260709-fix-pcpu_create_chunk-in-percpu-km-v1-1-1f64745a84cc@nvidia.com
    Fixes: a63d4ac4ab609 ("percpu: make percpu-km set chunk->populated bitmap properly")
    Reported-by: Sashiko <sashiko-bot@kernel.org>
    Closes: https://sashiko.dev/#/patchset/20260703-keep-subpage-private-zero-at-free-v2-0-2970fe777dd6%40nvidia.com?part=1
    Assisted-by: Codex:GPT-5
    Signed-off-by: Zi Yan <ziy@nvidia.com>
    Acked-by: Dennis Zhou <dennis@kernel.org>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Zi Yan <ziy@nvidia.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mount: honour SB_NOUSER in the new mount API [+ + +]
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Fri Aug 7 13:38:27 2026 +0300

    mount: honour SB_NOUSER in the new mount API
    
    [ Upstream commit 6dd3c6884cd9defb511284b566cef5ac8f657dbf ]
    
    One should *not* be allowed to mount one of those, new API or not.
    
    Reported-by: Denis Arefev <arefev@swemel.ru>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Link: https://patch.msgid.link/20260602020444.GP2636677@ZenIV
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    [Denis: rename new_mnt -> newmount.mnt]
    [Denis: use goto err_unlock instead of direct return]
    Signed-off-by: Denis Arefev <arefev@swemel.ru>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
mpls: fix NULL deref in mpls_valid_fib_dump_req() on CONFIG_INET=n [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Sat Jul 11 04:50:00 2026 -0700

    mpls: fix NULL deref in mpls_valid_fib_dump_req() on CONFIG_INET=n
    
    [ Upstream commit 56d96fededd61192cd7cc8d2b0f36adfd59036c3 ]
    
    On CONFIG_INET=n builds, mpls_valid_fib_dump_req() walks the parsed
    attribute table itself instead of calling ip_valid_fib_dump_req(). The
    RTA_OIF arm passes tb[RTA_OIF] to nla_get_u32() without checking it is
    present, so an RTM_GETROUTE dump for AF_MPLS with strict checking and no
    RTA_OIF hits a NULL dereference.
    
    RTM_GETROUTE is RTNL_KIND_GET, which rtnetlink_rcv_msg() permits without
    CAP_NET_ADMIN, so an unprivileged user can trigger it.
    
      Oops: general protection fault, probably for non-canonical address
            0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI
      KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
      RIP: 0010:mpls_valid_fib_dump_req (net/mpls/af_mpls.c:2189)
      Call Trace:
       mpls_dump_routes (net/mpls/af_mpls.c:2236)
       netlink_dump (net/netlink/af_netlink.c:2331)
       __netlink_dump_start (net/netlink/af_netlink.c:2446)
       rtnetlink_rcv_msg (net/core/rtnetlink.c:7033)
       netlink_rcv_skb (net/netlink/af_netlink.c:2556)
       netlink_unicast (net/netlink/af_netlink.c:1345)
       netlink_sendmsg (net/netlink/af_netlink.c:1900)
       __sock_sendmsg (net/socket.c:790)
       ____sys_sendmsg (net/socket.c:2684)
       ___sys_sendmsg (net/socket.c:2738)
       __sys_sendmsg (net/socket.c:2770)
       do_syscall_64 (arch/x86/entry/syscall_64.c:94)
       entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
    
    Skip unset attributes, as ip_valid_fib_dump_req() does.
    
    Fixes: 196cfebf8972 ("net/mpls: Handle kernel side filtering of route dumps")
    Assisted-by: Claude:claude-opus-4-8
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: David Ahern <dsahern@kernel.org>
    Link: https://patch.msgid.link/20260711114958.1009619-3-bestswngs@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
mptcp: only set DATA_FIN when a mapping is present [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Thu Jul 9 15:19:25 2026 -0400

    mptcp: only set DATA_FIN when a mapping is present
    
    commit b2ff91b752b0d85e8815e7f44fd85205c4268094 upstream.
    
    mptcp_get_options() clears only the status group of struct
    mptcp_options_received; data_seq, subflow_seq and data_len are filled in
    by mptcp_parse_option() exclusively inside the DSS mapping block, which
    runs only when the DSS M (mapping present) bit is set.
    
    A peer can send a DSS option with the DATA_FIN flag set but the mapping
    bit clear. The parser then records mp_opt->data_fin while leaving
    data_len and data_seq uninitialized. For a zero-length segment
    mptcp_incoming_options() evaluates
    
            if (mp_opt.data_fin && mp_opt.data_len == 1 &&
                mptcp_update_rcv_data_fin(msk, mp_opt.data_seq, mp_opt.dsn64))
    
    which reads the uninitialized data_len and data_seq; KMSAN reports an
    uninit-value in mptcp_incoming_options(). The stale data_seq can also be
    fed into the receive-side DATA_FIN sequence tracking.
    
    Record the DATA_FIN flag only when the DSS option carries a mapping, so
    data_fin is never set without data_seq and data_len also being present.
    data_fin is part of the status group that mptcp_get_options() clears up
    front, so on the no-map path it stays zero and the zero-length DATA_FIN
    branch is simply skipped. A DATA_FIN is always transmitted together with
    a mapping (mptcp_write_data_fin() sets use_map along with data_seq and
    data_len), so legitimate DATA_FIN handling is unaffected.
    
    Move the pr_debug() that logs the parsed DSS flags below the mapping
    block, so it reports the final data_fin value instead of the stale one
    it would otherwise print before the assignment.
    
    Fixes: 43b54c6ee382 ("mptcp: Use full MPTCP-level disconnect state machine")
    Suggested-by: Paolo Abeni <pabeni@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260709191925.2811195-1-michael.bommarito@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mtd: mtdswap: remove debugfs stats file on teardown [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Tue Jun 23 09:53:17 2026 +0800

    mtd: mtdswap: remove debugfs stats file on teardown
    
    [ Upstream commit 66fb31358108d10245b9e4ef0eef3e7d9747055e ]
    
    mtdswap_add_debugfs() creates an mtdswap_stats debugfs file under the
    per-MTD debugfs directory, but mtdswap_remove_dev() never removes it
    before freeing the mtdswap_dev.
    
    Store the returned dentry and remove it during device teardown before the
    driver-private state is freed.
    
    Fixes: a32159024620 ("mtd: Add mtdswap block driver")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

mtd: nand: mtk-ecc: stop on ECC idle timeouts [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Tue Jun 23 21:57:29 2026 +0800

    mtd: nand: mtk-ecc: stop on ECC idle timeouts
    
    [ Upstream commit 16f7ec8d5dc100eafd2c8e06cd30340a30b104a1 ]
    
    mtk_ecc_wait_idle() logs when the encoder or decoder does not become
    idle, but returns void. Callers can therefore configure a non-idle ECC
    engine or read parity bytes after an unconfirmed encoder idle state.
    
    Return the idle poll result and propagate it from the enable and encode
    paths that require the engine to be idle before continuing.
    
    Fixes: 1d6b1e464950 ("mtd: mediatek: driver for MTK Smart Device")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/af_iucv: fix NULL deref in afiucv_hs_callback_syn() [+ + +]
Author: Hidayath Khan <hidayath@linux.ibm.com>
Date:   Thu Jul 9 21:17:32 2026 +0200

    net/af_iucv: fix NULL deref in afiucv_hs_callback_syn()
    
    commit 47a5116e56a6b6fe1e909f244e39cd0fc26ceee4 upstream.
    
    afiucv_hs_callback_syn() allocates the child socket with GFP_ATOMIC.
    If the allocation fails, nsk is NULL.
    
    The connection-refused path is entered when the listen state check
    fails, the accept backlog is full, or nsk is NULL. The code
    unconditionally calls iucv_sock_kill(nsk) in that path.
    
    iucv_sock_kill() does not accept a NULL socket pointer and immediately
    dereferences sk via sock_flag(sk, SOCK_ZAPPED). When nsk is NULL,
    calling iucv_sock_kill(nsk) results in a NULL pointer dereference.
    
    Only call iucv_sock_kill() when a child socket was successfully
    allocated.
    
    Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
    Cc: stable@vger.kernel.org
    Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
    Signed-off-by: Hidayath Khan <hidayath@linux.ibm.com>
    Link: https://patch.msgid.link/20260709191732.124092-1-hidayath@linux.ibm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net/iucv: fix use-after-free of a severed iucv_path [+ + +]
Author: Bryam Vargas <hexlabsecurity@proton.me>
Date:   Tue Jul 7 02:00:54 2026 -0500

    net/iucv: fix use-after-free of a severed iucv_path
    
    commit be7cc4656eb1f54029610e82d1f0fdd3f9b5ec0a upstream.
    
    af_iucv queues not-yet-received message notifications on iucv->message_q,
    each holding a raw pointer to the connection's iucv_path.  When the peer
    severs the connection, iucv_sever_path() frees that path with
    iucv_path_free() but leaves the notifications queued.  A later recvmsg()
    drains message_q via iucv_process_message_q() and hands the stale path to
    message_receive() -- a use-after-free of the freed iucv_path.
    
    Drop the queued notifications when the path is severed; once the path is
    gone they can no longer be received.  This also frees the notifications
    leaked when a socket is closed with messages still queued.
    
    Fixes: f0703c80e515 ("[AF_IUCV]: postpone receival of iucv-packets")
    Closes: https://sashiko.dev/#/patchset/20260705-b4-disp-fc79c0dc-v1-1-d2cdcb57afa9@proton.me?part=1
    Cc: stable@vger.kernel.org
    Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
    Link: https://patch.msgid.link/20260707-b4-disp-783fedbb-v1-1-463b9dbda2ea@proton.me
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net/iucv: take a reference on the socket found in afiucv_hs_rcv() [+ + +]
Author: Bryam Vargas <hexlabsecurity@proton.me>
Date:   Sun Jul 5 22:24:36 2026 -0500

    net/iucv: take a reference on the socket found in afiucv_hs_rcv()
    
    [ Upstream commit 4fa349156043dc119721d067329714179f501749 ]
    
    afiucv_hs_rcv() looks up the destination socket under iucv_sk_list.lock,
    drops the lock, and then passes the socket to the afiucv_hs_callback_*()
    handlers without holding a reference. AF_IUCV sockets are not
    RCU-protected and are freed synchronously by iucv_sock_kill() ->
    sock_put(), so a concurrent close can free the socket in the window
    between read_unlock() and the handler, which then dereferences freed
    memory (for example sk->sk_data_ready() in afiucv_hs_callback_syn()).
    
    Take a reference with sock_hold() while the socket is still on the list
    and release it with sock_put() once the handler has run.
    
    Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
    Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
    Reviewed-by: Hidayath Khan <hidayath@linux.ibm.com>
    Link: https://patch.msgid.link/20260705-b4-disp-fc79c0dc-v1-1-d2cdcb57afa9@proton.me
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/mlx5: E-Switch, fix zero num_dest in prio_tag egress vlan rule [+ + +]
Author: Yael Chemla <ychemla@nvidia.com>
Date:   Fri Jul 17 10:33:06 2026 +0300

    net/mlx5: E-Switch, fix zero num_dest in prio_tag egress vlan rule
    
    [ Upstream commit d12956d083eb70f2c6d72711aebaf8c2ce21e170 ]
    
    esw_egress_acl_vlan_create() hardcodes num_dest=0 in its
    mlx5_add_flow_rules() call. When invoked from the non-bond path
    fwd_dest is NULL and num_dest=0 is correct. When invoked from
    esw_acl_egress_ofld_rules_create() during a bond event, fwd_dest is
    non-NULL and flow_act.action carries MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
    but _mlx5_add_flow_rules() rejects a non-NULL dest pointer paired with
    dest_num<=0 and returns -EINVAL. The error propagates as
    "configure slave vport egress fwd, err(-22)". The passive vport's egress
    ACL table ends up with its flow groups allocated but no FTEs, so
    prio-tagged packets are not popped and bond failover is broken on
    prio_tag_required devices.
    
    Fix by passing fwd_dest ? 1 : 0 as num_dest to match the actual number
    of destinations supplied.
    
    Fixes: bf773dc0e6d5 ("net/mlx5: E-Switch, Introduce APIs to enable egress acl forward-to-vport rule")
    Signed-off-by: Yael Chemla <ychemla@nvidia.com>
    Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
    Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
    Link: https://patch.msgid.link/20260717073306.1242399-1-tariqt@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/mlx5: fw_tracer, return NULL on create error [+ + +]
Author: Michael Guralnik <michaelgur@nvidia.com>
Date:   Wed Jul 29 11:04:02 2026 +0300

    net/mlx5: fw_tracer, return NULL on create error
    
    [ Upstream commit af39eb111ce6b5eba9c08513b62c4868eb7e7fd5 ]
    
    Tracer creation can fail by returning either NULL or ERR_PTR.
    The return value is stored without a check on the device, and users
    treat ERR_PTR and NULL the same way.
    This also causes a crash in the core dump logic, which is missing the
    ERR_PTR check and ends up dereferencing it, as shown in the trace below.
    
    Switch tracer creation to return NULL on failure only, so callers only
    need a single NULL check.
    
      Internal error: Oops: 0000000096000006 [#1]  SMP
      Modules linked in: mlx5_ib ib_uverbs ib_core ipv6 mlx5_core
      CPU: 1 UID: 0 PID: 12 Comm: kworker/u16:0 Not tainted 6.19.7 #1 PREEMPT(none)
      Workqueue: mlx5_health0001:01:00.0 mlx5_fw_reporter_err_work [mlx5_core]
      pstate: a3400009 (NzCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
      pc : mlx5_fw_tracer_trigger_core_dump_general+0x58/0xe0 [mlx5_core]
      lr : mlx5_fw_tracer_trigger_core_dump_general+0x40/0xe0 [mlx5_core]
      sp : ffff800081cf3c40
      x29: ffff800081cf3c90 x28: 0000000000000000 x27: 0000000000000000
      x26: ffff000080018828 x25: 0000000000000000 x24: ffff000080304a05
      x23: ffff800081cf3d80 x22: ffff0000847e01a0 x21: 0000000000000000
      x20: ffff0000847e01a0 x19: ffffffffffffffa1 x18: ffff80008310bbf0
      x17: ffff800080119650 x16: ffff80008010df54 x15: ffff80008010d4ac
      x14: ffff800079c202e4 x13: ffff80008002fe60 x12: ffff800080119650
      x11: ffff80008010df54 x10: ffff80008010d4ac x9 : ffff800079c203d8
      x8 : ffff800081cf3c88 x7 : 0000000000000000 x6 : 0000000000000000
      x5 : 0000000000000000 x4 : 0000000000000008 x3 : 0000000000000030
      x2 : 0000000000000008 x1 : 0000000000000000 x0 : 00000000c5c4000e
      Call trace:
       mlx5_fw_tracer_trigger_core_dump_general+0x58/0xe0 [mlx5_core] (P)
       mlx5_fw_reporter_dump+0x30/0x2e0 [mlx5_core]
       devlink_health_do_dump+0x9c/0x160
       devlink_health_report+0x1c0/0x288
       mlx5_fw_reporter_err_work+0xac/0xc0 [mlx5_core]
       process_one_work+0x15c/0x3d8
       worker_thread+0x18c/0x320
       kthread+0x148/0x228
       ret_from_fork+0x10/0x20
      Code: b9400000 5ac00800 7a401800 540003ca (3940a260)
      ---[ end trace 0000000000000000 ]---
      Kernel panic - not syncing: Oops: Fatal exception
      SMP: stopping secondary CPUs
      Kernel Offset: disabled
      CPU features: 0x000000,00078031,75fce5a1,35fffe67
      Memory Limit: none
      ---[ end Kernel panic - not syncing: Oops: Fatal exception ]---
    
    Fixes: fd1483fe1f9f ("net/mlx5: Add support for FW reporter dump")
    Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
    Reviewed-by: Shay Drori <shayd@nvidia.com>
    Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
    Link: https://patch.msgid.link/20260729080402.2427184-1-tariqt@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/mlx5e: Reject unsupported CB Shaper TSA in ETS validation [+ + +]
Author: Alexei Lazar <alazar@nvidia.com>
Date:   Fri Jul 17 10:51:25 2026 +0300

    net/mlx5e: Reject unsupported CB Shaper TSA in ETS validation
    
    [ Upstream commit 9173e1d3c7c7d49a71eee813091f9e834ec7cee5 ]
    
    Credit Based (CB) TSA is not supported by the mlx5 driver, so reject
    any configurations that specify it.
    
    Fixes: 08fb1dacdd76 ("net/mlx5e: Support DCBNL IEEE ETS")
    Signed-off-by: Alexei Lazar <alazar@nvidia.com>
    Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
    Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
    Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
    Link: https://patch.msgid.link/20260717075125.1244877-3-tariqt@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/mlx5e: Report zero bandwidth for non-ETS traffic classes [+ + +]
Author: Alexei Lazar <alazar@nvidia.com>
Date:   Fri Jul 17 10:51:24 2026 +0300

    net/mlx5e: Report zero bandwidth for non-ETS traffic classes
    
    [ Upstream commit ffb1873b2df11945b8c395e859169248675c91c5 ]
    
    The IEEE 802.1Qaz standard defines that bandwidth allocation percentages
    only apply to Enhanced Transmission Selection (ETS) traffic classes.
    For STRICT and VENDOR transmission selection algorithms, bandwidth
    percentage values are not applicable.
    
    Currently for non-ETS 100 bandwidth is being reported for all traffic
    classes in the get operation due to hardware limitation, regardless of
    their TSA type.
    
    Fix this by reporting 0 for non-ETS traffic classes.
    
    Fixes: 820c2c5e773d ("net/mlx5e: Read ETS settings directly from firmware")
    Signed-off-by: Alexei Lazar <alazar@nvidia.com>
    Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
    Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
    Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
    Link: https://patch.msgid.link/20260717075125.1244877-2-tariqt@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/ncsi: fix heap OOB read in NCSI_CMD_SEND_CMD payload length [+ + +]
Author: Henry Martin <bsdhenrymartin@gmail.com>
Date:   Mon Aug 3 12:36:18 2026 +0800

    net/ncsi: fix heap OOB read in NCSI_CMD_SEND_CMD payload length
    
    [ Upstream commit afa58b7384913c8773d837acdb07b035690ec5d2 ]
    
    ncsi_send_cmd_nl() takes the number of bytes to copy from the
    attacker-controlled ncsi_pkt_hdr.length field of the in-band packet
    header, while the source buffer is the NCSI_ATTR_DATA netlink
    attribute whose readable size is nla_len() - sizeof(ncsi_pkt_hdr).
    The two length sources are never cross-checked: only
    nla_len() >= sizeof(struct ncsi_pkt_hdr) is enforced.
    
    With hdr->length set larger than the attribute payload (up to 65535
    against at most 2032 readable bytes), ncsi_cmd_handler_oem() copies
    past the end of the netlink attribute buffer with unsafe_memcpy(),
    leaking up to ~64KB of kernel heap memory into the transmitted NCSI
    command packet. The destination skb is sized by the declared payload,
    so the write side does not overflow - this is a pure OOB read /
    information leak, reachable with CAP_NET_ADMIN on systems with a
    registered NCSI device (e.g. OpenBMC on Aspeed BMC SoCs, where
    NET_NCSI=y is standard).
    
    Reject commands whose declared payload extends past the end of the
    data attribute.
    
    The issue was found by the autokbug dynamic kernel fuzzer at Tencent
    Yunding Lab.
    
    Fixes: 9771b8ccdfa6 ("net/ncsi: Extend NC-SI Netlink interface to allow user space to send NC-SI command")
    Reported-by: Henry Martin <bsdhenrymartin@gmail.com>
    Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
    Link: https://patch.msgid.link/20260803043618.3210301-1-bsdhenrymartin@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/openvswitch: check Ethernet header length in key_extract() [+ + +]
Author: Cen Zhang (Microsoft) <blbllhy@gmail.com>
Date:   Thu Jul 30 18:20:06 2026 -0400

    net/openvswitch: check Ethernet header length in key_extract()
    
    [ Upstream commit cf6f8b29befb92173659bcef6a441d274947bfae ]
    
    When a packet arrives on an ARPHRD_NONE device (e.g. TUN),
    ovs_flow_key_extract() trusts the user-provided skb->protocol field: if
    it is ETH_P_TEB, the packet is classified as MAC_PROTO_ETHERNET and
    key_extract() is called without ensuring the skb has ETH_HLEN (14) bytes
    of linear data. key_extract() unconditionally pulls 2 * ETH_ALEN bytes
    for MAC addresses and parse_ethertype() pulls 2 more, either of which
    triggers a kernel BUG in __skb_pull() when the linear area is too small.
    
      kernel BUG at include/linux/skbuff.h:2848!
      RIP: 0010:key_extract+0xa7e/0xd90 net/openvswitch/flow.c:933
      ovs_flow_key_extract+0x419/0xa70
      ovs_vport_receive+0x222/0x390
      netdev_frame_hook+0x3e0/0x630
      tun_get_user+0x2d0c/0x38e0
    
    Fixed by calling check_header() in key_extract() before accessing the
    Ethernet header.
    
    Fixes: 217ac77a3c25 ("openvswitch: allow L3 netdev ports")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Reviewed-by: Eelco Chaudron <echaudro@redhat.com>
    Signed-off-by: Cen Zhang (Microsoft) <blbllhy@gmail.com>
    Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
    Link: https://patch.msgid.link/20260730222006.118652-1-blbllhy@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/packet: avoid fanout hook re-registration after unregister [+ + +]
Author: David Lee <david.lee@trailofbits.com>
Date:   Tue Jul 7 10:44:37 2026 +0000

    net/packet: avoid fanout hook re-registration after unregister
    
    [ Upstream commit 50aff80475abd3533eef4320477037e6fcc6b56e ]
    
    packet_set_ring() temporarily detaches a socket from packet delivery while
    reconfiguring its ring. It records the previous running state, clears
    po->num, unregisters the protocol hook when needed, drops po->bind_lock,
    and later restores po->num and re-registers the hook from the saved
    was_running value.
    
    That unlocked window can race with NETDEV_UNREGISTER. The notifier can
    observe the socket as not running, skip __unregister_prot_hook(), and
    invalidate the per-socket binding by setting po->ifindex to -1 and clearing
    po->prot_hook.dev. A one-member fanout group can still retain its shared
    fanout hook device pointer. When packet_set_ring() resumes, re-registering
    solely from the stale was_running state can re-add the fanout hook after
    the device has been unregistered.
    
    Treat po->ifindex == -1 as an invalidated binding after reacquiring
    po->bind_lock. This is distinct from ifindex 0, the normal
    unbound/wildcard state: ifindex -1 marks an existing device binding that
    was invalidated when the device was unregistered. Restore po->num as
    before, but do not re-register the hook if device unregister already
    detached the socket.
    
    Fixes: dc99f600698d ("packet: Add fanout support.")
    Link: https://lore.kernel.org/netdev/20260701113947.23180-1-david.lee@trailofbits.com/
    Signed-off-by: David Lee <david.lee@trailofbits.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260707104440.833129-1-david.lee@trailofbits.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/packet: reset the MAC header on the packet-socket transmit path [+ + +]
Author: Doruk Tan Ozturk <doruk@0sec.ai>
Date:   Fri Jul 24 16:40:15 2026 +0200

    net/packet: reset the MAC header on the packet-socket transmit path
    
    commit c2707480cfbf19c7619acc9c089d17f20869821f upstream.
    
    packet_parse_headers() resets the MAC header only for a SOCK_RAW frame
    whose socket did not bind a protocol. A protocol-bound SOCK_RAW socket,
    any SOCK_DGRAM frame, and the legacy SOCK_PACKET path therefore leave
    skb->mac_header unset here.
    
    For frames sent via __dev_queue_xmit() this is harmless: it resets the
    MAC header unconditionally. But the packet-socket PACKET_QDISC_BYPASS
    path uses dev_direct_xmit(), which does not, so the frame reaches
    ndo_start_xmit() with the MAC header unset. A driver that reads
    eth_hdr(skb) on transmit then dereferences skb->head + (u16)~0, an
    out-of-bounds access ~64 KiB past the head -- the same class fixed for
    one consumer in commit f5089008f90c ("macsec: do not read an unset MAC
    header in macsec_encrypt()").
    
    packet_parse_headers() runs only on the transmit path, where skb->data
    points at the start of the L2 header for every packet-socket type
    regardless of its length: SOCK_RAW and SOCK_PACKET carry a user-supplied
    header and SOCK_DGRAM has one built by dev_hard_header(). Reset the MAC
    header unconditionally, mirroring __dev_queue_xmit(), so the frame is
    anchored on the bypass path too.
    
    Found by 0sec (https://0sec.ai) using automated source analysis;
    verified against source and matched to the macsec KASAN report in
    f5089008f90c. Compile-tested.
    
    Fixes: 75c65772c3d1 ("net/packet: Ask driver for protocol if not provided by user")
    Cc: stable@vger.kernel.org
    Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260724144015.63219-1-doruk@0sec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net/sched: act_gact, act_police: range check the fallback control action [+ + +]
Author: Hyunjung Ko <hj351016@gmail.com>
Date:   Thu Aug 6 19:12:52 2026 +0900

    net/sched: act_gact, act_police: range check the fallback control action
    
    commit 883b56ae58fe657d8497806c7059646e9ba6dbd0 upstream.
    
    tcf_action_check_ctrlact() range checks the primary control action:
    
            if (!opcode)
                    ret = action > TC_ACT_VALUE_MAX ? -EINVAL : 0;
    
    TC_ACT_VALUE_MAX is TC_ACT_TRAP, so kernel-internal verdicts above it
    cannot be set that way. But act_gact and act_police each carry a second,
    independent control action supplied by user space that never reaches that
    helper - TCA_GACT_PROB.paction and TCA_POLICE_RESULT. Both only reject
    TC_ACT_GOTO_CHAIN, so any other value is stored verbatim and returned
    verbatim from the action.
    
    In particular user space can store TC_ACT_CONSUMED, which is
    TC_ACT_VALUE_MAX + 1 and is deliberately not part of the UAPI value
    range. That verdict tells every caller the action took ownership of the
    skb, so nobody frees it: sch_handle_ingress(), sch_handle_egress() and
    tcf_qevent_handle() all deliberately skip the free for it. The result is
    one leaked sk_buff plus its data buffer per packet traversing the filter,
    unbounded, for all traffic on the chain including kernel-generated
    packets.
    
    Both are trivially deterministic. act_gact clamps tcfg_pval to >= 1, so
    with pval = 1 gact_determ() returns the fallback for every packet.
    act_police has no mandatory rate, so rate = 0 leaves tcfp_mtu = ~0 and
    tcf_police_mtu_check() always passes.
    
    TC_ACT_CONSUMED was added by commit 720f22fed81b ("net: sched: refactor
    reinsert action"), after both goto-chain guards were written:
    commit 9469f375ab09 ("net/sched: act_gact: disallow 'goto chain' on
    fallback control action") and
    commit c08f5ed5d625 ("net/sched: act_police: disallow 'goto chain' on
    fallback control action"). Neither guard was widened when the new
    verdict appeared.
    
    Factor the existing range test out of tcf_action_check_ctrlact() as
    tcf_action_valid() and apply it to both fallbacks. The helper cannot call
    tcf_action_check_ctrlact() directly because that also allocates a
    goto_chain, which is exactly what these two sites must not do.
    
    Reproduced on v7.2-rc6: kmemleak reports one leaked 232-byte
    skbuff_head_cache object plus its 704-byte data buffer per packet. With
    this patch both configurations are rejected with -EINVAL and kmemleak
    reports none.
    
    Fixes: 720f22fed81b ("net: sched: refactor reinsert action")
    Cc: stable@vger.kernel.org # v5.3+
    Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
    Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
    Tested-by: Victor Nogueira <victor@mojatatu.com>
    Link: https://patch.msgid.link/20260806101252.809593-1-hj351016@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net/sched: act_tunnel_key: Defer dst_release to RCU callback [+ + +]
Author: Jamal Hadi Salim <jhs@mojatatu.com>
Date:   Sat Jul 11 11:05:37 2026 -0400

    net/sched: act_tunnel_key: Defer dst_release to RCU callback
    
    [ Upstream commit f1f5c8a3955f8fda3f84ed883ac8daa1847e724c ]
    
    Fix a race-condition use-after-free in tunnel_key_release_params().
    
    The function releases the metadata_dst of the old params synchronously
    via dst_release() while deferring the params struct free with
    kfree_rcu(). A concurrent tunnel_key_act() reader on the datapath may
    still hold the old params pointer (under rcu_read_lock_bh) and proceed
    to call dst_clone(¶ms->tcft_enc_metadata->dst) after the writer's
    dst_release has already pushed the dst's rcuref to RCUREF_DEAD.
    
    zdi-disclosures@trendmicro.com produced a poc which i (and Victor) verified
    that KASAN reports:
    
    ==================================================================
    BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:112
    BUG: KASAN: slab-use-after-free in atomic_sub_return_release include/linux/atomic/atomic-instrumented.h:326
    BUG: KASAN: slab-use-after-free in __rcuref_put include/linux/rcuref.h:109
    BUG: KASAN: slab-use-after-free in rcuref_put include/linux/rcuref.h:173
    BUG: KASAN: slab-use-after-free in dst_release+0x5b/0x370 net/core/dst.c:168
    Write of size 4 at addr ffff88806158de40 by task poc/9388
    
    CPU: 0 UID: 0 PID: 9388 Comm: poc Tainted: G        W           7.1.0-rc7 #7 PREEMPT(lazy)
    Tainted: [W]=WARN
    Hardware name: QEMU Ubuntu 25.10 PC v2 (i440FX + PIIX, + 10.1 machine, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    Call Trace:
     <TASK>
     __dump_stack lib/dump_stack.c:94
     dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
     print_address_description mm/kasan/report.c:378
     print_report+0x139/0x4ad mm/kasan/report.c:482
     kasan_report+0xe4/0x1d0 mm/kasan/report.c:595
     check_region_inline mm/kasan/generic.c:186
     kasan_check_range+0x125/0x200 mm/kasan/generic.c:200
     instrument_atomic_read_write include/linux/instrumented.h:112
     atomic_sub_return_release include/linux/atomic/atomic-instrumented.h:326
     __rcuref_put include/linux/rcuref.h:109
     rcuref_put include/linux/rcuref.h:173
     dst_release+0x5b/0x370 net/core/dst.c:168
     refdst_drop include/net/dst.h:272
     skb_dst_drop include/net/dst.h:284
     skb_release_head_state+0x293/0x400 net/core/skbuff.c:1163
     skb_release_all net/core/skbuff.c:1187
    [..]
    Allocated by task 9391:
     kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
     kasan_save_track+0x14/0x30 mm/kasan/common.c:78
     poison_kmalloc_redzone mm/kasan/common.c:398
     __kasan_kmalloc+0x9a/0xb0 mm/kasan/common.c:415
     kasan_kmalloc include/linux/kasan.h:263
     __do_kmalloc_node mm/slub.c:5296
     __kmalloc_noprof+0x2f1/0x830 mm/slub.c:5308
     kmalloc_noprof include/linux/slab.h:954
     kzalloc_noprof include/linux/slab.h:1188
     offload_action_alloc+0x2f/0x130 net/core/flow_offload.c:35
     tcf_action_offload_add_ex+0x1ba/0x880 net/sched/act_api.c:258
     tcf_action_offload_add net/sched/act_api.c:293
     tcf_action_init+0x66e/0xa20 net/sched/act_api.c:1547
     tcf_action_add+0xf6/0x5d0 net/sched/act_api.c:2101
    [..]
    Freed by task 9391:
     kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
     kasan_save_track+0x14/0x30 mm/kasan/common.c:78
     kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
     poison_slab_object mm/kasan/common.c:253
     __kasan_slab_free+0x6b/0x90 mm/kasan/common.c:285
     kasan_slab_free include/linux/kasan.h:235
     slab_free_hook mm/slub.c:2689
     slab_free mm/slub.c:6251
     kfree+0x21f/0x6b0 mm/slub.c:6566
     tcf_action_offload_add_ex+0x4ad/0x880 net/sched/act_api.c:284
     tcf_action_offload_add net/sched/act_api.c:293
     tcf_action_init+0x66e/0xa20 net/sched/act_api.c:1547
     tcf_action_add+0xf6/0x5d0 net/sched/act_api.c:2101
    
    The buggy address belongs to the object at ffff88806158de00
     which belongs to the cache kmalloc-256 of size 256
    The buggy address is located 64 bytes inside of
     freed 256-byte region [ffff88806158de00, ffff88806158df00)
    
    The buggy address belongs to the physical page:
    page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88806158d600 pfn:0x6158c
    head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
    flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff)
    page_type: f5(slab)
    raw: 04fff00000000240 ffff88801c841b40 ffffea0001856290 ffffea0001856190
    raw: ffff88806158d600 0000000800100009 00000000f5000000 0000000000000000
    head: 04fff00000000240 ffff88801c841b40 ffffea0001856290 ffffea0001856190
    head: ffff88806158d600 0000000800100009 00000000f5000000 0000000000000000
    head: 04fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff
    head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002
    page dumped because: kasan: bad access detected
    page_owner tracks the page as allocated
    page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 9391, tgid 9378 (poc), ts 123227323196, free_ts 0
     set_page_owner include/linux/page_owner.h:32
     post_alloc_hook+0xfe/0x140 mm/page_alloc.c:1853
     prep_new_page mm/page_alloc.c:1861
     get_page_from_freelist+0x110c/0x2fc0 mm/page_alloc.c:3941
     __alloc_frozen_pages_noprof+0x263/0x2bc0 mm/page_alloc.c:5221
     alloc_slab_page mm/slub.c:3278
     allocate_slab mm/slub.c:3467
     new_slab+0xa6/0x690 mm/slub.c:3525
     refill_objects+0x271/0x420 mm/slub.c:7272
     refill_sheaf mm/slub.c:2816
     __pcs_replace_empty_main+0x373/0x630 mm/slub.c:4652
     alloc_from_pcs mm/slub.c:4750
     slab_alloc_node mm/slub.c:4884
     __do_kmalloc_node mm/slub.c:5295
     __kmalloc_noprof+0x66d/0x830 mm/slub.c:5308
     kmalloc_noprof include/linux/slab.h:954
     metadata_dst_alloc+0x26/0x90 net/core/dst.c:298
     tun_rx_dst include/net/dst_metadata.h:144
     __ip_tun_set_dst include/net/dst_metadata.h:208
     tunnel_key_init+0xb01/0x1b90 net/sched/act_tunnel_key.c:451
     tcf_action_init_1+0x46b/0x6c0 net/sched/act_api.c:1428
     tcf_action_init+0x448/0xa20 net/sched/act_api.c:1503
     tcf_action_add+0xf6/0x5d0 net/sched/act_api.c:2101
    [..]
    ==================================================================
    
    Fix by moving dst_release() into a custom RCU callback that runs
    after the grace period, matching the lifetime of the containing
    params struct.  Readers in the datapath therefore always find a live
    rcuref when calling dst_clone().
    
    Fixes: 9174c3df1cd18 ("net/sched: act_tunnel_key: fix memory leak in case of action replace")
    Reported-by: zdi-disclosures@trendmicro.com
    Tested-by: Victor Nogueira <victor@mojatatu.com>
    Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
    Reviewed-by: Davide Caratti <dcaratti@redhat.com>
    Link: https://patch.msgid.link/20260711150537.7946-1-jhs@mojatatu.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/sched: cls_route: fix fastmap use-after-free on filter [+ + +]
Author: Jamal Hadi Salim <jhs@mojatatu.com>
Date:   Wed Jul 29 05:44:11 2026 -0400

    net/sched: cls_route: fix fastmap use-after-free on filter
    
    [ Upstream commit 47d7f7051253bdc02b1d245d87e38f16d31a74df ]
    
    The route4 classifier maintains a 16-slot fastmap cache that stores raw
    struct route4_filter pointers indexed by (id, iif). The reader
    (route4_classify) populates this cache via route4_set_fastmap() for every
    classified packet that hits a filter. The writer (route4_delete,
    route4_change) clears the cache via route4_reset_fastmap() before
    RCU-deferred kfree of the filter.
    
    This creates a UAF race:
     1. Reader walks the RCU-protected bucket chain, finds filter f
     2. Writer unlinks f, calls route4_reset_fastmap(), then tcf_queue_work()
     3. Reader calls route4_set_fastmap() and writes f into the cache
        *after* the writer's reset, caching a pointer about to be freed
     4. After the RCU grace period, kfree(f) executes
     5. Next classified packet on the same (id, iif) tuple hits the stale
        fastmap entry and reads f->res from freed memory
    
    Reproduced with an mdelay(100) accelerator in route4_set_fastmap() and a
    concurrent add/delete stress test (provided by both zdi and Santosh).
    Both triggered KASAN slab-use-after-free reports in the route4 fastmap
    paths.
    
    Fix:
    Introduce a per-filter boolean dying flag to suppress stale fastmap
    republishing by in-flight readers.
    
    Fixes: 1109c00547fc ("net: sched: RCU cls_route")
    Reported-by: zdi-disclosures@trendmicro.com
    Reported-by: Santosh Kalluri <santosh.kalluri129@gmail.com>
    Suggested-by: Paolo Abeni <pabeni@redhat.com>
    Tested-by: Victor Nogueira <victor@mojatatu.com>
    Tested-by: Santosh Kalluri <santosh.kalluri129@gmail.com>
    Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
    Link: https://patch.msgid.link/20260729094411.46257-1-jhs@mojatatu.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/sched: sch_cake: drop WARN_ON(1) for malformed packets in ACK filter [+ + +]
Author: Toke Høiland-Jørgensen <toke@toke.dk>
Date:   Wed Jul 29 21:14:16 2026 +0200

    net/sched: sch_cake: drop WARN_ON(1) for malformed packets in ACK filter
    
    [ Upstream commit 2a33516f9ef59ad11844d4fc152f889449b5daf3 ]
    
    The sch_cake ACK filter parses packets to find the TCP header and filter
    duplicated ACKs if the flow is backlogged. The parsing code contains a
    WARN_ON(1) which can be triggered by a malformed IP header in certain
    cases. Depending on the system configuration, this leads either to
    either spamming dmesg with warnings, or a panic if panic_on_warn is set.
    
    The code already correctly skips the offending packet in the branch that
    triggers the warning, so the WARN_ON itself doesn't really serve any
    purpose. So just drop it altogether to avoid the inconvenient side
    effects.
    
    Fixes: 8b7138814f29 ("sch_cake: Add optional ACK filter")
    Reported-by: Zhiling Zou <zhilinz@nebusec.ai>
    Reported-by: Ren Wei <enjou1224z@gmail.com>
    Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
    Link: https://patch.msgid.link/20260729191417.45665-1-toke@toke.dk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/smc: fix qentry overwrite for CONFIRM_LINK and ADD_LINK_CONT in smc_llc_event_handler() [+ + +]
Author: Mahanta Jambigi <mjambigi@linux.ibm.com>
Date:   Wed Jul 29 15:01:53 2026 +0200

    net/smc: fix qentry overwrite for CONFIRM_LINK and ADD_LINK_CONT in smc_llc_event_handler()
    
    [ Upstream commit 976245094925bab9bc39366b2e9ab44ffcde61d0 ]
    
    The SMC_LLC_CONFIRM_LINK / SMC_LLC_ADD_LINK_CONT branch in
    smc_llc_event_handler() stores an incoming qentry into the local LLC flow
    without first checking whether a qentry is already pending. If a malicious or
    buggy peer sends a second CONFIRM_LINK or ADD_LINK_CONT request while a flow is
    active and flow->qentry is already set, smc_llc_flow_qentry_set() overwrites the
    pointer without freeing the previous allocation, leaking one kmalloc-96 object
    per spurious message.
    
    The sibling SMC_LLC_DELETE_LINK branch already has the correct !flow->qentry
    guard. Apply the same guard to the CONFIRM_LINK/ADD_LINK_CONT branch so that a
    duplicate message when qentry is already occupied falls through to break and is
    freed by the kfree(qentry) at the out: label, rather than silently leaking the
    existing allocation.
    
    The response direction (smc_llc_rx_response()) is unaffected: it already guards
    with flow->qentry at the equivalent site and drops duplicate responses
    correctly.
    
    Fixes: 0fb0b02bd6fd ("net/smc: adapt SMC client code to use the LLC flow")
    Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
    Reviewed-by: Hidayath Khan <hidayath@linux.ibm.com>
    Reviewed-by: Sidraya Jayagond <sidraya@linux.ibm.com>
    Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
    Link: https://patch.msgid.link/20260729130153.970800-1-mjambigi@linux.ibm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/smc: fix socket use-after-free during link group termination [+ + +]
Author: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Date:   Thu Jul 23 18:54:54 2026 +0800

    net/smc: fix socket use-after-free during link group termination
    
    commit f621d6ebeebb6374342571e4ddf45fdbc420f6cd upstream.
    
    __smc_lgr_terminate() drops conns_lock after finding a connection in
    lgr->conns_all, but before taking a reference on its socket. The connection
    is embedded in the socket, and its registration reference protects it only
    while the connection remains in the tree.
    
    A concurrent close can unregister the connection and drop that reference,
    freeing the socket before the termination worker reaches sock_hold().
    
    The race is reachable when close overlaps link group termination.
    Local stress testing reproduced the use-after-free and KASAN reported:
    
      BUG: KASAN: slab-use-after-free in __smc_lgr_terminate.part.0 [smc]
      Write of size 4 by task kworker/3:3
      Workqueue: events smc_lgr_terminate_work [smc]
      __smc_lgr_terminate.part.0 [smc]
    
    The socket was allocated by smc_create(), freed through
    slab_free_after_rcu_debug(), and was followed by:
    
      refcount_t: addition on 0; use-after-free.
      __smc_lgr_terminate.part.0 [smc]
    
    Take the socket reference while conns_lock still protects the tree entry.
    The unregister path then cannot drop the last reference until termination
    has finished using the socket.
    
    Fixes: 69318b5215f2 ("net/smc: improve abnormal termination locking")
    Cc: stable@vger.kernel.org
    Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
    Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
    Link: https://patch.msgid.link/20260723105454.87016-1-xuanqiang.luo@linux.dev
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net/smc: fix TOCTOU race between smc_listen_out() and listener close [+ + +]
Author: Sidraya Jayagond <sidraya@linux.ibm.com>
Date:   Mon Aug 3 09:07:01 2026 +0200

    net/smc: fix TOCTOU race between smc_listen_out() and listener close
    
    [ Upstream commit 185a4caeecabc150106deda1da170b09f2ad803f ]
    
    smc_listen_out() reads lsmc->sk.sk_state without the listener lock,
    then acquires lock_sock_nested() only after the check passes. This
    opens a window where smc_close_active() can transition the listener
    to SMC_CLOSED, call smc_close_cleanup_listen() to drain the accept
    queue, and release the lock, all between the lockless read and the
    delayed lock acquisition:
    
      smc_listen_work (smc_hs_wq)          smc_close_active()
      -------------------------------      -------------------------
      release_sock(child)
      if (sk_state == SMC_LISTEN) TRUE
                                            lock_sock(listener)
                                            sk_state = SMC_CLOSED
                                            smc_close_cleanup_listen()
                                            release_sock(listener)
                                            flush_work(tcp_listen_work)
      lock_sock_nested(listener)
      smc_accept_enqueue(listener, child) /* child enqueued on dead listener */
    
    smc_close_active() flushes only tcp_listen_work. Work items already
    dispatched onto smc_hs_wq for the CLC handshake continue running
    unguarded. smc_accept_enqueue() takes a sock_hold() on the child that
    is never released, so the child smc_sock, its clcsock, and the
    reference all leak. A remote peer that opens TCP connections while the
    server calls close() can exhaust kernel memory.
    
    Move lock_sock_nested() to before the sk_state check so that the test
    and the enqueue are atomic under the listener lock.
    
    Fixes: fd57770dd198 ("net/smc: wait for pending work before clcsock release_sock")
    Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
    Signed-off-by: Sidraya Jayagond <sidraya@linux.ibm.com>
    Reviewed-by: Breno Leitao <leitao@debian.org>
    Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
    Link: https://patch.msgid.link/20260803070701.126339-1-sidraya@linux.ibm.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/x25: fix use-after-free in x25_kill_by_neigh() [+ + +]
Author: David Lee <david.lee@trailofbits.com>
Date:   Mon Jul 13 10:47:50 2026 +0000

    net/x25: fix use-after-free in x25_kill_by_neigh()
    
    commit 5499e0602d2faafd42c580d25f615903c3fbe11b upstream.
    
    x25_kill_by_neigh() walks the global X.25 socket list looking for sockets
    attached to a terminating neighbour. x25_list_lock protects list membership
    while the lookup is in progress, but it does not pin a socket's lifetime
    after the lock is dropped.
    
    The function currently drops x25_list_lock before calling lock_sock(s). A
    concurrent close can run x25_release(), remove the same socket from
    x25_list, and drop the last socket reference in that window. The neighbour
    teardown path can then lock or inspect a freed struct sock/struct x25_sock.
    
    Take sock_hold(s) while x25_list_lock still proves that the list entry is
    live, then drop the temporary reference after the socket has been locked,
    rechecked, and released. Recheck x25_sk(s)->neighbour after lock_sock(),
    because another path may have disconnected the socket before this path
    acquired the socket lock. Restart the list walk after each disconnect
    because the list lock was dropped and the previous iterator state may no
    longer be valid.
    
    A QEMU/KASAN run against origin/master reproduced a slab-use-after-free in
    x25_kill_by_neigh().
    
    Fixes: 7781607938c8 ("net/x25: Fix null-ptr-deref caused by x25_disconnect")
    Cc: stable@vger.kernel.org
    Signed-off-by: David Lee <david.lee@trailofbits.com>
    Assisted-by: Codex:gpt-5.5
    Acked-by: Martin Schiller <ms@dev.tdt.de>
    Link: https://patch.msgid.link/20260713104752.241175-1-david.lee@trailofbits.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net: atlantic: free RX pages of consumed but not refilled buffers [+ + +]
Author: Yangyu Chen <cyy@cyyself.name>
Date:   Sun Aug 2 23:46:38 2026 +0800

    net: atlantic: free RX pages of consumed but not refilled buffers
    
    commit e8e7471ef686b6c002218fee9671cc61992ae01a upstream.
    
    aq_ring_rx_deinit() only walks [sw_head, sw_tail), the region posted to
    hardware. Since the page reuse strategy was added, a cleaned RX buffer
    keeps its page (and its DMA mapping) in the ring for reuse, and refill
    is batched: aq_ring_rx_fill() returns early until AQ_CFG_RX_REFILL_THRES
    slots are free. Slots that were consumed but not yet reposted therefore
    sit in the complementary [sw_tail, sw_head) gap with a live page, and
    the deinit walk never visits them: up to a refill batch worth of pages
    and DMA mappings leak on every interface down.
    
    Walk the whole ring instead and release whatever is still there. Also
    bail out if the buffer ring is already gone: a partial
    aq_ptp_ring_alloc() failure frees the ring but leaves aq_nic set, so
    aq_ptp_ring_deinit() still gets here on the unwind path.
    
    Cc: stable@vger.kernel.org # v5.2+
    Fixes: 46f4c29d9de6 ("net: aquantia: optimize rx performance by page reuse strategy")
    Reviewed-by: Sukhdeep Singh <sukhdeeps@marvell.com>
    Signed-off-by: Yangyu Chen <cyy@cyyself.name>
    Acked-by: Mina Almasry <almasrymina@google.com>
    Link: https://patch.msgid.link/tencent_607CBA8237DA438E36B844318B21538DE008@qq.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: bridge: mrp: fix Option TLV length in MRP_Test frames [+ + +]
Author: David Corvaglia <david@corvaglia.dev>
Date:   Sun Jul 26 06:26:05 2026 +0000

    net: bridge: mrp: fix Option TLV length in MRP_Test frames
    
    [ Upstream commit 5546da86894d5906f131b05890705a7abf949d84 ]
    
    oui is a pointer, so sizeof(oui) is the pointer size. The MRA
    Option TLV thus advertises a wrong length (15 vs 10 on x86_64),
    causing misparsing of the frame on peers. Fix is to replace
    with sizeof(*oui).
    
    Fixes: f7458934b079 ("net: bridge: mrp: Update the Test frames for MRA")
    Signed-off-by: David Corvaglia <david@corvaglia.dev>
    Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
    Link: https://patch.msgid.link/20260726062605.2746-1-david@corvaglia.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: bridge: mrp: fix uninitialised bytes on the wire [+ + +]
Author: Baul Lee <baul.lee@xbow.com>
Date:   Wed Jul 29 22:19:41 2026 +0900

    net: bridge: mrp: fix uninitialised bytes on the wire
    
    commit 63488dba65ef91373ef616575b32eb0eb21459f4 upstream.
    
    br_mrp_alloc_test_skb() builds MRP test frames on an skb from
    dev_alloc_skb(), which does not clear the linear data area.  On the MRA
    ring-role branch the sub-option TLV header is appended with
    
            sub_tlv = skb_put(skb, sizeof(*sub_tlv));
            sub_tlv->type = BR_MRP_SUB_TLV_HEADER_TEST_AUTO_MGR;
    
    so sub_tlv->length is never written, and the two trailing alignment bytes
    are appended with a bare skb_put() that does not clear them either.  The
    neighbouring oui and sub_opt regions are explicitly zeroed, so three
    uninitialised bytes are left in every MRA MRP_Test frame that goes out.
    
    Put the sub-option TLV header and the alignment padding in a single
    skb_put_zero(), which clears both.  The AUTO_MGR sub-TLV carries no
    payload, so the zeroed length field is already the value it should have.
    
    Fixes: f7458934b079 ("net: bridge: mrp: Update the Test frames for MRA")
    Suggested-by: Nikolay Aleksandrov <razor@blackwall.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Baul Lee <baul.lee@xbow.com>
    Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
    Link: https://patch.msgid.link/20260729131941.10254-1-baul.lee@xbow.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: bridge: stop fast-leave after deleting a port group [+ + +]
Author: Zhiling Zou <zhilinz@nebusec.ai>
Date:   Fri Jul 24 00:52:48 2026 +0800

    net: bridge: stop fast-leave after deleting a port group
    
    commit a39789f211b8a4125f0c70e05b30cf715f4f187d upstream.
    
    br_multicast_leave_group() iterates mp->ports with pp = &p->next in
    its fast-leave path. After br_multicast_del_pg() removes p,
    continuing the loop advances pp through the deleted entry.
    
    If multicast-to-unicast was enabled, the bridge can hold multiple port
    groups for the same port and group with different source MAC
    addresses. Once multicast-to-unicast is disabled,
    br_port_group_equal() matches those entries by port only. A fast leave
    can then delete one entry and continue from its stale next pointer,
    leaving mp->ports pointing at a deleted port group.
    
    Fast leave only needs to remove one matching port group. Break after
    br_multicast_del_pg() so the loop stops before dereferencing the
    removed entry.
    
    Fixes: 6db6f0eae605 ("bridge: multicast to unicast")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
    Signed-off-by: Ren Wei <enjou1224z@gmail.com>
    Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
    Link: https://patch.msgid.link/1cf0898872ef7c72d5f4c0304414a192c6dac591.1784707712.git.zhilinz@nebusec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: bridge: vlan: fix vlan range dumps starting with pvid [+ + +]
Author: Nikolay Aleksandrov <razor@blackwall.org>
Date:   Tue Jul 21 17:09:21 2026 +0300

    net: bridge: vlan: fix vlan range dumps starting with pvid
    
    [ Upstream commit 43171c97e4714bf601b468401b37732244639c21 ]
    
    There is a bug in all range dumps that rely on br_vlan_can_enter_range()
    when the PVID is a range starting VLAN, all following VLANs that match
    its flags can enter the range, but when the range is filled in only the
    PVID VLAN is dumped and the rest of the range is discarded because
    br_vlan_fill_vids() checks for the PVID flag. Since the PVID VLAN can
    be only one, we need to break ranges around it, the best way to do that
    consistently for all is to alter br_vlan_can_enter_range() to take into
    account the PVID and return false to break the range when it's matched.
    
    Before the fix:
    $ ip l add br0 type bridge vlan_filtering 1
    $ ip l add dumdum type dummy
    $ ip l set dumdum master br0
    $ ip l set br0 up
    $ ip l set dumdum up
    $ bridge vlan add dev dumdum vid 1 pvid untagged master
    $ bridge vlan add dev dumdum vid 2 untagged master
    $ bridge vlan show dev dumdum # use legacy dump to show all vlans
    port              vlan-id
    dumdum            1 PVID Egress Untagged
                      2 Egress Untagged
    
    $ bridge -d vlan show dev dumdum # use the new dump (RTM_GETVLAN)
    port              vlan-id
    dumdum            1 PVID Egress Untagged
                        state forwarding mcast_router 1
    
    VLAN 2 is missing, and if there are more matching VLANs afterwards
    they'd be missing too.
    
    After the fix:
    [ same setup steps ]
    $ bridge vlan show dev dumdum
    port              vlan-id
    dumdum            1 PVID Egress Untagged
                      2 Egress Untagged
    $ bridge -d vlan show dev dumdum # use the new dump (RTM_GETVLAN)
    port              vlan-id
    dumdum            1 PVID Egress Untagged
                        state forwarding mcast_router 1
                      2 Egress Untagged
                        state forwarding mcast_router 1
    
    Fixes: 0ab558795184 ("net: bridge: vlan: add rtm range support")
    Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260721140922.682265-2-razor@blackwall.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: dpaa2-eth: assign priv->mac after dpaa2_mac_connect() call [+ + +]
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Tue Nov 29 16:12:14 2022 +0200

    net: dpaa2-eth: assign priv->mac after dpaa2_mac_connect() call
    
    [ Upstream commit 02d61948e8daf3844d0af41ba5d563ef03cc7c4f ]
    
    There are 2 requirements for correct code:
    
    - Any time the driver accesses the priv->mac pointer at runtime, it
      either holds NULL to indicate a DPNI-DPNI connection (or unconnected
      DPNI), or a struct dpaa2_mac whose phylink instance was fully
      initialized (created and connected to the PHY). No changes are made to
      priv->mac while it is being used. Currently, rtnl_lock() watches over
      the call to dpaa2_eth_connect_mac(), so it serves the purpose of
      serializing this with all readers of priv->mac.
    
    - dpaa2_mac_connect() should run unlocked, because inside it are 2
      phylink calls with incompatible locking requirements: phylink_create()
      requires that the rtnl_mutex isn't held, and phylink_fwnode_phy_connect()
      requires that the rtnl_mutex is held. The only way to solve those
      contradictory requirements is to let dpaa2_mac_connect() take
      rtnl_lock() when it needs to.
    
    To solve both requirements, we need to identify the writer side of the
    priv->mac pointer, which can be wrapped in a mutex private to the driver
    in a future patch. The dpaa2_mac_connect() cannot be part of the writer
    side critical section, because of an AB/BA deadlock with rtnl_lock().
    
    So the strategy needs to be that where we prepare the DPMAC by calling
    dpaa2_mac_connect(), and only make priv->mac point to it once it's fully
    prepared. This ensures that the writer side critical section has the
    absolute minimum surface it can.
    
    The reverse strategy is adopted in the dpaa2_eth_disconnect_mac() code
    path. This makes sure that priv->mac is NULL when we start tearing down
    the DPMAC that we disconnected from, and concurrent code will simply not
    see it.
    
    No locking changes in this patch (concurrent code is still blocked by
    the rtnl_mutex).
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Stable-dep-of: b4b201cc93ff ("dpaa2-eth: put MAC endpoint device on disconnect")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: hip04: fix RX buffer leak on build_skb failure [+ + +]
Author: Fan Wu <fanwu01@zju.edu.cn>
Date:   Sun Jul 12 14:27:29 2026 +0000

    net: hip04: fix RX buffer leak on build_skb failure
    
    commit 14fa65d10f5696b063a7d8d26e8291ea84a2c6ed upstream.
    
    When build_skb() fails in hip04_rx_poll(), the driver jumps to the
    refill path without releasing the current RX buffer and its DMA mapping.
    Installing a replacement buffer then overwrites the slot references and
    leaks both resources.
    
    Keep the current slot intact and return budget so NAPI retries the same
    buffer.  Also free a newly allocated RX fragment when dma_map_single()
    fails.
    
    This issue was found by an in-house static analysis tool.
    
    Fixes: 701a0fd52318 ("hip04_eth: fix missing error handle for build_skb failed")
    Cc: stable@vger.kernel.org
    Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Link: https://patch.msgid.link/20260712142729.2057636-1-fanwu01@zju.edu.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: hisilicon: hix5hd2_gmac: remove redundant NAPI delete [+ + +]
Author: Jiawen Liu <1298662399@qq.com>
Date:   Tue Jul 28 12:17:10 2026 +0400

    net: hisilicon: hix5hd2_gmac: remove redundant NAPI delete
    
    [ Upstream commit f307a7dc32097c11413178fca437a10d20890bc2 ]
    
    hix5hd2_dev_remove() calls netif_napi_del() before unregister_netdev().
    This is not needed because free_netdev() deletes all NAPI instances
    attached to the net_device.
    
    Remove the redundant call and let the networking core tear down the NAPI
    instance during unregister_netdev(). The probe error path still keeps its
    explicit netif_napi_del(), because the device has not been registered
    there.
    
    Fixes: 57c5bc9ad7d7 ("net: hisilicon: add hix5hd2 mac driver")
    Signed-off-by: Jiawen Liu <1298662399@qq.com>
    Link: https://patch.msgid.link/tencent_5FFD37A252B4FEA6A80AD25B17C8E904F005@qq.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: hsr: fix memory leak on slave unregistration by removing synced VLANs [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Tue Jul 21 10:12:40 2026 +0000

    net: hsr: fix memory leak on slave unregistration by removing synced VLANs
    
    [ Upstream commit dcf15eaf5641812f1cfc5e96537380132a7da89d ]
    
    When an HSR master device is brought UP, it auto-adds VLAN 0 via
    vlan_vid0_add(), which propagates VID 0 to its slave devices (slave A and B).
    
    If a slave device is later unregistered while HSR is active (e.g., during
    netns cleanup or interface destruction), hsr_del_port() is called to
    detach the slave port from the HSR master. However, hsr_del_port() currently
    does not delete the VLAN IDs that were synced to the slave device by HSR.
    
    As a result, the slave device retains a refcount on VID 0 (and any other
    synced VLANs). When the slave device is destroyed, its vlan_info /
    vlan_vid_info structure remains allocated, leading to a memory leak.
    
    Fix this by calling vlan_vids_del_by_dev(port->dev, master->dev) in
    hsr_del_port() before unlinking slave A or slave B ports, matching the
    propagation logic in hsr_ndo_vlan_rx_add_vid() / hsr_ndo_vlan_rx_kill_vid()
    and the cleanup behavior in bonding and team drivers.
    
    Fixes: 1a8a63a5305e ("net: hsr: Add VLAN CTAG filter support")
    Reported-by: syzbot+456957213f32970c0762@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/netdev/6a4cb6ca.57639fcc.86d58.000b.GAE@google.com/T/#u
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Reviewed-by: Felix Maurer <fmaurer@redhat.com>
    Link: https://patch.msgid.link/20260721101240.995597-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: ipv6: clear suppressed fib6 rule result [+ + +]
Author: Zhiling Zou <zhilinz@nebusec.ai>
Date:   Fri Jul 24 00:48:52 2026 +0800

    net: ipv6: clear suppressed fib6 rule result
    
    commit 6aea62e433fe1b586202a5fee8b5807ce635e1d7 upstream.
    
    fib6_rule_suppress() drops a suppressed route with ip6_rt_put_flags(),
    but leaves res->rt6 pointing at the released rt6_info.
    
    If no later rule supplies a replacement, fib6_rule_lookup() still sees
    res.rt6 and returns that stale dst to its caller. A suppressing rule can
    therefore leak a released route back to rt6_lookup(), and the next put
    hits rcuref_put_slowpath() from dst_release().
    
    Clear res->rt6 when suppressing the route so suppressed lookups fall
    through to the null dst instead of reusing the released one.
    
    Fixes: cdef485217d3 ("ipv6: fix memory leak in fib6_rule_suppress")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
    Signed-off-by: Ren Wei <enjou1224z@gmail.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/4b8acb7787d54e440155585dd32ebdf0bef7d122.1784710966.git.zhilinz@nebusec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: ipv6: fix dif and sdif mismatch in raw6_icmp_error [+ + +]
Author: Li RongQing <lirongqing@baidu.com>
Date:   Fri Jul 17 22:32:30 2026 +0800

    net: ipv6: fix dif and sdif mismatch in raw6_icmp_error
    
    [ Upstream commit 440e274da4d1b93c7df2cb0ce893c3009dd4db55 ]
    
    In raw6_icmp_error(), raw_v6_match() is called with inet6_iif(skb) passed
    to both the 'dif' and 'sdif' arguments. This is a copy-paste or typo error,
    as the last argument should represent the secondary interface index (sdif).
    
    This mismatch breaks ICMPv6 error handling for IPv6 raw sockets in VRF
    (Virtual Routing and Forwarding) environments. When a raw socket is bound
    to a VRF master device, raw_v6_match() fails to find a match because it is
    not given the correct sdif value, causing the socket to miss relevant
    ICMPv6 error notifications.
    
    Fix this by properly passing inet6_sdif(skb) as the last argument to
    raw_v6_match().
    
    Fixes: 5108ab4bf446fa ("net: ipv6: add second dif to raw socket lookups")
    Signed-off-by: Li RongQing <lirongqing@baidu.com>
    Reviewed-by: Joe Damato <joe@dama.to>
    Link: https://patch.msgid.link/20260717143230.1836-1-lirongqing@baidu.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mpls: initialize rtm_tos in mpls_getroute() [+ + +]
Author: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Date:   Thu Jul 23 10:08:29 2026 +0900

    net: mpls: initialize rtm_tos in mpls_getroute()
    
    [ Upstream commit 295dd295e2137e10e9a5b1891d97e0f08de76f03 ]
    
    mpls_getroute() builds the RTM_NEWROUTE reply to an RTM_GETROUTE
    request by filling a struct rtmsg allocated from an skb whose data
    area is not zeroed (alloc_skb(NLMSG_GOODSIZE, ...)). It sets every
    field of the header except rtm_tos:
    
            r = nlmsg_data(nlh);
            r->rtm_family    = AF_MPLS;
            r->rtm_dst_len  = 20;
            r->rtm_src_len  = 0;
            r->rtm_table    = RT_TABLE_MAIN;
            r->rtm_type     = RTN_UNICAST;
            r->rtm_scope    = RT_SCOPE_UNIVERSE;
            r->rtm_protocol = rt->rt_protocol;
            r->rtm_flags    = 0;
    
    struct rtmsg has no padding, so the one uninitialised byte rtm_tos
    (offset 3) is copied straight to user space on recvmsg(), leaking a
    byte of uninitialised heap memory. This is in contrast to
    mpls_dump_route(), which fills the very same header and does set
    rtm_tos = 0.
    
    Initialize rtm_tos to 0, matching mpls_dump_route().
    
    Reproduced with KMSAN by adding an MPLS route and issuing a
    non-RTM_F_FIB_MATCH RTM_GETROUTE for its label:
    
      BUG: KMSAN: kernel-infoleak in _copy_to_iter+0x36c/0x33f0
       _copy_to_iter+0x36c/0x33f0
       __skb_datagram_iter+0x196/0x12c0
       skb_copy_datagram_iter+0x5b/0x210
       netlink_recvmsg+0x37b/0xef0
       ...
      Uninit was created at:
       __alloc_skb+0x8ca/0x10e0
       mpls_getroute+0x1280/0x3a40
       rtnetlink_rcv_msg+0x1138/0x15a0
       ...
      Byte 19 of 64 is uninitialized
    
    (byte 19 = nlmsghdr(16) + rtmsg offset 3 = rtm_tos)
    
    Fixes: 397fc9e5cefe ("mpls: route get support")
    Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    Link: https://patch.msgid.link/20260723010830.289917-1-yhlee@isslab.korea.ac.kr
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: octeontx2-pf: Fix UB in shift operation [+ + +]
Author: Sergey V. Frolov <Sergey.V.Frolov@kaspersky.com>
Date:   Tue Aug 4 15:04:48 2026 +0300

    net: octeontx2-pf: Fix UB in shift operation
    
    commit 7e2d693af0d4c05bddccb3541a0aabd69f4cb244 upstream.
    
    In function otx2_get_egress_burst_cfg, when the parameter `burst` is
    255 and the max mantissa is 255 (0xFFULL), `burst_exp` is set to
    `ilog2(255) - 1`, which equals 6.
    
    This results in an unsigned wrap-around when calculating
    `(1ULL << (*burst_exp - 7))`, since `*burst_exp - 7` becomes -1,
    which makes the shift operand 0xFFFFFFFF. This value is greater than
    the width of the left operand.
    
    According to standard 6.5.7 p.3:
    "The type of the result is that of the promoted left operand.
    If the value of the right operand is negative or is greater than
    or equal to the width of the promoted left operand, the behavior
    is undefined."
    
    Fix the off-by-one boundary condition.
    
    Add a WARN_ON(*burst_exp < 7) before the else branch as an
    explicit safeguard. This ensures that if max_mantissa ever changes
    in a way that reintroduces this condition, it will be immediately
    caught at runtime rather than silently triggering UB.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: e638a83f167e ("octeontx2-pf: TC_MATCHALL egress ratelimiting offload")
    Signed-off-by: Sergey V. Frolov <Sergey.V.Frolov@kaspersky.com>
    Cc: stable@vger.kernel.org
    Reviewed-by: Ratheesh Kannoth <rkannoth@marvell.com>
    Reviewed-by: Sunil Goutham <sgoutham@marvell.com>
    Link: https://patch.msgid.link/20260804120446.1955448-1-Sergey.V.Frolov@kaspersky.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: openvswitch: fix potential UAF on meter attach failure [+ + +]
Author: Ilya Maximets <i.maximets@ovn.org>
Date:   Mon Jul 27 14:10:21 2026 +0200

    net: openvswitch: fix potential UAF on meter attach failure
    
    commit a58a2b0ce354df531ebc71fc870058c2feb59f6b upstream.
    
    While attaching a newly created meter attach_meter() function makes
    the new meter visible to other CPUs but can still fail afterwards.
    On failure, it detaches the meter back and returns an error.
    
    However, this is an unexpected behavior for the ovs_meter_cmd_set()
    that uses a plain kfree(meter) on attach failure without waiting for
    RCU readers to stop using it, assuming it was never visible.
    
    This is never a problem for ovs-vswitchd as it always creates meters
    before creating any flows that use them.  But the UAF can be triggered
    with a custom application using uAPI:
    
     BUG: KASAN: slab-use-after-free in ovs_meter_execute (net/openvswitch/meter.c:653)
     Read of size 8 at addr ffff88810d152650 by task meter/2508
    
     Call Trace:
      ovs_meter_execute (net/openvswitch/meter.c:653)
      do_execute_actions (net/openvswitch/actions.c:1407)
      ovs_execute_actions (net/openvswitch/actions.c:1584)
      ovs_packet_cmd_execute (net/openvswitch/datapath.c:703)
      ...
      netlink_sendmsg (af_netlink.c:1900)
    
     Allocated by task 2519:
      __kasan_kmalloc (mm/kasan/common.c:398 mm/kasan/common.c:415)
      ovs_meter_cmd_set (net/openvswitch/meter.c:422)
      ...
      netlink_sendmsg (af_netlink.c:1900)
    
     Freed by task 2519:
      kfree (mm/slub.c:2705 mm/slub.c:6405 mm/slub.c:6720)
      ovs_meter_cmd_set (net/openvswitch/meter.c:479)
      ...
      netlink_sendmsg (af_netlink.c:1900)
    
    Fix that by making sure attach_meter() doesn't make the meter visible
    until all the checks are done and the function can't fail anymore.
    
    This also makes sure the "hash" value is calculated after the potential
    re-sizing of the table.
    
    Reported by Trend Micro's Zero Day Initiative as ZDI-CAN-31642.
    
    Fixes: c7c4c44c9a95 ("net: openvswitch: expand the meters supported number")
    Cc: stable@vger.kernel.org
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Reviewed-by: Eelco Chaudron <echaudro@redhat.com>
    Link: https://patch.msgid.link/20260727121022.198461-1-i.maximets@ovn.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: openvswitch: fix skb leak on flow key update failure during ct [+ + +]
Author: Ilya Maximets <i.maximets@ovn.org>
Date:   Mon Jul 27 20:18:31 2026 +0200

    net: openvswitch: fix skb leak on flow key update failure during ct
    
    commit bc62e843bc48f933da765ce47079fd992e535794 upstream.
    
    ovs_ct_execute() always steals or frees the skb on failure while
    ovs_flow_key_update() does not.  So, if it fails and we return right
    away, the skb ends up leaked.
    
    Fix that by breaking instead and letting the common error handling
    code at the bottom of the loop to free the skb properly.
    
    This is a very unlikely scenario as it requires the packet to become
    unparseable by applying a set of actions on a previously parseable skb,
    but should be fixed nevertheless.
    
    Reported by Sashiko.
    
    Fixes: ec0d043d05e6 ("openvswitch: Ensure flow is valid before executing ct")
    Cc: stable@vger.kernel.org
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Reviewed-by: Aaron Conole <aconole@redhat.com>
    Link: https://patch.msgid.link/20260727181851.306076-3-i.maximets@ovn.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: openvswitch: fix skb leak on flow key update failure during recirculation [+ + +]
Author: Ilya Maximets <i.maximets@ovn.org>
Date:   Thu Aug 6 00:20:07 2026 +0200

    net: openvswitch: fix skb leak on flow key update failure during recirculation
    
    [ Upstream commit e1cf066244dad576221b7123a0e5005967f25a20 ]
    
    do_execute_actions() returns right away when execute_recirc() fails on
    the last action as it assumes this function always takes ownership of
    the skb when 'last' is true.  But when the flow key update fails, the
    function doesn't free the skb and it ends up leaked.
    
    This is a very unlikely scenario as it requires the packet to become
    unparseable by applying a set of actions on a previously parseable skb,
    but should be fixed nevertheless.
    
    Reported by Sashiko.
    
    Fixes: 971427f353f3 ("openvswitch: Add recirc and hash action.")
    Cc: stable@vger.kernel.org
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Reviewed-by: Aaron Conole <aconole@redhat.com>
    Link: https://patch.msgid.link/20260727181851.306076-2-i.maximets@ovn.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [OVS drop reasons are not available in 5.15, hence plain kfree_skb()]
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: openvswitch: reallocate update replies for mismatched IDs [+ + +]
Author: Zhiling Zou <zhilinz@nebusec.ai>
Date:   Mon Aug 3 08:29:36 2026 +0800

    net: openvswitch: reallocate update replies for mismatched IDs
    
    commit 5d1c224dd914579524a183a514c12b95095d12ce upstream.
    
    ovs_flow_cmd_new() preallocates the optional reply skb before it takes
    ovs_mutex and before it knows which existing flow will be updated.
    
    That is normally fine because the skb is sized from the request flow
    identifier.  That identifier also becomes the inserted flow's identifier.
    For updates, however, a request with a UFID may miss the UFID lookup and
    then fall back to the flow key lookup.  That lookup can legitimately find
    an existing key-identified flow.  UFIDs are optional and the flow key is
    the primary identifier.
    
    For echoed replies, ovs_flow_cmd_fill_info() writes the matched flow's
    identifier, not the request identifier used for the preallocation.  A short
    request UFID can therefore leave too little room for the key identifier.
    The fill can then fail with -EMSGSIZE and hit the BUG_ON(error < 0) in the
    update path.
    
    Once the update target has been resolved, reallocate the reply skb if the
    matched flow needs a larger reply than the request identifier allowed.  Do
    this before replacing the actions so the request can still fail cleanly if
    the rare extra allocation fails.
    
    Fixes: 74ed7ab9264c ("openvswitch: Add support for unique flow IDs.")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
    Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
    Link: https://patch.msgid.link/f7bbd3c30ce81a39156e226b3872d73abed21d2f.1785644623.git.zhilinz@nebusec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: phylink: put link_gpio if phylink_create fails [+ + +]
Author: Christian Marangi <ansuelsmth@gmail.com>
Date:   Sun Jul 26 17:08:05 2026 +0200

    net: phylink: put link_gpio if phylink_create fails
    
    [ Upstream commit 0fe1e3e8f3380d7862296a73b528d164e96c76b8 ]
    
    In phylink_create() if phylink_register_sfp() returns an error, link_gpio
    obtained by phylink_parse_fixedlink() is never released. While this is a
    very unlikely scenario, it's worth to fix/handle this.
    
    This was present from the very first implementation of phylink but got
    relevant only with the introduction of ce0aa27ff3f6 ("sfp: add sfp-bus to
    bridge between network devices and sfp cages") where additional function
    were added after phylink_parse_fixedlink() making the release of link_gpio
    needed if such additional function errored out.
    
    While at it, restructure the exit condition of phylink_create() with the
    goto pattern to reduce code duplication on handling error conditions.
    
    Fixes: ce0aa27ff3f6 ("sfp: add sfp-bus to bridge between network devices and sfp cages")
    Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Link: https://patch.msgid.link/20260726150806.2437-1-ansuelsmth@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: prestera: validate firmware header length [+ + +]
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Date:   Fri Jul 31 22:19:06 2026 +0800

    net: prestera: validate firmware header length
    
    [ Upstream commit 8ae344eb540af3f457179b52bc6061416752485c ]
    
    prestera_fw_hdr_parse() reads the firmware header before checking
    that the firmware image contains that header.
    
    Reject images shorter than struct prestera_fw_header before decoding the
    magic and version fields.
    
    Fixes: 4c2703dfd7fabb ("net: marvell: prestera: Add PCI interface support")
    Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
    Acked-by: Elad Nachman <enachman@marvell.com>
    Link: https://patch.msgid.link/20260731141500.1-prestera-v2-pengpeng@iscas.ac.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: qrtr: ns: Limit the maximum server registration per node [+ + +]
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Date:   Sun Aug 2 22:20:04 2026 +0200

    net: qrtr: ns: Limit the maximum server registration per node
    
    [ Upstream commit d5ee2ff98322337951c56398e79d51815acbf955 ]
    
    Current code does no bound checking on the number of servers added per
    node. A malicious client can flood NEW_SERVER messages and exhaust memory.
    
    Fix this issue by limiting the maximum number of server registrations to
    256 per node. If the NEW_SERVER message is received for an old port, then
    don't restrict it as it will get replaced. While at it, also rate limit
    the error messages in the failure path of qrtr_ns_worker().
    
    Note that the limit of 256 is chosen based on the current platform
    requirements. If requirement changes in the future, this limit can be
    increased.
    
    Cc: stable@vger.kernel.org
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Reported-by: Yiming Qian <yimingqian591@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260409-qrtr-fix-v3-1-00a8a5ff2b51@oss.qualcomm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Youssef Samir <youssef.abdulrahman@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: qrtr: ns: Raise lookup limit to 128 [+ + +]
Author: Łukasz Patron <priv.luk@gmail.com>
Date:   Tue Aug 4 22:18:30 2026 +0200

    net: qrtr: ns: Raise lookup limit to 128
    
    [ Upstream commit 7fc1c937b6b37c77df4ba374c37435ab06a2e945 ]
    
    Current limit of 64 is not enough for Sony Xperia 10 VII (SM6475).
    
    After merging v6.6.142 into a downstream AOSP device, it's stuck on
    boot animation and following log spam can be observed in dmesg:
    
    E qrtr    : ctrl_cmd_new_lookup(): QRTR client node exceeds max lookup limit!
    E qrtr    : qrtr_ns_worker(): failed while handling packet from 1:16600
    
    No idea why it needs more than 64 client lookups, but it appears to
    work fine with 128 as it did when there were no limits.
    
    I don't really have a good way to investigate what it needs all
    these lookups for as most of the userspace is closed source.
    
    Fixes: 5640227d9a21 ("net: qrtr: ns: Limit the maximum number of lookups")
    Signed-off-by: Łukasz Patron <priv.luk@gmail.com>
    Link: https://patch.msgid.link/20260804201919.1148015-1-priv.luk@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: qrtr: ns: Raise node count limit to 512 [+ + +]
Author: Youssef Samir <youssef.abdulrahman@oss.qualcomm.com>
Date:   Sun Aug 2 23:33:52 2026 +0200

    net: qrtr: ns: Raise node count limit to 512
    
    [ Upstream commit ff194cffd586cbd4cc49eccb002c65f2a902a277 ]
    
    The current node limit of 64 breaks the functionality for a number of AI200
    deployments that have up to 384 nodes. Raise the limit to 512.
    
    Also, the backport of commit 27d5e84e810b ("net: qrtr: ns: Limit the total
    number of nodes") to 5.10, 5.15 and 6.1 dropped the node_count-- hunk in
    ctrl_cmd_bye(). Add it back.
    
    Fixes: 27d5e84e810b ("net: qrtr: ns: Limit the total number of nodes")
    Cc: stable@vger.kernel.org
    Signed-off-by: Youssef Samir <youssef.abdulrahman@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260713145901.212396-1-youssef.abdulrahman@oss.qualcomm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Youssef Samir <youssef.abdulrahman@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: qrtr: restrict socket creation to the initial network namespace [+ + +]
Author: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
Date:   Thu Jul 16 12:43:19 2026 -0300

    net: qrtr: restrict socket creation to the initial network namespace
    
    [ Upstream commit 3b536db8fb32da9e9c62f2bb45e2e319331f0426 ]
    
    QRTR keeps its entire port and node state in module-global variables
    that are not partitioned per network namespace: qrtr_local_nid is a
    single global node id (always 1) and qrtr_ports is a single global
    xarray. qrtr_port_lookup() and qrtr_local_enqueue() operate on that
    global state with no network-namespace check, and qrtr_create() places
    no restriction on the namespace a socket is created in.
    
    As a result an unprivileged process that creates an AF_QIPCRTR socket
    in a separate network namespace, e.g. via
    unshare(CLONE_NEWUSER | CLONE_NEWNET), can send QRTR datagrams -
    including control-plane messages such as QRTR_TYPE_NEW_SERVER - to QRTR
    sockets owned by another namespace, and vice versa. The receiving
    socket sees such a message as coming from node id 1, indistinguishable
    from a legitimate local client, breaking the isolation that network
    namespaces are expected to provide.
    
    QRTR is a transport to global hardware endpoints (the modem and other
    remote processors) and has no per-namespace semantics; its in-kernel
    name service already creates its socket in init_net only. Confine the
    socket family to the initial network namespace, as other
    non-namespace-aware socket families do (see llc_ui_create() and the
    ieee802154 socket code).
    
    Fixes: bdabad3e363d ("net: Add Qualcomm IPC router")
    Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
    Link: https://patch.msgid.link/20260716154319.3297699-1-qwe.aldo@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: remove CAP_SYS_RAWIO zero-padding in dev_validate_header [+ + +]
Author: Qihang Tang <q.h.hack.winter@gmail.com>
Date:   Wed Aug 5 20:57:27 2026 +0800

    net: remove CAP_SYS_RAWIO zero-padding in dev_validate_header
    
    commit 3b9a324e646d3657a8d9806dfbfe4f3e4066e882 upstream.
    
    dev_validate_header() reads dev->hard_header_len directly when
    zero-padding short link layer headers for CAP_SYS_RAWIO holders:
    
        if (capable(CAP_SYS_RAWIO)) {
            memset(ll_header + len, 0, dev->hard_header_len - len);
            return true;
        }
    
    Packet send paths call dev_validate_header() on skbs whose headroom was
    allocated from an earlier hard_header_len read. If the device is
    reconfigured so that dev->hard_header_len increases before validation,
    the memset writes past the reserved buffer, an out-of-bounds write.
    
    This out-of-bounds write is masked in some SOCK_RAW paths today because
    the same concurrent increase can first make skb_push() exceed the
    reserved headroom and trigger skb_under_panic(). Remove the zero-padding
    branch before making those hard_header_len reads consistent, so the
    snapshot fixes do not turn a loud panic into a silent overwrite.
    
    This path is only reached for variable length L2 protocols, where
    len < hard_header_len but len >= min_header_len. No remaining in-tree
    variable length L2 protocol implements header_ops->validate, and the
    CAP_SYS_RAWIO bypass that zero-pads and accepts short headers has no
    real value beyond allowing testing of intentionally malformed input.
    
    Drop the CAP_SYS_RAWIO branch. The remaining reads of
    dev->hard_header_len in dev_validate_header() are comparisons only and
    have no memory safety impact.
    
    Suggested-by: Willem de Bruijn <willemb@google.com>
    Fixes: 2793a23aacbd ("net: validate variable length ll headers")
    Cc: stable@vger.kernel.org
    Signed-off-by: Qihang Tang <q.h.hack.winter@gmail.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260805125729.19220-2-q.h.hack.winter@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: remove WARN_ON_ONCE() from sk_mc_loop() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Tue Aug 4 15:20:48 2026 +0000

    net: remove WARN_ON_ONCE() from sk_mc_loop()
    
    [ Upstream commit b8a39a09ae4eaae04309e1e38ed6a1101d967496 ]
    
    sk_mc_loop() can be called for sockets that are neither AF_INET
    nor AF_INET6 (e.g. AF_PACKET sockets when sending packets via raw/packet
    socket over virtual devices such as VRF or ipvlan).
    
    In such cases, sk_family is not AF_INET/AF_INET6 and sk_mc_loop() falls
    through the switch statement and triggers WARN_ON_ONCE(1).
    
    Non-INET sockets do not support IP_MULTICAST_LOOP or IPV6_MULTICAST_LOOP
    options, so loopback should default to true without generating a warning.
    
    Fixes: f60e5990d9c1 ("ipv6: protect skb->sk accesses from recursive dereference inside the stack")
    Reported-by: syzbot+22c3218a6fa219e47321@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/netdev/6a72024c.13623e66.bdc14.0019.GAE@google.com/T/#u
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20260804152048.2134341-1-edumazet@google.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: slip: serialize receive against buffer reallocation [+ + +]
Author: Sungmin Kang <726ksm@gmail.com>
Date:   Sat Jul 18 16:36:30 2026 +0900

    net: slip: serialize receive against buffer reallocation
    
    commit ee7f9bb9320add61f7b367d7e6cd55e3a3a4d65d upstream.
    
    sl_realloc_bufs() replaces rbuff and updates buffsize while holding
    sl->lock. slip_receive_buf() reads those fields and writes through rbuff
    without holding the lock.
    
    An MTU change can therefore race with receive processing. An MTU shrink
    can expose the new smaller rbuff with the old larger bound, causing an
    out-of-bounds write. A receive callback which already loaded the old
    rbuff can instead continue writing after that buffer has been freed.
    
    Serialize receive processing with sl_realloc_bufs() by holding sl->lock
    while consuming each receive batch.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Sungmin Kang <726ksm@gmail.com>
    Link: https://patch.msgid.link/20260718073631.1674-1-726ksm@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: stmmac: add tc flower filter for EtherType matching [+ + +]
Author: Ong Boon Leong <boon.leong.ong@intel.com>
Date:   Wed Dec 22 22:43:10 2021 +0800

    net: stmmac: add tc flower filter for EtherType matching
    
    [ Upstream commit e48cb313fde3e6f9434bb41c858d5c791d83f2d0 ]
    
    This patch adds basic support for EtherType RX frame steering for
    LLDP and PTP using the hardware offload capabilities.
    
    Example steps for setting up RX frame steering for LLDP and PTP:
    $ IFDEVNAME=eth0
    $ tc qdisc add dev $IFDEVNAME ingress
    $ tc qdisc add dev $IFDEVNAME root mqprio num_tc 8 \
         map 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 \
         queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 hw 0
    
    For LLDP
    $ tc filter add dev $IFDEVNAME parent ffff: protocol 0x88cc \
         flower hw_tc 5
    OR
    $ tc filter add dev $IFDEVNAME parent ffff: protocol LLDP \
         flower hw_tc 5
    
    For PTP
    $ tc filter add dev $IFDEVNAME parent ffff: protocol 0x88f7 \
         flower hw_tc 6
    
    Show tc ingress filter
    $ tc filter show dev $IFDEVNAME ingress
    
    v1->v2:
     Thanks to Kurt's and Sebastian's suggestion.
     - change from __be16 to u16 etype
     - change ETHER_TYPE_FULL_MASK to use cpu_to_be16() macro
    
    Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 5536d7c84363 ("net: stmmac: fix l3l4 filter rejecting unsupported offload requests")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: stmmac: fix l3l4 filter rejecting unsupported offload requests [+ + +]
Author: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Date:   Mon Jul 13 19:37:15 2026 -0700

    net: stmmac: fix l3l4 filter rejecting unsupported offload requests
    
    [ Upstream commit 5536d7c843637e9430279b94935fcf7df98babb3 ]
    
    The basic flow parser in tc_add_basic_flow() does not validate match
    keys before proceeding. Unsupported offload configurations such as
    partial protocol masks, non-IPv4 network proto, or non-TCP/UDP transport
    proto are silently accepted instead of returning -EOPNOTSUPP.
    
    Add validation to return -EOPNOTSUPP early for:
    - No network or transport proto present in the key
    - Partial protocol mask (only full mask supported)
    - Network proto is not IPv4
    - Transport proto is not TCP or UDP
    
    Each rejection includes an extack message so the user knows which part
    of the match is unsupported.
    
    Also propagate -EOPNOTSUPP from tc_add_basic_flow() in tc_add_flow()
    by returning it directly rather than using break. The break was silently
    discarding the error for FLOW_CLS_REPLACE operations where entry->in_use
    is already true, causing tc_add_flow() to return 0 (success) for
    unsupported replace requests.
    
    Fixes: 425eabddaf0f ("net: stmmac: Implement L3/L4 Filters using TC Flower")
    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/20260714023716.29865-4-muhammad.nazim.amirul.nazle.asmade@altera.com
    Reviewed-by: Jakub Raczynski <j.raczynski@samsung.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: stmmac: reset residual action in L3L4 filters on delete [+ + +]
Author: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Date:   Mon Jul 13 19:37:16 2026 -0700

    net: stmmac: reset residual action in L3L4 filters on delete
    
    [ Upstream commit a448f821289934b961dd9d8d0beb006cc8937ba2 ]
    
    When deleting an L3/L4 flower filter entry, the action field is not
    reset. If a filter was previously configured with a drop action, that
    action may persist and affect subsequent filter configurations
    unintentionally.
    
    Clear the action field when the filter entry is deleted.
    
    Fixes: 425eabddaf0f ("net: stmmac: Implement L3/L4 Filters using TC Flower")
    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/20260714023716.29865-5-muhammad.nazim.amirul.nazle.asmade@altera.com
    Reviewed-by: Jakub Raczynski <j.raczynski@samsung.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: sxgbe: check descriptor ring allocation failures [+ + +]
Author: Chenguang Zhao <zhaochenguang@kylinos.cn>
Date:   Thu Jul 23 10:18:20 2026 +0800

    net: sxgbe: check descriptor ring allocation failures
    
    [ Upstream commit 51b093a7ba27476e1f639455f005e8d2e75390e4 ]
    
    sxgbe_open() ignores the return value of init_dma_desc_rings() and
    continues to program DMA with invalid ring addresses when allocation
    fails. Check the return value and disconnect the PHY on failure.
    
    Fixes: 1edb9ca69e8a ("net: sxgbe: add basic framework for Samsung 10Gb ethernet driver")
    Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: sxgbe: free TX rings on RX allocation failure [+ + +]
Author: Chenguang Zhao <zhaochenguang@kylinos.cn>
Date:   Thu Jul 23 10:18:19 2026 +0800

    net: sxgbe: free TX rings on RX allocation failure
    
    [ Upstream commit c870f7e2890b9f78ac84515a9809cc5c183c975e ]
    
    When RX descriptor ring allocation fails, init_dma_desc_rings() only
    frees the partially allocated RX rings and returns. The TX rings that
    were allocated earlier in the same function are leaked.
    
    Rearrange error labels to clean up TX rings upon RX failures.
    
    Fixes: 1edb9ca69e8a ("net: sxgbe: add basic framework for Samsung 10Gb ethernet driver")
    Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: thunderbolt: Tear down DMA paths before stopping the rings [+ + +]
Author: Fan XinRan <shinjiangjiang@gmail.com>
Date:   Mon Aug 3 14:38:50 2026 +0000

    net: thunderbolt: Tear down DMA paths before stopping the rings
    
    [ Upstream commit 68bf02b6b4ad3f748c6db71fd77b6c0402d252f4 ]
    
    tbnet_tear_down() stops both rings and frees their frame buffers before
    calling tb_xdomain_disable_paths().  tb_ring_stop() zeroes the ring's
    descriptor base and tbnet_free_buffers() unmaps and frees the pages the
    frames sit in, so by the time __tb_path_deactivate_hop() polls the hop's
    'pending' bit, anything still in flight has nowhere to drain to.
    
    The teardown sequence has been in this order since the driver was added.
    The setup path has not: commit ff7cd07f3064 ("net: thunderbolt: Enable
    DMA paths only after rings are enabled") moved the path enable to the end
    of tbnet_connected_work() and documented why:
    
            /* Both logins successful so enable the rings, high-speed DMA
             * paths and start the network device queue.
             *
             * Note we enable the DMA paths last to make sure we have primed
             * the Rx ring before any incoming packets are allowed to
             * arrive.
             */
    
    Teardown was never updated to match, so the rings and the paths now come
    down in the same order they go up instead of in reverse.
    
    On an ASMedia ASM4242 host router the 'pending' bit then never clears:
    every teardown burns the full 500 ms timeout and
    __tb_path_deactivate_hop() returns -ETIMEDOUT.  Raising the timeout to
    5 s does not help, so the hop is not slow to drain, it never drains
    at all.
    
    The failure is invisible above the thunderbolt core.
    __tb_path_deactivate_hops() is void and only calls tb_port_warn();
    tb_path_deactivate(), tb_tunnel_deactivate() and
    __tb_disconnect_xdomain_paths() are void as well, and
    tb_disconnect_xdomain_paths() ends in an unconditional "return 0".  So
    tb_xdomain_disable_paths() reports success and the netdev_warn() below
    it never fires.  Repeated teardowns eventually take the XDomain control
    channel down, after which the peer node is gone and only a power cycle
    brings the controller back.
    
    Deactivating the paths first fixes it.  Measured with kretprobes on a
    stock v6.17 tree with no other patches applied, on a link that was up
    and had just carried traffic:
    
      before: __tb_path_deactivate_hop() returns 0 for the first hop, then
              -ETIMEDOUT for the second 500335 us later
      after:  0 for both, 525 us apart
    
    Alternating the two orderings ABBA over three load levels, four
    teardowns per arm: every teardown failed before the change (21 of 21
    that ran), none failed after (0 of 24).  The before arms ran short
    because the link died partway through.  The same split shows up when
    the interface is enslaved to a bond instead of just brought down, which
    is how I ran into this in the first place.  Throughput and latency after
    the change are unchanged.
    
    Hosts whose routers drain the hop despite the stale descriptor base see
    no functional difference, since the paths end up deactivated either way.
    
    Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
    Signed-off-by: Fan XinRan <shinjiangjiang@gmail.com>
    Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Link: https://patch.msgid.link/20260803-b4-tbnet-teardown-v2-1-27de6a13ca2d@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
netfilter: bridge: release template ct on non-IP path [+ + +]
Author: Zhiling Zou <zhilinz@nebusec.ai>
Date:   Fri Jul 31 14:36:53 2026 +0800

    netfilter: bridge: release template ct on non-IP path
    
    commit d45cc8020d7c0a9f01dee42ff5c40bc14c9af72f upstream.
    
    A bridge nftables ct zone set rule can attach a conntrack template to
    an skb before nf_ct_bridge_pre() sees it. For non-IPv4 and non-IPv6
    EtherTypes, nf_ct_bridge_pre() currently overwrites skb->_nfct with
    IP_CT_UNTRACKED without releasing the existing template reference.
    
    That makes the per-cpu template, and any temporary templates allocated
    for concurrent use, unreachable and leaks memory until the host runs out
    of slab.
    
    Reset the skb conntrack state before marking the frame untracked so the
    existing template reference is dropped on the non-IP path.
    
    Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: ebt_nflog: pin the NFLOG backend [+ + +]
Author: Chengfeng Ye <nicoyip.dev@gmail.com>
Date:   Thu Jul 30 01:31:00 2026 +0800

    netfilter: ebt_nflog: pin the NFLOG backend
    
    commit 30825970339c107bacaf7f61af90fcdb1f597ca1 upstream.
    
    nf_log_unregister() runs after the per-net teardown so its final RCU
    grace period also drains readers that obtained the logger from a per-net
    binding.  However, ebt_nflog passes an explicit ULOG log type to
    nf_log_packet() without holding a reference on the selected logger module,
    unlike the xt_NFLOG and nft_log frontends.
    
    An ebtables nflog rule can therefore remain callable while nfnetlink_log
    is unloaded.  The resulting interleaving is:
    
      CPU 0                               CPU 1
      nfnetlink_log_fini()
        unregister_pernet_subsys()
          kfree(nfnl_log_pernet(net))
                                          ebt_nflog_tg()
                                            nf_log_packet()
                                              nfulnl_log_packet()
                                                instance_lookup_get_rcu()
    
    The global ULOG logger is still registered at this point, so CPU 1
    dereferences the per-net state after CPU 0 has freed it.  KASAN reported:
    
      BUG: KASAN: slab-use-after-free in instance_lookup_get_rcu
      Read of size 8 at addr ff110001052e6210 by task poc/92
      Call Trace:
       instance_lookup_get_rcu+0x1ce/0x1f0 [nfnetlink_log]
       nfulnl_log_packet+0x248/0x2fb0 [nfnetlink_log]
       nf_log_packet+0x204/0x300
       ebt_nflog_tg+0x351/0x550
       ebt_do_table+0xedf/0x22b0
      Allocated by task 90:
       __kmalloc_noprof+0x186/0x470
       ops_init+0x6d/0x420
       register_pernet_operations+0x2f6/0x670
       register_pernet_subsys+0x23/0x40
      Freed by task 93:
       kfree+0x131/0x3c0
       ops_undo_list+0x3e3/0x700
       unregister_pernet_operations+0x232/0x490
       unregister_pernet_subsys+0x1c/0x30
       nfnetlink_log_fini+0x34/0x450 [nfnetlink_log]
    
    Acquire the ULOG logger module reference when an ebt_nflog rule is
    validated and release it when the rule is destroyed.  Request the NFLOG
    backend for legacy callers when needed, matching xt_NFLOG.  This prevents
    module teardown until all ebt_nflog rules have stopped using the logger.
    
    Fixes: c83fa19603bd ("netfilter: nf_log: don't call synchronize_rcu in nf_log_unset")
    Cc: stable@vger.kernel.org
    Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: ipset: do not update comments from kernel-side hash adds [+ + +]
Author: David Lee <david.lee@trailofbits.com>
Date:   Mon Jul 13 09:59:15 2026 +0000

    netfilter: ipset: do not update comments from kernel-side hash adds
    
    commit f30415929be8aeb002d557c8d3f7ab2d2188003a upstream.
    
    mtype_resize() copies comment pointers with memcpy(), not the comment
    objects themselves. During the window after an entry has been copied but
    before the table swap and backlog replay, the old table is still
    published for packet-side updates while the replacement-table entry
    already holds the same ip_set_comment_rcu pointer.
    
    If xt_SET --add-set ... --exist hits that old entry in this window,
    mtype_add() calls ip_set_init_comment() even though packet-side adds
    carry no comment payload. That call frees the shared comment through the
    old entry, so the replacement-table entry now holds a stale pointer.
    When the queued add is replayed on the new table, mtype_add() calls
    ip_set_init_comment() again and strlen() dereferences the stale pointer.
    
    Fix this in mtype_add() by skipping ip_set_init_comment() when
    ext->target marks a packet-side add. Userspace adds still update
    comments, while packet-side adds can no longer free comment storage
    shared with a resize copy.
    
    Fixes: f66ee0410b1c ("netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports")
    Cc: stable@vger.kernel.org
    Signed-off-by: David Lee <david.lee@trailofbits.com>
    Assisted-by: Codex:gpt-5.5
    Acked-by: Jozsef Kadlecsik <kadlec@netfilter.org>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: nf_conntrack_sip: widen NAT rewrite delta to s32 in sip_help_tcp() [+ + +]
Author: Xiang Mei <xmei5@asu.edu>
Date:   Sun Jul 12 16:42:01 2026 -0700

    netfilter: nf_conntrack_sip: widen NAT rewrite delta to s32 in sip_help_tcp()
    
    [ Upstream commit db3d0e0e5d4bc5ab4fe445b9f413d1b486508ca5 ]
    
    sip_help_tcp() stores the size change of each NAT-rewritten SIP message
    in s16 diff and accumulates it in s16 tdiff, but a single message can
    grow by more than S16_MAX while the packet stays under the 65535
    enlarge_skb() limit: nf_nat_sip() rewrites every matching URI, and a long
    Contact list expands the message by tens of kilobytes. diff then wraps,
    and "datalen = datalen + diff - msglen" yields a huge unsigned datalen,
    so the next iteration's ct_sip_get_header() reads past the linearized skb
    tail.
    
    Widen diff, tdiff and the seq_adjust hook to s32. Both are bounded by the
    65535 byte packet limit, and the seqadj core is already s32
    (nf_ct_seqadj_set() takes s32), so no previously accepted input is
    rejected.
    
      BUG: KASAN: use-after-free in ct_sip_get_header (net/netfilter/nf_conntrack_sip.c:464)
      Read of size 1 at addr ffff888010800000 by task ksoftirqd/1/25
       ct_sip_get_header (net/netfilter/nf_conntrack_sip.c:464)
       sip_help_tcp (net/netfilter/nf_conntrack_sip.c:1694)
       nf_confirm (net/netfilter/nf_conntrack_proto.c:183)
       nf_hook_slow (net/netfilter/core.c:619)
       ip6_output (net/ipv6/ip6_output.c:246)
       ip6_forward (net/ipv6/ip6_output.c:690)
       ipv6_rcv (net/ipv6/ip6_input.c:351)
       __netif_receive_skb_one_core (net/core/dev.c:6212)
       process_backlog (net/core/dev.c:6676)
       __napi_poll (net/core/dev.c:7735)
       net_rx_action (net/core/dev.c:7955)
       handle_softirqs (kernel/softirq.c:622)
       run_ksoftirqd (kernel/softirq.c:1076)
       ...
    
    Fixes: f5b321bd37fb ("netfilter: nf_conntrack_sip: add TCP support")
    Reported-by: Weiming Shi <bestswngs@gmail.com>
    Link: https://patch.msgid.link/netfilter-devel/20260712234201.3213635-1-xmei5@asu.edu
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_payload: fix mask build for partial field offload [+ + +]
Author: Xiang Mei (Microsoft) <xmei5@asu.edu>
Date:   Sun Jul 19 22:15:23 2026 +0000

    netfilter: nft_payload: fix mask build for partial field offload
    
    [ Upstream commit 39e88f28fb32bf02bd4b525c24c842c9cff5663d ]
    
    nft_payload_offload_mask() builds the offload match mask for a payload
    expression that covers only part of a header field.  For a partial IPv6
    address match (field_len = 16, priv_len = 1) that shift is 1 << 120, which
    is undefined on the 32-bit int operand.  It also trims only one word, so
    the remaining words stay 0xffffffff (and when priv_len is a multiple of 4
    the trim is skipped entirely), leaving the mask covering more bytes than
    the rule matches.
    
      UBSAN: shift-out-of-bounds in net/netfilter/nft_payload.c:278:20
      shift exponent 120 is too large for 32-bit type 'int'
      ...
    
    The match is byte-granular and struct nft_data is zero-initialised, so the
    correct mask is simply the first priv_len bytes set to 0xff. Set those
    bytes directly and drop the word/shift trimming; this removes the undefined
    shift and no longer over-masks the trailing bytes.
    
    Fixes: a5d45bc0dc50 ("netfilter: nftables_offload: build mask based from the matching bytes")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: xt_hashlimit: validate hashtable supports XT_HASHLIMIT_RATE_MATCH [+ + +]
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Tue Jul 21 22:02:46 2026 +0200

    netfilter: xt_hashlimit: validate hashtable supports XT_HASHLIMIT_RATE_MATCH
    
    [ Upstream commit 305b63e1402267459fdabb183af4527f6799eebf ]
    
    The XT_HASHLIMIT_RATE_MATCH flag mode changes the semantics of the
    dsthash_ent structure which represents an entry in the hashtable.  There
    is a union area which uses a different layout to express the rate match
    mode.
    
    Update .checkentry path to validate the XT_HASHLIMIT_RATE_MATCH mode
    flag is requested by two or more different rules that refer to the same
    hashtable. Otherwise, uninitialized access to the burst field in the
    union is possible.
    
    Reject the use of the XT_HASHLIMIT_RATE_MATCH mode flag if set on by
    revision less than 3 too.
    
    Fixes: bea74641e378 ("netfilter: xt_hashlimit: add rate match mode")
    Reported-and-tested-by: Talha Berk Arslan <talha.anything.info@gmail.com>
    Link: https://patch.msgid.link/20260721074629.668-1-talha.anything.info@gmail.com/
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nexthop: initialize extack in nh_res_bucket_migrate() [+ + +]
Author: Xiang Mei (Microsoft) <xmei5@asu.edu>
Date:   Mon Jul 13 22:15:51 2026 +0000

    nexthop: initialize extack in nh_res_bucket_migrate()
    
    [ Upstream commit 6347c5314cee49f364aaf2e40ff15415a57a116e ]
    
    nh_res_bucket_migrate() passes an uninitialized netlink_ext_ack to
    call_nexthop_res_bucket_notifiers(). When
    nh_notifier_res_bucket_info_init() fails (e.g. the kzalloc returns
    -ENOMEM), the error is propagated back before any notifier sets
    extack._msg, and the error path formats the stale pointer with
    pr_err_ratelimited("%s\n", extack._msg). With CONFIG_INIT_STACK_NONE
    this dereferences uninitialized stack memory:
    
      Oops: general protection fault, probably for non-canonical address ...
      KASAN: maybe wild-memory-access in range [...]
      RIP: 0010:string (lib/vsprintf.c:730)
       vsnprintf (lib/vsprintf.c:2945)
       _printk (kernel/printk/printk.c:2504)
       nh_res_bucket_migrate (net/ipv4/nexthop.c:1816)
       nh_res_table_upkeep (net/ipv4/nexthop.c:1866)
       rtm_new_nexthop (net/ipv4/nexthop.c:3323)
       rtnetlink_rcv_msg (net/core/rtnetlink.c:7076)
       netlink_sendmsg (net/netlink/af_netlink.c:1900)
      Kernel panic - not syncing: Fatal exception
    
    Zero-initialize extack so _msg is NULL on error paths that never set it.
    
    Fixes: 7c37c7e00411 ("nexthop: Implement notifiers for resilient nexthop groups")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260713221551.3344650-1-xmei5@asu.edu
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nfp: Check resource mutex allocation [+ + +]
Author: Ruoyu Wang <ruoyuw560@gmail.com>
Date:   Wed Jul 8 22:34:08 2026 +0800

    nfp: Check resource mutex allocation
    
    [ Upstream commit a61b4db34a753bdf5c9e77a7f3d3dddd41dcfacc ]
    
    nfp_cpp_resource_find() allocates a CPP mutex handle for the matching
    resource-table entry and then reports success.  nfp_resource_try_acquire()
    immediately passes that handle to nfp_cpp_mutex_trylock().
    
    However, nfp_cpp_mutex_alloc() returns NULL on failure.  If that happens
    for a matching table entry, the resource lookup still returns success and
    the following trylock dereferences a NULL mutex pointer while opening the
    resource.
    
    nfp_resource_acquire() already treats failure to allocate the table mutex
    as -ENOMEM.  Do the same for the resource mutex and fail the lookup before
    publishing the rest of the resource handle.
    
    This issue was found by a static analysis checker and confirmed by
    manual source review.
    
    Fixes: f01a2161577d ("nfp: add support for resources")
    Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260708143408.3168425-1-ruoyuw560@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nfs4: take a reference on the nfs_client when running FREE_STATEID [+ + +]
Author: Scott Mayhew <smayhew@redhat.com>
Date:   Wed Nov 3 06:24:40 2021 -0400

    nfs4: take a reference on the nfs_client when running FREE_STATEID
    
    [ Upstream commit 576acc259146af848cec0940f573f7125a116b9f ]
    
    During umount, the session slot tables are freed.  If there are
    outstanding FREE_STATEID tasks, a use-after-free and slab corruption can
    occur when rpc_exit_task calls rpc_call_done -> nfs41_sequence_done ->
    nfs4_sequence_process/nfs41_sequence_free_slot.
    
    Prevent that from happening by taking a reference on the nfs_client in
    nfs41_free_stateid and putting it in nfs41_free_stateid_release.
    
    Signed-off-by: Scott Mayhew <smayhew@redhat.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Stable-dep-of: cf616096a0f3 ("NFS: Pin the 'struct nfs_server' during a FREE_STATEID call")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
NFS: Pin the 'struct nfs_server' during a FREE_STATEID call [+ + +]
Author: Anna Schumaker <anna.schumaker@hammerspace.com>
Date:   Tue Jun 30 14:31:00 2026 -0400

    NFS: Pin the 'struct nfs_server' during a FREE_STATEID call
    
    [ Upstream commit cf616096a0f3a2b60f7d68b6b39674a6867ded9c ]
    
    Dan Aloni reports that he was able to hit a use-after-free bug if a
    FREE_STATEID operation gets delayed for whatever reason. Fix this by
    bumping the refcount of the 'struct nfs_server' object for the duration
    of the FREE_STATEID so it doesn't get cleaned up from underneath us
    while operations are still in flight.
    
    Reported-by: Dan Aloni <dan.aloni@vastdata.com>
    Fixes: 7c1d5fae4a87 ("NFSv4: Convert nfs41_free_stateid to use an asynchronous RPC call")
    Tested-by: Dan Aloni <dan.aloni@vastdata.com>
    Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nvmet-tcp: Fix potential UAF when ddgst mismatch [+ + +]
Author: Sagi Grimberg <sagi@grimberg.me>
Date:   Tue Jul 21 09:54:38 2026 -0400

    nvmet-tcp: Fix potential UAF when ddgst mismatch
    
    commit dbbd07d0a7020b80f6a7028e561908f7b83b3d5a upstream.
    
    Shivam Kumar found via vulnerability testing:
    When data digest is enabled on an NVMe/TCP connection and a digest
    mismatch occurs on a non-final H2C_DATA PDU during an R2T-based
    data transfer, the digest error handler in nvmet_tcp_try_recv_ddgst()
    calls nvmet_req_uninit() - which performs percpu_ref_put() on the
    submission queue - but does NOT mark the command as completed. It
    does not set cqe->status, does not modify rbytes_done, and does not
    clear any flag. When the subsequent fatal error triggers queue
    teardown, nvmet_tcp_uninit_data_in_cmds() iterates all commands,
    checks nvmet_tcp_need_data_in() for each one, and finds that the
    already-uninited command still appears to need data (because
    rbytes_done < transfer_len and cqe->status == 0). It therefore calls
    nvmet_req_uninit() a second time on the same command - a double
    percpu_ref_put against a single percpu_ref_get.
    
    Reported-by: Shivam Kumar <kumar.shivam43666@gmail.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Shivam Kumar <kumar.shivam43666@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
 
octeontx2-pf: Set correct sequence for carrier off and tx queue stop [+ + +]
Author: Suman Ghosh <sumang@marvell.com>
Date:   Fri Jul 24 12:58:31 2026 +0530

    octeontx2-pf: Set correct sequence for carrier off and tx queue stop
    
    [ Upstream commit 16809472409d998afcda402e32b8229b389337c4 ]
    
    During link down event, we were doing netif_tx_stop_all_queues() first
    and then netif_carrier_off(). This can cause a potential race since
    carrier is still on during down event. This patch reverse the calling
    order to fix the issue.
    
    Fixes: 50fe6c02e5ad ("octeontx2-pf: Register and handle link notifications")
    Signed-off-by: Suman Ghosh <sumang@marvell.com>
    Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260724072831.2415281-1-rkannoth@marvell.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
octeontx2-vf: set TC flower flag on MCAM entry allocation [+ + +]
Author: Suman Ghosh <sumang@marvell.com>
Date:   Wed Jul 15 10:50:07 2026 +0530

    octeontx2-vf: set TC flower flag on MCAM entry allocation
    
    [ Upstream commit 0d4d31e3cc5dd6204fa1495c4107f5075acce5ed ]
    
    When MCAM entries are allocated for a VF netdev via the devlink
    mcam_count parameter, only OTX2_FLAG_NTUPLE_SUPPORT was set. That
    enabled ethtool ntuple filters but not tc flower offload. Also set
    OTX2_FLAG_TC_FLOWER_SUPPORT when entries are successfully allocated.
    
    Fixes: 2da489432747 ("octeontx2-pf: devlink params support to set mcam entry count")
    Signed-off-by: Suman Ghosh <sumang@marvell.com>
    Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260715052007.2099851-1-rkannoth@marvell.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
openvswitch: fix GSO userspace truncation underflow [+ + +]
Author: Kyle Zeng <kylebot@openai.com>
Date:   Wed Jul 29 23:00:20 2026 +0200

    openvswitch: fix GSO userspace truncation underflow
    
    [ Upstream commit 4032f8ed10fcb84d41c508dfb04be96589f78dfe ]
    
    OVS_ACTION_ATTR_TRUNC currently stores a delta from the original skb
    length in OVS_CB(skb)->cutlen. When a later userspace action segments a
    GSO skb, queue_gso_packets() reuses that delta for each smaller segment.
    A segment can then reach queue_userspace_packet() with cutlen greater
    than skb->len, underflowing the length passed to skb_zerocopy().
    
    Store the maximum preserved length instead and bound each consumer
    against the current skb length. Use U32_MAX as the no-truncation
    sentinel so the value remains valid if skb geometry changes before a
    consumer handles it.
    
    Fixes: f2a4d086ed4c ("openvswitch: Add packet truncation support.")
    Cc: stable@vger.kernel.org
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Kyle Zeng <kylebot@openai.com>
    Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
    Reviewed-by: Aaron Conole <aconole@redhat.com>
    Link: https://patch.msgid.link/20260707221635.27489-1-kylebot@openai.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    [5.15.y supports neither OVS_ACTION_ATTR_PSAMPLE nor OVS drop reasons]
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
phonet: pep: fix use-after-free in pep_get_sb() [+ + +]
Author: Breno Leitao <leitao@debian.org>
Date:   Tue Jul 21 01:58:45 2026 -0700

    phonet: pep: fix use-after-free in pep_get_sb()
    
    commit 0f71f852a96af9685858ce59fda34ecbf85c283d upstream.
    
    pep_get_sb() doesn't consider that pskb_may_pull() might have relocated
    the skb data, and continue to access the older pointer, causing UAF.
    
    Reproduced under KASAN:
    
      BUG: KASAN: slab-use-after-free in pep_get_sb+0x234/0x3b0
      Read of size 1 at addr ff11000105510f50 by task repro/157
       pep_get_sb+0x234/0x3b0
       pipe_handler_do_rcv+0x5f7/0xa10
       pep_do_rcv+0x203/0x410
       __sk_receive_skb+0x471/0x4a0
       phonet_rcv+0x5b3/0x6c0
       __netif_receive_skb+0xcc/0x1d0
    
    Refetch the header with skb_header_pointer() after pskb_may_pull(), so
    the possibly stale pointer is no longer dereferenced. There are better
    ways to solve this, but, this is the less instrusive one.
    
    Fixes: 9641458d3ec4 ("Phonet: Pipe End Point for Phonet Pipes protocol")
    Cc: stable@vger.kernel.org
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Link: https://patch.msgid.link/20260721-phonet_get_sb_uaf-v1-1-95fd7881cc4e@debian.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
phy-zynqmp: Postpone getting clock rate until actually needed [+ + +]
Author: Mike Looijmans <mike.looijmans@topic.nl>
Date:   Mon Apr 28 08:35:47 2025 +0200

    phy-zynqmp: Postpone getting clock rate until actually needed
    
    [ Upstream commit 065d5885f6180c534b7b176847b3e008f4e11850 ]
    
    At probe time the driver would display the following error and abort:
      xilinx-psgtr fd400000.phy: Invalid rate 0 for reference clock 0
    
    At probe time, the associated GTR driver (e.g. SATA or PCIe) hasn't
    initialized the clock yet, so clk_get_rate() likely returns 0 if the clock
    is programmable. So this driver only works if the clock is fixed.
    
    The PHY driver doesn't need to know the clock frequency at probe yet, so
    wait until the associated driver initializes the lane before requesting the
    clock rate setting.
    
    In addition to allowing the driver to be used with programmable clocks,
    this also reduces the driver's runtime memory footprint by removing an
    array of pointers from struct xpsgtr_phy.
    
    Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
    Acked-by: Michal Simek <michal.simek@amd.com>
    Link: https://lore.kernel.org/r/20250428063648.22034-1-mike.looijmans@topic.nl
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Stable-dep-of: e4779e2a16d6 ("phy: zynqmp: fix clock error handling in xpsgtr_phy_init()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
phy: zynqmp: Allow variation in refclk rate [+ + +]
Author: Sean Anderson <sean.anderson@linux.dev>
Date:   Tue Jul 11 15:45:39 2023 -0400

    phy: zynqmp: Allow variation in refclk rate
    
    [ Upstream commit 76009ee76e05e30e29aade02e788aebe9ce9ffd2 ]
    
    Due to limited available frequency ratios, the reference clock rate may
    not be exactly the same as the required rate. Allow a small (100 ppm)
    deviation.
    
    Signed-off-by: Sean Anderson <sean.anderson@seco.com>
    Link: https://lore.kernel.org/r/20230711194542.898230-1-sean.anderson@seco.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Stable-dep-of: e4779e2a16d6 ("phy: zynqmp: fix clock error handling in xpsgtr_phy_init()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

phy: zynqmp: fix clock error handling in xpsgtr_phy_init() [+ + +]
Author: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Date:   Mon Jul 20 21:08:30 2026 +0530

    phy: zynqmp: fix clock error handling in xpsgtr_phy_init()
    
    [ Upstream commit e4779e2a16d600892aaf743438f6ce8cc4eb3c4c ]
    
    Propagate clk_prepare_enable() failures to the caller instead of
    returning success, and disable the reference clock on initialization
    error paths to avoid leaking clock references when phy_exit() is not
    called.
    
    Fixes: 25d700833513 ("phy: xilinx: phy-zynqmp: dynamic clock support for power-save")
    Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    Reviewed-by: Michal Simek <michal.simek@amd.com>
    Link: https://patch.msgid.link/20260720153832.1130006-2-radhey.shyam.pandey@amd.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

phy: zynqmp: fix L0_TM_DISABLE_SCRAMBLE_ENCODER mask [+ + +]
Author: Nava kishore Manne <nava.kishore.manne@amd.com>
Date:   Sat Jun 27 21:22:27 2026 +0530

    phy: zynqmp: fix L0_TM_DISABLE_SCRAMBLE_ENCODER mask
    
    commit 6cb22477929489a412df8d153e550e77a012e701 upstream.
    
    The L0_TX_DIG_61 register bit 2 is a reserved read-only field.
    The previous mask value 0x0f incorrectly included bit 2, causing
    unintended writes to a reserved bit on every scrambler bypass
    operation.
    
    Correct the mask to (BIT(3) | GENMASK(1, 0)) to cover only the
    valid scramble bypass control bits.
    
    Fixes: 4a33bea00314 ("phy: zynqmp: Add PHY driver for the Xilinx ZynqMP Gigabit Transceiver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
    Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    Acked-by: Michal Simek <michal.simek@amd.com>
    Link: https://patch.msgid.link/20260627155229.2791113-2-radhey.shyam.pandey@amd.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

phy: zynqmp: fix runtime PM leak on probe allocation failure [+ + +]
Author: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Date:   Mon Jul 20 21:08:31 2026 +0530

    phy: zynqmp: fix runtime PM leak on probe allocation failure
    
    [ Upstream commit f3506e15cf72e94f62d5f2d173e5b7008f644cde ]
    
    Allocate saved_regs before pm_runtime_resume_and_get() so a
    devm_kmalloc() failure does not leave an unreleased runtime PM usage
    counter.
    
    Fixes: 5af9b304bc60 ("phy: xilinx: phy-zynqmp: Fix SGMII linkup failure on resume")
    Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    Reviewed-by: Michal Simek <michal.simek@amd.com>
    Link: https://patch.msgid.link/20260720153832.1130006-3-radhey.shyam.pandey@amd.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

phy: zynqmp: keep SERDES scrambler and 8b/10b enabled for USB [+ + +]
Author: Nava kishore Manne <nava.kishore.manne@amd.com>
Date:   Sat Jun 27 21:22:29 2026 +0530

    phy: zynqmp: keep SERDES scrambler and 8b/10b enabled for USB
    
    commit 7eb61caf45607e1e1270f51f8f93f0ded53146da upstream.
    
    USB Gen1 requires scrambling and 8b/10b encoding to be performed in the
    physical layer. Do not bypass PHY-side scrambler or encoder/decoder for
    USB operation, as mandated by the USB 3.x specification.
    
    Scrambler and 8b/10b bypass remain restricted to SATA and SGMII
    modes, where encoding is handled in the controller.
    
    Fixes: 4a33bea00314 ("phy: zynqmp: Add PHY driver for the Xilinx ZynqMP Gigabit Transceiver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
    Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    Acked-by: Michal Simek <michal.simek@amd.com>
    Link: https://patch.msgid.link/20260627155229.2791113-4-radhey.shyam.pandey@amd.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

phy: zynqmp: use read-modify-write for SERDES scrambler bypass [+ + +]
Author: Nava kishore Manne <nava.kishore.manne@amd.com>
Date:   Sat Jun 27 21:22:28 2026 +0530

    phy: zynqmp: use read-modify-write for SERDES scrambler bypass
    
    commit 21e0749f931702765b9d52d05740092bc87fcd8d upstream.
    
    xpsgtr_bypass_scrambler_8b10b() used xpsgtr_write_phy() which performs
    a full register write, silently clearing any bits beyond the intended
    bypass control fields.
    
    Switch to xpsgtr_clr_set_phy() with clr=mask, set=mask to set only
    the bypass bits while preserving the remaining bits in each register.
    
    Fixes: 4a33bea00314 ("phy: zynqmp: Add PHY driver for the Xilinx ZynqMP Gigabit Transceiver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
    Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    Acked-by: Michal Simek <michal.simek@amd.com>
    Link: https://patch.msgid.link/20260627155229.2791113-3-radhey.shyam.pandey@amd.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
pinctrl: bm1880: add missing select GENERIC_PINCONF [+ + +]
Author: Benjamin Boortz <bennib@mailbox.org>
Date:   Mon Jul 20 19:51:04 2026 +0200

    pinctrl: bm1880: add missing select GENERIC_PINCONF
    
    commit dad6e107b3cd9d20514e7799b7ad8674f81e3f30 upstream.
    
    drivers/pinctrl/pinctrl-bm1880.c initialises its pinconf_ops with
    .is_generic = true, but that field is only present when
    CONFIG_GENERIC_PINCONF is enabled (guarded by #ifdef in pinconf.h).
    The Kconfig entry for PINCTRL_BM1880 never selects GENERIC_PINCONF,
    so any config that enables CONFIG_PINCTRL_BM1880=y without
    CONFIG_GENERIC_PINCONF=y fails to compile:
    
      drivers/pinctrl/pinctrl-bm1880.c:1288:10: error: 'const struct pinconf_ops' has no member named 'is_generic'
    
    Found by randconfig testing on arm64; tinyconfig reproducer below.
    Add the missing select to fix the build.
    
    Fixes: 49bd61ebce5f ("pinctrl: Add pinconf support for BM1880 SoC")
    Cc: stable@vger.kernel.org
    Signed-off-by: Benjamin Boortz <bennib@mailbox.org>
    Signed-off-by: Linus Walleij <linusw@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

pinctrl: devicetree: don't free uninitialized dev_name on error path [+ + +]
Author: Karl Mehltretter <kmehltretter@gmail.com>
Date:   Sun Jul 19 14:11:40 2026 +0200

    pinctrl: devicetree: don't free uninitialized dev_name on error path
    
    commit 015b5bcbcb622b32317642be91a7f79aa5413649 upstream.
    
    dt_remember_or_free_map() duplicates dev_name for each map entry. If
    kstrdup_const() fails, dt_free_map() frees dev_name in all num_maps
    entries, including entries that have not been initialized.
    
    Some pinctrl drivers, including pinctrl-imx, allocate the map with
    kmalloc() and leave dev_name for the core to initialize. The untouched
    entries therefore contain uninitialized data which is passed to
    kfree_const().
    
    Reproduced on qemu's mcimx6ul-evk (pinctrl-imx) with failslab injection
    while binding the pinctrl-consuming device, under KASAN:
    
      BUG: KASAN: double-free in dt_free_map+0x34/0xa4
      Free of addr c425a900 by task init/1
       kfree from dt_free_map+0x34/0xa4
       dt_free_map from dt_remember_or_free_map+0x184/0x198
       dt_remember_or_free_map from pinctrl_dt_to_map+0x33c/0x4c8
       pinctrl_dt_to_map from create_pinctrl+0x9c/0x5c0
    
    Initialize all dev_name fields to NULL before duplicating the device
    name, making the full-map cleanup safe after a partial failure.
    
    Fixes: be4c60b563ed ("pinctrl: devicetree: Avoid taking direct reference to device name string")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-fable-5
    Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
    Signed-off-by: Linus Walleij <linusw@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

pinctrl: renesas: rzg2l: Use -ENOTSUPP instead of -EOPNOTSUPP [+ + +]
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Date:   Fri Aug 14 17:35:50 2026 +0300

    pinctrl: renesas: rzg2l: Use -ENOTSUPP instead of -EOPNOTSUPP
    
    commit c1492da3939c89372929e062d731f328f7693f1e upstream.
    
    The pinctrl and GPIO core code make exceptions for the -ENOTSUPP error
    code.  One such example is gpio_set_config_with_argument_optional(),
    which returns success when gpio_set_config_with_argument() returns
    -ENOTSUPP, but reports failure for all other error codes.
    
    Returning -EOPNOTSUPP from the pinctrl driver on the unsupported pinctrl
    operation may lead to boot failures when pinctrl drivers implements
    struct gpio_chip::set_config, the system uses GPIO hogs, and the
    struct gpio_chip::set_config implementation returns -EOPNOTSUPP for the
    unsupported operations.
    
    Return -ENOTSUPP for the unsupported pinctrl operation.
    
    Fixes: 560c633d378a ("pinctrl: renesas: rzg2l: Drop oen_read and oen_write callbacks")
    Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
    Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://patch.msgid.link/20260515124008.2947838-2-claudiu.beznea@kernel.org
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    [claudiu.beznea: fixed conflict by dropping the code not present in
     v5.15 stable]
    Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
powerpc/boot: Fix simpleboot CPU node lookup check [+ + +]
Author: Thorsten Blum <thorsten.blum@linux.dev>
Date:   Thu Jul 2 23:15:55 2026 +0200

    powerpc/boot: Fix simpleboot CPU node lookup check
    
    [ Upstream commit c824ab65685bb119c6c6a3a200b3428c72862d5a ]
    
    fdt_node_offset_by_prop_value() returns a negative error code on
    failure - fix the check accordingly.
    
    Fixes: d2477b5cc8ca ("[POWERPC] bootwrapper: Add a firmware-independent simpleboot target.")
    Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
    Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
    Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
    Link: https://patch.msgid.link/20260702211554.56923-4-thorsten.blum@linux.dev
    Signed-off-by: Sasha Levin <sashal@kernel.org>

powerpc/boot: Fix treeboot-akebono CPU node lookup check [+ + +]
Author: Thorsten Blum <thorsten.blum@linux.dev>
Date:   Thu Jul 2 23:15:57 2026 +0200

    powerpc/boot: Fix treeboot-akebono CPU node lookup check
    
    [ Upstream commit b24fc8278b70a9d27ec801a427ab4de9b769d69a ]
    
    fdt_node_offset_by_prop_value() returns a negative error code on
    failure - fix the check accordingly.
    
    Fixes: 2a2c74b2efcb ("IBM Akebono: Add the Akebono platform")
    Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
    Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
    Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
    Link: https://patch.msgid.link/20260702211554.56923-6-thorsten.blum@linux.dev
    Signed-off-by: Sasha Levin <sashal@kernel.org>

powerpc/boot: Fix treeboot-currituck CPU node lookup check [+ + +]
Author: Thorsten Blum <thorsten.blum@linux.dev>
Date:   Thu Jul 2 23:15:56 2026 +0200

    powerpc/boot: Fix treeboot-currituck CPU node lookup check
    
    [ Upstream commit 43863f6575d2211e8c5157fefb83ad0ad046aab4 ]
    
    fdt_node_offset_by_prop_value() returns a negative error code on
    failure - fix the check accordingly.
    
    Fixes: 228d55053397 ("powerpc/47x: Add support for the new IBM currituck platform")
    Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
    Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
    Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
    Link: https://patch.msgid.link/20260702211554.56923-5-thorsten.blum@linux.dev
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
powerpc/ps3: Fix map failure path in dma_ioc0_map_pages() [+ + +]
Author: Thorsten Blum <thorsten.blum@linux.dev>
Date:   Sat Jul 11 15:09:32 2026 +0200

    powerpc/ps3: Fix map failure path in dma_ioc0_map_pages()
    
    commit 0bb024f11d120abff3e8db9144a585b9d7fb8459 upstream.
    
    If lv1_put_iopte() fails in dma_ioc0_map_pages(), the error path
    decrements iopage but keeps using the failed mapping's offset. As a
    result, it repeatedly tries to invalidate the failed IOPTE slot and
    leaves the already installed IOPTEs valid.
    
    Recompute offset and invalidate the installed IOPTEs instead.
    
    Fixes: 6bb5cf102541 ("[POWERPC] PS3: System-bus rework")
    Cc: stable@vger.kernel.org
    Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
    Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
    Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
    Link: https://patch.msgid.link/20260711130931.740719-3-thorsten.blum@linux.dev
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
powerpc/time: Fix sparse warnings [+ + +]
Author: He Ying <heying24@huawei.com>
Date:   Wed Mar 24 05:09:39 2021 -0400

    powerpc/time: Fix sparse warnings
    
    [ Upstream commit ce0091a0e06045e70c526c8735f8b866a85e0a45 ]
    
    We found these warnings in arch/powerpc/kernel/time.c as follows:
      warning: symbol 'decrementer_max' was not declared. Should it be static?
      warning: symbol 'rtc_lock' was not declared. Should it be static?
      warning: symbol 'dtl_consumer' was not declared. Should it be static?
    
    Declare 'decrementer_max' in powerpc asm/time.h.
    
    Include linux/mc146818rtc.h in powerpc kernel/time.c where 'rtc_lock' is
    declared. And remove duplicated declaration of 'rtc_lock' in powerpc
    platforms/chrp/time.c because it has included linux/mc146818rtc.h.
    
    Move 'dtl_consumer' definition after "include <asm/dtl.h>" because it is
    declared there.
    
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: He Ying <heying24@huawei.com>
    Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20210324090939.143477-1-heying24@huawei.com
    Stable-dep-of: c1c1ffa490fc ("powerpc/vtime: Initialize starttime at boot for native accounting")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

powerpc/time: Prepare to stop elapsing in dynticks-idle [+ + +]
Author: Frederic Weisbecker <frederic@kernel.org>
Date:   Fri May 8 15:16:37 2026 +0200

    powerpc/time: Prepare to stop elapsing in dynticks-idle
    
    [ Upstream commit c8ba971cf8567d49eb5f43ee90c4e50424331c18 ]
    
    Currently the tick subsystem stores the idle cputime accounting in
    private fields, allowing cohabitation with architecture idle vtime
    accounting. The former is fetched on online CPUs, the latter on offline
    CPUs.
    
    For consolidation purpose, architecture vtime accounting will continue
    to account the cputime but will make a break when the idle tick is
    stopped. The dyntick cputime accounting will then be relayed by the tick
    subsystem so that the idle cputime is still seen advancing coherently
    even when the tick isn't there to flush the idle vtime.
    
    Prepare for that and introduce three new APIs which will be used in
    subsequent patches:
    
      - vtime_dynticks_start() is deemed to be called when idle enters in
        dyntick mode. The idle cputime that elapsed so far is accumulated.
    
      - vtime_dynticks_stop() is deemed to be called when idle exits from
        dyntick mode. The vtime entry clocks are fast-forward to current time
        so that idle accounting restarts elapsing from now.
    
      - vtime_reset() is deemed to be called from dynticks idle IRQ entry to
        fast-forward the clock to current time so that the IRQ time is still
        accounted by vtime while nohz cputime is paused.
    
    Also accumulated vtime won't be flushed from dyntick-idle ticks to avoid
    accounting twice the idle cputime, along with nohz accounting.
    
    Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
    Signed-off-by: Thomas Gleixner <tglx@kernel.org>
    Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com>
    Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
    Link: https://patch.msgid.link/20260508131647.43868-6-frederic@kernel.org
    Stable-dep-of: c1c1ffa490fc ("powerpc/vtime: Initialize starttime at boot for native accounting")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
powerpc/vtime: Initialize starttime at boot for native accounting [+ + +]
Author: Shrikanth Hegde <sshegde@linux.ibm.com>
Date:   Fri Jun 5 18:13:29 2026 +0530

    powerpc/vtime: Initialize starttime at boot for native accounting
    
    [ Upstream commit c1c1ffa490fc33591e90852ed0d38804dd20bc36 ]
    
    It was observed that /proc/stat had very large value for one ore more
    CPUs. It was more visible after recent code simplifications around
    cpustats.
    
    System has 240 CPUs.
    
    cat /proc/uptime;
    194.18 46500.55
    cat /proc/stat
    cpu  5966 39 837032887 4650070 164 185 100 0 0 0
    cpu0 108 0 837030890 19109 24 4 23 0 0 0
    
    Since uptime is 194s, system time of each CPU can't be more than 19400.
    Sum of system time  of all CPUs can't be more than 19400*240 4656000.
    In fact huge value is close to mftb(). Note mftb doesn't reset on powerVM
    when the LPAR restart. It only resets when whole system resets. The same
    issue exists for kexec too.
    
    This happens since starttime is not setup at init time. Once it is set
    then subsequent vtime_delta will return the right delta.
    
    Fix it by initializing the starttime during CPU initialization. This
    fixes the large times seen.
    
    cat /proc/uptime; cat /proc/stat
    15.78 3694.63
    cpu  6035 35 1347 369479 23 144 49 0 0 0
    cpu0 19 0 38 1508 0 1 14 0 0 0
    
    Now, system time is reported as expected.
    
    Fixes: cf9efce0ce31 ("powerpc: Account time using timebase rather  than PURR")
    Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
    Suggested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
    Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
    Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
    Link: https://patch.msgid.link/20260605124329.377533-1-sshegde@linux.ibm.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
powerpc: remove the last remnants of cputime_t [+ + +]
Author: Nicholas Piggin <npiggin@gmail.com>
Date:   Thu Oct 6 20:56:53 2022 +1000

    powerpc: remove the last remnants of cputime_t
    
    [ Upstream commit f985adaf2ff934ec869b32ca1f7f97e2825e3a49 ]
    
    cputime_t was a core kernel type, removed by commits
    ed5c8c854f2b..b672592f0221. As explained in commit b672592f0221
    ("sched/cputime: Remove generic asm headers"), the final cleanup
    is for the arch to provide cputime_to_nsec[s](). Commit ade7667a981b
    ("powerpc: Add cputime_to_nsecs()") did that, but justdidn't remove
    the then-unused cputime_to_usecs(), cputime_t type, and associated
    remnants.
    
    Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20221006105653.115829-1-npiggin@gmail.com
    Stable-dep-of: c1c1ffa490fc ("powerpc/vtime: Initialize starttime at boot for native accounting")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ppp: defer channel free to an RCU grace period to fix pppol2tp RX UAF [+ + +]
Author: Norbert Szetei <norbert@doyensec.com>
Date:   Mon Jul 6 11:01:59 2026 +0200

    ppp: defer channel free to an RCU grace period to fix pppol2tp RX UAF
    
    [ Upstream commit ec4215683e47424c9c4762fd3c60f552a3119142 ]
    
    pppol2tp_recv() runs in the L2TP UDP-encap softirq RX path:
    
     l2tp_udp_encap_recv() -> l2tp_recv_common() -> pppol2tp_recv()
       -> ppp_input(&po->chan)
    
    It runs under rcu_read_lock() holding only an l2tp_session reference and
    takes NO reference on the internal PPP channel (struct channel,
    chan->ppp) that ppp_input() dereferences.
    
    The pppox socket is SOCK_RCU_FREE, so 'po' and the embedded ppp_channel
    are RCU-safe.  But the internal struct channel is a separate allocation
    that ppp_release_channel() frees with a plain kfree():
    
     close(data socket) -> pppol2tp_release() -> pppox_unbind_sock()
       -> ppp_unregister_channel() -> ppp_release_channel() -> kfree(pch)
    
    For a channel that is bound (PPPIOCGCHAN) but not attached to a ppp unit
    (no PPPIOCCONNECT, pch->ppp == NULL) and not bridged, teardown skips
    both ppp_disconnect_channel()'s synchronize_net() and
    ppp_unbridge_channels()'s synchronize_rcu(), so the kfree() has no grace
    period.  rcu_read_lock() in pppol2tp_recv() does not protect against a
    plain kfree(), so an in-flight ppp_input() on one CPU can dereference
    the channel just freed by close() on another CPU.
    
    The bug is reachable by an unprivileged user.
    
    Defer the channel free to an RCU callback via call_rcu() so the grace
    period fences any in-flight ppp_input(). The disconnect and unbridge
    teardown paths already fence with synchronize_net()/synchronize_rcu();
    call_rcu() does the same here without stalling the close() path.
    
    Fixes: ee40fb2e1eb5 ("l2tp: protect sock pointer of struct pppol2tp_session with RCU")
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Norbert Szetei <norbert@doyensec.com>
    Reviewed-by: Qingfang Deng <qingfang.deng@linux.dev>
    Link: https://patch.msgid.link/E793FCF2-58DE-4387-A983-C7B4BC3158BD@doyensec.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
pppoe: reload header pointer after dev_hard_header() [+ + +]
Author: Asim Viladi Oglu Manizada <manizada@pm.me>
Date:   Wed Jul 22 09:38:43 2026 +0000

    pppoe: reload header pointer after dev_hard_header()
    
    commit e9c238f6fe42fb1b4dba3a578277de32cb487937 upstream.
    
    pppoe_sendmsg() saves a pointer to the PPPoE header before calling
    dev_hard_header(). Device header callbacks are allowed to reallocate the
    skb head, invalidating pointers into it.
    
    This can happen when a send is blocked in copy_from_user() while the first
    non-Ethernet port is added to an empty team device. The team's delegated
    GRE header callback then expands the skb head. PPPoE subsequently writes
    six bytes through the stale pointer into the freed head.
    
    Reload the PPPoE header through the skb's network-header offset after
    device header creation. pskb_expand_head() updates that offset when it
    relocates the head.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Asim Viladi Oglu Manizada <manizada@pm.me>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20260722093814.3017176-1-manizada@pm.me
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
proc: Fix broken error paths for namespace links [+ + +]
Author: Jann Horn <jannh@google.com>
Date:   Mon Jul 6 20:22:42 2026 +0200

    proc: Fix broken error paths for namespace links
    
    commit 425224c2d700391729be7fe6929a88ef4e2d7a4e upstream.
    
    Don't return the return value of down_read_killable() (0) when a ptrace
    access check fails, return -EACCES as intended.
    
    Reported-by: Magnus Lindholm <linmag7@gmail.com>
    Closes: https://lore.kernel.org/r/20260706170735.2941493-1-linmag7@gmail.com
    Fixes: 6650527444da ("proc: protect ptrace_may_access() with exec_update_lock (part 1)")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jann Horn <jannh@google.com>
    Link: https://patch.msgid.link/20260706-procfs-ns-eacces-fix-v1-1-a69ab14c02e6@google.com
    Tested-by: Magnus Lindholm <linmag7@gmail.com>
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
qede: sync udp_tunnel ports outside qede_lock in the recovery path [+ + +]
Author: Denis V. Lunev <den@openvz.org>
Date:   Sun Jul 26 12:43:11 2026 +0200

    qede: sync udp_tunnel ports outside qede_lock in the recovery path
    
    [ Upstream commit 451c9075d6c53f2438d110addbeeeea6fac18567 ]
    
    A TX timeout on a qede NIC that has VXLAN/GENEVE tunnel ports
    configured wedges the rtnetlink control plane of the whole machine:
    
      NETDEV WATCHDOG: ens6f1 (qede): transmit queue 2 timed out 10226 ms
      [qede_tx_timeout:586(ens6f1)]TX timeout on queue 2!
      [qede_recovery_handler:2665(ens6f0)]Starting a recovery process
    
    The recovery path deadlocks on the driver's own mutex:
    
      qede_sp_task
       rtnl_lock()
       mutex_lock(&edev->qede_lock)        <- taken
       qede_recovery_handler
        qede_load
        udp_tunnel_nic_reset_ntf
         __udp_tunnel_nic_device_sync
          info->sync_table == qede_udp_tunnel_sync
           mutex_lock(&edev->qede_lock)    <- same task: deadlock
    
    The mutex is not recursive, so the kworker blocks on itself with
    rtnl_lock held, and neither lock is ever released. Every task that
    calls rtnl_lock() afterwards (ip, ovs-vswitchd, lldpad, IPv6
    addrconf, sshd) blocks forever while the node still answers ping.
    In a vmcore from an affected production node rtnl_mutex.owner
    decodes to the very kworker blocked at the innermost mutex_lock()
    above.
    
    Re-sync the tunnel ports from qede_sp_task() after the internal lock
    is dropped, still under rtnl_lock as the udp_tunnel API requires.
    This mirrors qede_open(), which calls udp_tunnel_nic_reset_ntf()
    under rtnl without the internal lock.
    
    qede_recovery_handler() now returns whether it has successfully
    reloaded an open device, and the caller re-syncs the ports only in
    that case. This keeps the old gating exactly: a device that was down
    or a failed recovery returns false, as those paths never reached the
    udp_tunnel_nic_reset_ntf() call before either.
    
    This was the only user of the qede_lock()/qede_unlock() helpers, so
    remove them.
    
    Fixes: 8cd160a29415 ("qede: convert to new udp_tunnel_nic infra")
    Signed-off-by: Denis V. Lunev <den@openvz.org>
    CC: Andrew Lunn <andrew+netdev@lunn.ch>
    CC: "David S. Miller" <davem@davemloft.net>
    CC: Eric Dumazet <edumazet@google.com>
    CC: Jakub Kicinski <kuba@kernel.org>
    CC: Paolo Abeni <pabeni@redhat.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Link: https://patch.msgid.link/20260726104311.1782900-1-den@openvz.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
raw: fix a typo in raw_icmp_error() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jun 23 19:35:40 2022 +0000

    raw: fix a typo in raw_icmp_error()
    
    commit 97a4d46b1516250d640c1ae0c9e7129d160d6a1c upstream.
    
    I accidentally broke IPv4 traceroute, by swapping iph->saddr
    and iph->daddr.
    
    Probably because raw_icmp_error() and raw_v4_input()
    use different order for iph->saddr and iph->daddr.
    
    Fixes: ba44f8182ec2 ("raw: use more conventional iterators")
    Reported-by: John Sperbeck <jsperbeck@google.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Link: https://lore.kernel.org/r/20220623193540.2851799-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

raw: remove unused variables from raw6_icmp_error() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Wed Jun 22 03:23:03 2022 +0000

    raw: remove unused variables from raw6_icmp_error()
    
    commit c4fceb46add65481ef0dfb79cad24c3c269b4cad upstream.
    
    saddr and daddr are set but not used.
    
    Fixes: ba44f8182ec2 ("raw: use more conventional iterators")
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
    Link: https://lore.kernel.org/r/20220622032303.159394-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

raw: use more conventional iterators [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri Jun 17 20:47:04 2022 -0700

    raw: use more conventional iterators
    
    [ Upstream commit ba44f8182ec299c5d1c8a72fc0fde4ec127b5a6d ]
    
    In order to prepare the following patch,
    I change raw v4 & v6 code to use more conventional
    iterators.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 440e274da4d1 ("net: ipv6: fix dif and sdif mismatch in raw6_icmp_error")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
rbd: Reset positive result codes to zero in object map update path [+ + +]
Author: Raphael Zimmer <raphael.zimmer@tu-ilmenau.de>
Date:   Thu Jul 9 13:26:20 2026 +0200

    rbd: Reset positive result codes to zero in object map update path
    
    commit a6c4250b81bd30beae94e1b7a4b26fa1193ad2e4 upstream.
    
    In a reply message to an RBD request, a positive result code indicates
    a data payload, which is not allowed for writes. While
    rbd_osd_req_callback() already resets a positive result code for writes
    to zero, rbd_object_map_callback() does not. This allows a corrupted
    reply to an object map update to trigger the rbd_assert(*result < 0) in
    __rbd_obj_handle_request(). This happens, because
    rbd_object_map_callback() calls rbd_obj_handle_request() ->
    __rbd_obj_handle_request() and passes this positive result code. From
    __rbd_obj_handle_request(), rbd_obj_advance_write() is called, which
    leaves the positive result code unchanged and returns true. Therefore,
    the if(done && *result) branch is executed in __rbd_obj_handle_request()
    and the assertion triggers.
    
    This patch fixes the issue by adjusting the logic in the
    rbd_object_map_callback() path. A positive result code for an object map
    update is now reset to zero (similar to rbd_osd_req_callback()), and the
    message is subsequently handled the same way as if the result code was
    zero from the beginning. Additionally, a WARN_ON_ONCE() is added for
    this case.
    
    Cc: stable@vger.kernel.org
    Fixes: 22e8bd51bb04 ("rbd: support for object-map and fast-diff")
    Signed-off-by: Raphael Zimmer <raphael.zimmer@tu-ilmenau.de>
    Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
RDMA/hns: Fix potential integer overflow in mhop hem cleanup [+ + +]
Author: Danila Chernetsov <listdansp@mail.ru>
Date:   Sat Jun 27 09:59:51 2026 +0000

    RDMA/hns: Fix potential integer overflow in mhop hem cleanup
    
    [ Upstream commit 9f0f2d2121f16d420199a82ac5bbc242269133b3 ]
    
    In hns_roce_cleanup_mhop_hem_table(), the expression:
    
        obj = i * buf_chunk_size / table->obj_size;
    
    is evaluated using 32-bit unsigned arithmetic because
    'buf_chunk_size' is u32 and the usual arithmetic conversions convert
    'i' to unsigned int. The result is assigned to a u64 variable, but the
    multiplication may overflow before the assignment.
    
    For sufficiently large HEM tables, this produces an incorrect object
    index passed to hns_roce_table_mhop_put().
    
    Cast 'i' to u64 before the multiplication so that the intermediate
    calculation is performed with 64-bit arithmetic.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: a25d13cbe816 ("RDMA/hns: Add the interfaces to support multi hop addressing for the contexts in hip08")
    Link: https://patch.msgid.link/r/20260627095951.51378-1-listdansp@mail.ru
    Signed-off-by: Danila Chernetsov <listdansp@mail.ru>
    Reviewed-by: Junxian Huang <huangjunxian6@hisilicon.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
RDMA/irdma: Prevent overflows in memory contiguity checks [+ + +]
Author: Aleksandrova Alyona <aga@itb.spb.ru>
Date:   Wed Jun 24 17:48:46 2026 +0300

    RDMA/irdma: Prevent overflows in memory contiguity checks
    
    [ Upstream commit 3cda0dfe8c651dcbb9e38977905d3d3b1750c4ab ]
    
    irdma_check_mem_contiguous() and irdma_check_mr_contiguous() verify that
    PBL entries describe physically contiguous memory ranges.
    
    Both functions calculate byte offsets using 32-bit operands. For example,
    with 4 KiB pages, pg_size * pg_idx overflows 32-bit arithmetic when
    pg_idx reaches 1048576. In the level-2 check, PBLE_PER_PAGE is 512, so
    i * pg_size * PBLE_PER_PAGE overflows when i reaches 2048.
    
    These values are reachable in the driver. For MRs, palloc->total_cnt
    comes from iwmr->page_cnt, which is calculated by
    ib_umem_num_dma_blocks(). The MR size is limited by IRDMA_MAX_MR_SIZE,
    so a 4 GiB MR with 4 KiB pages can reach page_cnt of 1048576. PBLE
    resources do not exclude this value either: for gen3, the limit is based
    on avail_sds * MAX_PBLE_PER_SD, and MAX_PBLE_PER_SD is 0x40000, so 4 SDs
    are enough for 1048576 PBLEs.
    
    Cast one operand to u64 before the multiplications so that the offset
    calculations are performed in 64-bit arithmetic.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
    Signed-off-by: Aleksandrova Alyona <aga@itb.spb.ru>
    Link: https://patch.msgid.link/20260624144846.61242-1-aga@itb.spb.ru
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
RDMA/rxe: Fix a use-after-free problem in rxe_mmap [+ + +]
Author: Zhu Yanjun <yanjun.zhu@linux.dev>
Date:   Fri Aug 14 13:23:59 2026 -0700

    RDMA/rxe: Fix a use-after-free problem in rxe_mmap
    
    [ Upstream commit 35744ab3d03c5fca8c1752f53fc8fc674e14c561 ]
    
    rxe_mmap() removes a rxe_mmap_info struct from the pending_mmaps list
    and releases pending_lock while the struct's kref is still at 1:
    
       list_del_init(&ip->pending_mmaps);
       spin_unlock_bh(&rxe->pending_lock);   /* ref == 1, no lock held */
       ret = remap_vmalloc_range(vma, ip->obj, 0);  /* walks PTEs */
       [...]
       rxe_vma_open(vma);                    /* kref_get, ref → 2 */
       remap_vmalloc_range_partial() walks PTEs without any lock.
    
    A concurrent DESTROY_CQ ioctl on another CPU calls:
    
        kref_put(&q->ip->ref, rxe_mmap_release)   /* ref 1→0 */
        vfree(ip->obj)   /* clears vmalloc PTEs mid-walk */
        kfree(ip)        /* frees rxe_mmap_info */
    
    This yields:
    
       1. Kernel crash, vmalloc_to_page() returns NULL when vfree wins the
       per-PTE race -> vm_insert_page(NULL) → GPF in validate_page_before_insert
    
       2. Page UAF, vmalloc_to_page() reads a stale PTE before vfree clears
       it. User VMA holds a PTE to a free'd page which might eventually get
       reallocated later by vmalloc which allows the attacker to get a clean
       page-level UAF.
    
       It is worth noting that even though a page-level UAF is possible given
       the strong primitive, it is statistically very difficult to achieve
       given the very short time window (after the last insert_page and before
       the kref_get).
    
    The call trace are as below:
    
      Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
      KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
      CPU: 0 UID: 1000 PID: 413 Comm: poc Not tainted 7.0.0-rc5-dirty #28 PREEMPT(lazy)
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
      RIP: 0010:validate_page_before_insert+0x32/0x300
      Code: e5 41 57 41 56 49 89 fe 41 55 41 54 53 48 89 f3 e8 93 b5 a3 ff 48 8d 7b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 7b 02 00 00 4c 8b 63 08 31 ff 4d 89 e5 41 83 e5
      RSP: 0018:ffff88811b15f2f0 EFLAGS: 00000202
      RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000008
      RBP: ffff88811b15f318 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffff8881181eee00
      R13: 0000000000000000 R14: ffff8881181eee00 R15: ffff8881181eee20
      FS:  00007b1e000f76c0(0000) GS:ffff8884268e0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007b1e00a24ac0 CR3: 0000000116eb3000 CR4: 00000000000006f0
      Call Trace:
       <TASK>
       insert_page+0x8f/0x190
       ? __pfx_insert_page+0x10/0x10
       ? kasan_save_alloc_info+0x38/0x60
       vm_insert_page+0x2e7/0x400
       remap_vmalloc_range_partial+0x212/0x3e0
       remap_vmalloc_range+0x6e/0xb0
       ? __kasan_check_write+0x14/0x30
       rxe_mmap+0x2e9/0x5d0
       ib_uverbs_mmap+0x1ad/0x2c0
       __mmap_region+0x12c2/0x2ad0
       ? __pfx___mmap_region+0x10/0x10
       ? __sanitizer_cov_trace_switch+0x58/0xb0
       ? mas_prev_slot+0x360/0x39c0
       ? __sanitizer_cov_trace_switch+0x58/0xb0
       ? mas_next_slot+0x1e5b/0x2f40
       ? __sanitizer_cov_trace_cmp8+0x18/0x30
       ? unmapped_area_topdown+0x4dd/0x610
       ? kfree+0x1b1/0x440
       ? free_cpumask_var+0x16/0x30
       ? __kasan_slab_free+0x7d/0xa0
       ? __sanitizer_cov_trace_cmp8+0x18/0x30
       mmap_region+0x2e6/0x3c0
       do_mmap+0xa3e/0x12a0
       ? __pfx_do_mmap+0x10/0x10
       ? __kasan_check_write+0x14/0x30
       ? down_write_killable+0xba/0x160
       ? __pfx_down_write_killable+0x10/0x10
       ? __sanitizer_cov_trace_cmp4+0x16/0x30
       vm_mmap_pgoff+0x2d4/0x4a0
       ? __pfx_vm_mmap_pgoff+0x10/0x10
       ? fget+0x1bf/0x270
       ksys_mmap_pgoff+0x40c/0x690
       ? __sanitizer_cov_trace_const_cmp4+0x16/0x30
       ? __pfx_ksys_mmap_pgoff+0x10/0x10
       ? __kasan_check_write+0x14/0x30
       ? _raw_spin_trylock+0xbb/0x130
       ? __pfx__raw_spin_trylock+0x10/0x10
       __x64_sys_mmap+0x135/0x1e0
       x64_sys_call+0x1c14/0x2790
       do_syscall_64+0xd2/0x1050
       ? rcu_core+0x352/0x7d0
       ? rcu_core_si+0xe/0x20
       ? handle_softirqs+0x1aa/0x650
       ? __sanitizer_cov_trace_cmp4+0x16/0x30
       ? fpregs_assert_state_consistent+0xe1/0x160
       ? irqentry_exit+0xb1/0x670
       entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    Link: https://patch.msgid.link/r/20260515002537.6209-1-yanjun.zhu@linux.dev
    Reported-and-tested-by: nasm <n4sm@protonmail.com>
    Suggested-by: nasm <n4sm@protonmail.com>
    Fixes: 8700e3e7c485 ("Soft RoCE driver")
    Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    (cherry picked from commit 35744ab3d03c5fca8c1752f53fc8fc674e14c561)
    [Harshit: Minor conflict resolution pr_err() vs rxe_dbg_dev() usage]
    Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
RDMA/siw: Only check attrs->cap.max_send_wr in siw_create_qp [+ + +]
Author: Guoqing Jiang <guoqing.jiang@linux.dev>
Date:   Mon Nov 13 19:57:24 2023 +0800

    RDMA/siw: Only check attrs->cap.max_send_wr in siw_create_qp
    
    [ Upstream commit 788bbf4c2fc6e0c35bae9ed5068f484272539d3e ]
    
    We can just check max_send_wr here given both max_send_wr and
    max_recv_wr are defined as u32 type, and we also need to ensure
    num_sqe (derived from max_send_wr) shouldn't be zero.
    
    Acked-by: Bernard Metzler <bmt@zurich.ibm.com>
    Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
    Link: https://lore.kernel.org/r/20231113115726.12762-16-guoqing.jiang@linux.dev
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Stable-dep-of: bb27fcc67c42 ("RDMA/siw: publish QP after initialization")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

RDMA/siw: publish QP after initialization [+ + +]
Author: Ruoyu Wang <ruoyuw560@gmail.com>
Date:   Tue Jun 30 14:00:40 2026 +0800

    RDMA/siw: publish QP after initialization
    
    [ Upstream commit bb27fcc67c429d97f785c92c35a6c5adebb05d7f ]
    
    siw_create_qp() currently calls siw_qp_add() before the queues, CQ
    pointers, state, completion, and device list entry are ready. A QPN
    lookup can therefore reach a QP that is still being constructed.
    
    Move siw_qp_add() to the end of siw_create_qp(), after QP
    initialization and before adding the QP to the siw device list.
    
    Fixes: f29dd55b0236 ("rdma/siw: queue pair methods")
    Link: https://patch.msgid.link/r/20260630060040.966461-1-ruoyuw560@gmail.com
    Suggested-by: Bernard Metzler <bernard.metzler@linux.dev>
    Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
    Acked-by: Bernard Metzler <bernard.metzler@linux.dev>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
rds: drop incoming messages that cross network namespace boundaries [+ + +]
Author: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
Date:   Tue Jul 7 19:43:14 2026 -0700

    rds: drop incoming messages that cross network namespace boundaries
    
    [ Upstream commit 5521ae71e32a8069ed4ca6e792179dc57bc43ab2 ]
    
    rds_find_bound() looks up the destination socket using a global
    rhashtable keyed solely on (addr, port, scope_id).  Network namespaces
    are not part of the key, so a sender in netns A can deliver an incoming
    message (inc) to a socket that lives in a different netns B.
    
    When this happens, inc->i_conn points to an rds_connection whose c_net
    is netns A, but the receiving rs lives in netns B.  Once the child
    process that created netns A exits, cleanup_net() calls
    rds_loop_exit_net() -> rds_loop_kill_conns() -> rds_conn_destroy(),
    freeing that connection.  If the survivor socket in netns B still holds
    the inc, any subsequent dereference of inc->i_conn is a use-after-free.
    
    There are two dangerous sites in rds_clear_recv_queue():
      1. inc->i_conn->c_lcong (offset 88 of freed rds_connection, size 200)
         read via rds_recv_rcvbuf_delta() -- confirmed by KASAN.
      2. inc->i_conn->c_trans->inc_free(inc) (function pointer at offset 80)
         called via rds_inc_put() when the inc refcount reaches zero -- same
         race window, potential call-through-freed-object primitive.
    
    The bug is reachable from unprivileged user namespaces
    (CLONE_NEWUSER + CLONE_NEWNET), available since Linux 3.8.
    
    Fix this by rejecting the delivery in rds_recv_incoming() when the
    socket returned by rds_find_bound() belongs to a different network
    namespace than the connection that carried the message.  Use the
    existing rds_conn_net() / sock_net() helpers and net_eq() for the
    comparison.
    
    Fixes: c809195f5523 ("rds: clean up loopback rds_connections on netns deletion")
    Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
    Reviewed-by: Allison Henderson <achender@kernel.org>
    Tested-by: Allison Henderson <achender@kernel.org>
    Signed-off-by: Allison Henderson <achender@kernel.org>
    Link: https://patch.msgid.link/20260708024314.601139-1-achender@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

rds: Fix inet6_addr_lst NULL dereference when IPv6 is disabled [+ + +]
Author: Ilia Gavrilov <Ilia.Gavrilov@infotecs.ru>
Date:   Thu Jul 9 16:27:54 2026 +0000

    rds: Fix inet6_addr_lst NULL dereference when IPv6 is disabled
    
    [ Upstream commit 9c805e592a29be9e4e61ff1bd567da04aa8fd6f9 ]
    
    When booting with the 'ipv6.disable=1' parameter, inet6_addr_lst
    is never initialized because inet6_init() exits before addrconf_init()
    is called to initialize it. An attempt to bind an RDS socket to
    an ipv6 address results in a crash in __ipv6_chk_addr_and_flags()
    
    KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
    RIP: 0010:__ipv6_chk_addr_and_flags+0x1df/0x7e0
    Call Trace:
     <TASK>
     ipv6_chk_addr+0x3b/0x50
     rds_tcp_laddr_check+0x155/0x3b0 [rds_tcp]
     rds_trans_get_preferred+0x15d/0x2d0 [rds]
     ? trace_hardirqs_on+0x2d/0x110
     rds_bind+0x1433/0x1d60 [rds]
     ? rds_remove_bound+0xd50/0xd50 [rds]
     ? aa_af_perm+0x250/0x250
     ? __might_fault+0xde/0x190
     ? __sys_bind+0x1dc/0x210
     __sys_bind+0x1dc/0x210
     ? __ia32_sys_socketpair+0x100/0x100
     ? restore_fpregs_from_fpstate+0x53/0x100
     __x64_sys_bind+0x73/0xb0
     ? syscall_enter_from_user_mode+0x1c/0x50
     do_syscall_64+0x34/0x80
     entry_SYSCALL_64_after_hwframe+0x6e/0xd8
    RIP: 0033:0x7f47f8269ea9
     </TASK>
    
    The following code reproduces the issue:
    
    struct sockaddr_in6 addr;
    s = socket(PF_RDS, SOCK_SEQPACKET, 0);
    
    memset(&addr, 0, sizeof(addr));
    inet_pton(AF_INET6, ADDRESS, &addr.sin6_addr);
    addr.sin6_family = AF_INET6;
    addr.sin6_port = htons(PORT);
    
    bind(s, &addr, sizeof(addr));
    
    Found by InfoTeCS on behalf of Linux Verification Center
    (linuxtesting.org) with Syzkaller.
    
    Fixes: eee2fa6ab322 ("rds: Changing IP address internal representation to struct in6_addr")
    Fixes: 1e2b44e78eea ("rds: Enable RDS IPv6 support")
    Signed-off-by: Ilia Gavrilov <Ilia.Gavrilov@infotecs.ru>
    Reviewed-by: Allison Henderson <achender@kernel.org>
    Link: https://patch.msgid.link/20260709162723.367523-1-Ilia.Gavrilov@infotecs.ru
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: 78f75d632f74 ("rds: tcp: hold the RCU lock across ipv6_chk_addr() in rds_tcp_laddr_check()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

rds: tcp: hold the RCU lock across ipv6_chk_addr() in rds_tcp_laddr_check() [+ + +]
Author: Xiang Mei <xmei5@asu.edu>
Date:   Wed Jul 22 14:02:03 2026 -0700

    rds: tcp: hold the RCU lock across ipv6_chk_addr() in rds_tcp_laddr_check()
    
    [ Upstream commit 78f75d632f74b8de0f081a128588f7c37d0d1164 ]
    
    rds_tcp_laddr_check() looks up a scoped IPv6 interface with
    dev_get_by_index_rcu(), drops the RCU read-side lock, and only then
    passes the bare struct net_device * into ipv6_chk_addr().
    
    dev_get_by_index_rcu() only keeps the device alive within the same RCU
    read-side section. After rcu_read_unlock(), a concurrent RTM_DELLINK can
    free the net_device; ipv6_chk_addr() then dereferences the stale pointer
    in __ipv6_chk_addr_and_flags() (e.g. l3mdev_master_dev_rcu(dev)), reading
    freed memory.
    
    Keep the RCU read-side lock held across the ipv6_chk_addr() call instead
    of dropping it right after the lookup, so the device cannot be freed
    while it is in use.
    
      BUG: KASAN: slab-use-after-free in __ipv6_chk_addr_and_flags (... net/ipv6/addrconf.c:1998)
      Read of size 8 at addr ffff8880106ec000 by task exploit/153
      Call Trace:
       ...
       kasan_report (mm/kasan/report.c:595)
       __ipv6_chk_addr_and_flags (... net/ipv6/addrconf.c:1998)
       ipv6_chk_addr (net/ipv6/addrconf.c:2031 net/ipv6/addrconf.c:1972)
       rds_tcp_laddr_check (net/rds/tcp.c:370)
       rds_bind (net/rds/bind.c:248)
       __sys_bind (net/socket.c:1920)
       __x64_sys_bind (net/socket.c:1956)
       do_syscall_64 (arch/x86/entry/syscall_64.c:63)
       entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
    
    Fixes: eee2fa6ab322 ("rds: Changing IP address internal representation to struct in6_addr")
    Reported-by: Weiming Shi <bestswngs@gmail.com>
    Signed-off-by: Xiang Mei <xmei5@asu.edu>
    Reviewed-by: Allison Henderson <achender@kernel.org>
    Link: https://patch.msgid.link/20260722210203.565803-1-xmei5@asu.edu
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates" [+ + +]
Author: Will Deacon <will@kernel.org>
Date:   Fri Jul 17 17:25:58 2026 +0100

    Revert "arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates"
    
    commit 26b483d52417253d88a3a01262ac85914a7aec8e upstream.
    
    This reverts commit e057b94772328221405b067c3a85fe479b915dc8.
    
    Sashiko points out that updating 'orig_x0' after secure_computing()
    has returned is too late to handle the case where a seccomp filter is
    re-evaluated after initially returning SECCOMP_RET_TRACE. This means
    that a tracer can manipulate the first argument of the syscall behind
    seccomp's back.
    
    For now, revert the initial fix and we'll have another crack at it soon.
    Since the incorrect fix was cc'd to stable, do the same here with an
    appropriate fixes tag.
    
    Cc: stable@vger.kernel.org
    Fixes: e057b9477232 ("arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates")
    Link: https://sashiko.dev/#/patchset/20260716120640.6590-1-will@kernel.org
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Revert "drm/amd/display: Add missing kdoc for ALLM parameters" [+ + +]
Author: Sasha Levin <sashal@kernel.org>
Date:   Mon Jul 27 15:59:57 2026 -0400

    Revert "drm/amd/display: Add missing kdoc for ALLM parameters"
    
    This reverts commit 904eed5c1044b52db948e0322a5f74ccaccd0b8e.
    
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "thermal/drivers/hwmon: Cleanup coding style a bit" [+ + +]
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Tue Aug 4 22:09:10 2026 +0200

    Revert "thermal/drivers/hwmon: Cleanup coding style a bit"
    
    commit ff8da20b6f47c48d46e47f93f7a59e2d56ee9107 upstream.
    
    Revert commit 030a48b0f6ce ("thermal/drivers/hwmon: Cleanup coding style
    a bit") that introduced a use-after-free into the error path of
    thermal_add_hwmon_sysfs() by removing a valid check from it.
    
    Link: https://lore.kernel.org/linux-hwmon/20260803183915.4ED7D1F000E9@smtp.kernel.org/
    Cc: All applicable <stable@vger.kernel.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
    Link: https://patch.msgid.link/5123895.31r3eYUQgx@rafael.j.wysocki
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
rhashtable: clear stale iter->p on table restart [+ + +]
Author: Cen Zhang (Microsoft) <blbllhy@gmail.com>
Date:   Tue Jul 7 12:41:15 2026 -0400

    rhashtable: clear stale iter->p on table restart
    
    [ Upstream commit 8173f7e2ce67e6ca1d4763f3da14e5b01ce77456 ]
    
    rhashtable_walk_start_check() has two restart paths when resuming a walk.
    When iter->walker.tbl is valid, it re-validates iter->p against the table
    and sets iter->p = NULL if the object is gone.  When iter->walker.tbl is
    NULL (table was freed during resize), it resets slot and skip but forgets
    to clear iter->p.
    
    rhashtable_walk_next() then dereferences the stale iter->p, reading
    freed memory.  This is a use-after-free.
    
    Any caller that does multi-fragment rhashtable walks across
    walk_stop/walk_start boundaries is affected.  Concrete cases include
    netlink_diag (__netlink_diag_dump in net/netlink/diag.c) and TIPC
    (tipc_nl_sk_walk in net/tipc/socket.c).
    
    Crash stack (netlink_diag):
      BUG: KASAN: slab-use-after-free in rhashtable_walk_next+0x365/0x3c0
      Read of size 8 at addr ffff88801a9d2438 (freed kmalloc-2k, offset 1080)
      Call Trace:
       rhashtable_walk_next+0x365/0x3c0 (lib/rhashtable.c:1016)
       __netlink_diag_dump+0x160/0x760 (net/netlink/diag.c:122)
       netlink_diag_dump+0xc2/0x240
       netlink_dump+0x5bc/0x1270
       netlink_recvmsg+0x7a3/0x980
       sock_recvmsg+0x1bc/0x200
       __sys_recvfrom+0x1d4/0x2c0
    
    Fixes: 5d240a8936f6 ("rhashtable: improve rhashtable_walk stability when stop/start used.")
    Cc: <stable@vger.kernel.org>
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Closes: https://lore.kernel.org/linux-crypto/CAB8m9Wh559e+=n8z51gB8DrbEyCc2mc0MgGjrRR6_VXBmU=2AQ@mail.gmail.com
    Signed-off-by: Cen Zhang (Microsoft) <blbllhy@gmail.com>
    Reviewed-by: NeilBrown <neil@brown.name>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
s390/dasd: Fix potential NULL pointer dereference [+ + +]
Author: Jan Höppner <hoeppner@linux.ibm.com>
Date:   Mon Jul 27 16:28:39 2026 +0200

    s390/dasd: Fix potential NULL pointer dereference
    
    commit 9973026f572db6b67570cadc30942f3014e41079 upstream.
    
    dasd_release_space() checks the implementation of the is_ese()
    discipline function before calling it to determine if a given device is
    an ESE DASD.
    
    The current usage of the logical AND operator will lead to a NULL
    pointer dereference as the function is called even if the function
    pointer is NULL.
    
    Fix this by using the logical OR operator.
    
    Fixes: 91dc4a197569 ("s390/dasd: Add new ioctl to release space")
    Cc: stable@vger.kernel.org # v5.3+
    Reported-by: Vasily Gorbik <gor@linux.ibm.com>
    Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
    Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
    Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
    Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
    Link: https://patch.msgid.link/20260727142840.567286-3-sth@linux.ibm.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
s390/qeth: Check CAP_NET_ADMIN for private ioctls [+ + +]
Author: Aswin Karuvally <aswin@linux.ibm.com>
Date:   Thu Jul 23 16:00:50 2026 +0200

    s390/qeth: Check CAP_NET_ADMIN for private ioctls
    
    commit d211028bac1bd0fff0026bfa2a8328e5b78cd0e6 upstream.
    
    Gate the SIOCDEVPRIVATE ioctl commands SIOC_QETH_ADP_SET_SNMP_CONTROL,
    SIOC_QETH_GET_CARD_TYPE and SIOC_QETH_QUERY_OAT with CAP_NET_ADMIN
    capable check to ensure unprivileged users cannot invoke them.
    
    Fixes: 18787eeebd71 ("qeth: use ndo_siocdevprivate")
    Cc: stable@vger.kernel.org
    Suggested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
    Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
    Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
    Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
    Link: https://patch.msgid.link/20260723140050.762991-1-aswin@linux.ibm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
s390/zcrypt: Fix missing mem scrub at clear key import in cca_clr2cipherkey() [+ + +]
Author: Harald Freudenberger <freude@linux.ibm.com>
Date:   Mon Aug 10 15:40:12 2026 +0200

    s390/zcrypt: Fix missing mem scrub at clear key import in cca_clr2cipherkey()
    
    [ Upstream commit 01476391aecef36a3b789ee844357b22fbc90665 ]
    
    The helper function _ip_cprb_helper() uses internal buffer memory for
    building and processing CPRBs. After use this buffer was never
    scrubbed which could lead to leaving for example clear key material in
    memory which could be exposed via tricky reuse of this same memory.
    
    Extend the _ip_cprb_helper() function with another parameter 'scrub'
    used to steer scrubbing of this buffer. So now the caller has the
    opportunity to decide if scrubbing is needed or not.
    
    Extend the clear key to secure key token import process in function
    cca_clr2cipherkey() to tell the helper function from above to scrub
    the cprb buffer when the clear key value is part of the request data.
    
    Add explicit scrubbing on return from function cca_clr2cipherkey() for
    the random EXOR buffer and the cprb buffer.
    
    Overall this cleans the internal used buffer in case of clear key
    import to prevent sensitive data to get exposed.
    
    Fixes: 4bc123b18ce6 ("s390/zcrypt: Add low level functions for CCA AES cipher keys")
    Cc: stable@vger.kernel.org
    Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
    Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

s390/zcrypt: Validate length for CCA AES cipher key requests [+ + +]
Author: Holger Dengler <dengler@linux.ibm.com>
Date:   Wed Jul 29 11:36:15 2026 +0200

    s390/zcrypt: Validate length for CCA AES cipher key requests
    
    commit 06afe425d5283b9764303de47f554da5a808ce8a upstream.
    
    cca_cipher2protkey() derives the copy length for the CPRB parameter
    block directly from the length field in the key token. Reject the
    request early if the token length exceeds the available space in the
    parameter block.
    
    Fixes: 4bc123b18ce6 ("s390/zcrypt: Add low level functions for CCA AES cipher keys")
    Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
    Cc: stable@vger.kernel.org # 5.4+
    Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

s390/zcrypt: Validate length for CCA ECC private key requests [+ + +]
Author: Holger Dengler <dengler@linux.ibm.com>
Date:   Wed Jul 29 11:36:16 2026 +0200

    s390/zcrypt: Validate length for CCA ECC private key requests
    
    commit a9ae0f6dd45c3ccc1d69363f7aea8af179122730 upstream.
    
    cca_ecc2protkey() derives the copy length for the CPRB parameter
    block directly from the length field in the key token. Reject the
    request early if the token length exceeds the available space in the
    parameter block.
    
    Fixes: fa6999e326fe ("s390/pkey: support CCA and EP11 secure ECC private keys")
    Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
    Cc: stable@vger.kernel.org # 5.10+
    Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
sched/vtime: Get rid of generic vtime_task_switch() implementation [+ + +]
Author: Alexander Gordeev <agordeev@linux.ibm.com>
Date:   Wed Apr 10 17:09:45 2024 +0200

    sched/vtime: Get rid of generic vtime_task_switch() implementation
    
    [ Upstream commit 89d6910cc562ab34d1f1c08f3cf0a9700b8bf2c4 ]
    
    The generic vtime_task_switch() implementation gets built only
    if __ARCH_HAS_VTIME_TASK_SWITCH is not defined, but requires an
    architecture to implement arch_vtime_task_switch() callback at
    the same time, which is confusing.
    
    Further, arch_vtime_task_switch() is implemented for 32-bit PowerPC
    architecture only and vtime_task_switch() generic variant is rather
    superfluous.
    
    Simplify the whole vtime_task_switch() wiring by moving the existing
    generic implementation to PowerPC.
    
    Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
    Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
    Acked-by: Michael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/2cb6e3caada93623f6d4f78ad938ac6cd0e2fda8.1712760275.git.agordeev@linux.ibm.com
    Stable-dep-of: c1c1ffa490fc ("powerpc/vtime: Initialize starttime at boot for native accounting")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
scsi: libiscsi: Fix stale-data leak into the SCSI sense buffer [+ + +]
Author: HyeongJun An <sammiee5311@gmail.com>
Date:   Tue Jul 14 19:49:34 2026 +0900

    scsi: libiscsi: Fix stale-data leak into the SCSI sense buffer
    
    [ Upstream commit 98b87885de4b7f605533a2860685f5689fce8e82 ]
    
    iscsi_scsi_cmd_rsp() copies the sense data of a SCSI Response from the
    target-supplied data segment.  The segment carries a 2-byte sense length
    followed by the sense bytes, so it must hold 2 + senselen bytes, but the
    bounds check only requires datalen >= senselen:
    
            senselen = get_unaligned_be16(data);
            if (datalen < senselen)
                    goto invalid_datalen;
            memcpy(sc->sense_buffer, data + 2,
                   min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE));
    
    A target that returns a SCSI Response whose datalen equals senselen
    (with senselen <= SCSI_SENSE_BUFFERSIZE) makes the memcpy() from data +
    2 read up to two bytes past the received data.  Those bytes are stale
    conn->data contents and end up in the command's sense buffer, which is
    returned to userspace.
    
    Account for the 2-byte sense length prefix in the check.
    
    Fixes: 7996a778ff8c ("[SCSI] iscsi: add libiscsi")
    Suggested-by: Sashiko AI <sashiko-bot@kernel.org>
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
    Acked-by: Chris Leech <cleech@redhat.com>
    Link: https://patch.msgid.link/20260714104934.1404423-1-sammiee5311@gmail.com
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

scsi: libiscsi_tcp: Bound SCSI Response data segment to the connection buffer [+ + +]
Author: HyeongJun An <sammiee5311@gmail.com>
Date:   Thu Jul 16 15:58:48 2026 +0900

    scsi: libiscsi_tcp: Bound SCSI Response data segment to the connection buffer
    
    [ Upstream commit c1dea15f819cded9b3faf58f8bec72323568b6e6 ]
    
    iscsi_tcp_hdr_dissect() receives the data segment of several PDU types
    into the fixed-size conn->data buffer, which is allocated for
    ISCSI_DEF_MAX_RECV_SEG_LEN (8192) bytes.  For the LOGIN_RSP, TEXT_RSP,
    REJECT and ASYNC_EVENT opcodes the dissect path already rejects a PDU
    whose DataSegmentLength exceeds that buffer.
    
    The SCSI Command Response (ISCSI_OP_SCSI_CMD_RSP) path also copies its
    data segment (sense/response data) into conn->data via
    iscsi_tcp_data_recv_prep(), but it does so without the same check.  The
    only upstream bound on in.datalen is conn->max_recv_dlength, the
    initiator's advertised MaxRecvDataSegmentLength, which is commonly
    negotiated well above 8192 (open-iscsi defaults to 262144).  A target
    that returns a SCSI Response with a DataSegmentLength between 8193 and
    max_recv_dlength therefore overflows the 8192-byte conn->data buffer.
    
    Once the same bound applies, ISCSI_OP_SCSI_CMD_RSP is handled exactly
    like those responses: bound the data segment, receive it into conn->data
    when present, and otherwise complete the PDU with no data.  Fold the
    opcode into that case group rather than duplicating the check.
    
    Fixes: a081c13e39b5 ("[SCSI] iscsi_tcp: split module into lib and lld")
    Suggested-by: Chris Leech <cleech@redhat.com>
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
    Acked-by: Chris Leech <cleech@redhat.com>
    Link: https://patch.msgid.link/20260716065848.1653431-1-sammiee5311@gmail.com
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

scsi: scsi_debug: Negate wrapped memcmp() result [+ + +]
Author: Xu Rao <raoxu@uniontech.com>
Date:   Mon Aug 3 17:53:28 2026 +0800

    scsi: scsi_debug: Negate wrapped memcmp() result
    
    commit c4f6916a99cf105c3ff340b6210fcbba3fa66b35 upstream.
    
    comp_write_worker() returns true when the compared data matches.
    memcmp() returns zero for equal data and non-zero for different data, so
    its result must be negated before it is stored in a bool.
    
    The first segment already uses !memcmp(), but the wrapped segment uses
    memcmp() directly, reversing the match result. Use !memcmp() there as
    well.
    
    Fixes: 38d5c8336e60 ("scsi_debug: add Report supported opcodes+tmfs; Compare and write")
    Cc: stable@vger.kernel.org
    Signed-off-by: Xu Rao <raoxu@uniontech.com>
    Reviewed-by: John Garry <john.g.garry@oracle.com>
    Link: https://patch.msgid.link/E5AD42E9C0E18633+20260803095328.3445311-1-raoxu@uniontech.com
    Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

scsi: zfcp: Fix memory leak during adapter release by destroying gid_pn_req [+ + +]
Author: Benjamin Block <bblock@linux.ibm.com>
Date:   Mon Jul 20 09:27:36 2026 +0200

    scsi: zfcp: Fix memory leak during adapter release by destroying gid_pn_req
    
    [ Upstream commit b601fa590e667bd9643feed8c869b6b3e418480d ]
    
    When releasing an adapter we don't free the mempool 'gid_pn_req' that is
    allocated during the enqueue. This leaks memory:
    
      unreferenced object 0xd8d29297de700 (size 256):
        comm "(udev-worker)", pid 2105, jiffies 4294945794
        hex dump (first 32 bytes):
          00 00 00 00 de ad 4e ad ff ff ff ff 00 00 00 00  ......N.........
          ff ff ff ff ff ff ff ff 00 0d c4 5f 67 9d 99 e0  ..........._g...
        backtrace (crc 4a5b5da2):
          [<000dc45f64da418c>] kmemleak_alloc+0x6c/0xa0
          [<000dc45f62b430aa>] __kmalloc_cache_node_noprof+0x36a/0x4d0
          [<000dc45f629a535a>] mempool_create_node_noprof+0xaa/0x150
          [<000dc45ee2c065e6>] zfcp_allocate_low_mem_buffers+0x96/0x370 [zfcp]
          [<000dc45ee2c070f8>] zfcp_adapter_enqueue+0x598/0xd40 [zfcp]
          [<000dc45ee2c08eb0>] zfcp_ccw_set_online+0x160/0x210 [zfcp]
          [<000dc45f643d4762>] ccw_device_set_online+0x232/0xd80
          [<000dc45f643d53d4>] online_store_recog_and_online+0x124/0x390
          [<000dc45f643d8238>] online_store+0x298/0x5b0
          [<000dc45f62eb0a04>] kernfs_fop_write_iter+0x2c4/0x480
          [<000dc45f62c81150>] new_sync_write+0x370/0x4b0
          [<000dc45f62c87abe>] vfs_write+0x43e/0x5b0
          [<000dc45f62c87ff4>] ksys_write+0x114/0x1f0
          [<000dc45f621c4a16>] do_syscall+0x2f6/0x430
          [<000dc45f64d9d5d8>] __do_syscall+0xc8/0x1c0
          [<000dc45f64dc2224>] system_call+0x74/0xa0
    
    Fix this by destroying the mempool during the adapter's release.
    
    Fixes: 799b76d09aee ("[SCSI] zfcp: Decouple gid_pn requests from erp")
    Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
    Tested-by: M Nikhil <nikh1092@linux.ibm.com>
    Acked-by: M Nikhil <nikh1092@linux.ibm.com>
    Reviewed-by: Chinmaya Kajagar <chinmayk@linux.ibm.com>
    Reviewed-by: Nihar Panda <niharp@linux.ibm.com>
    Link: https://patch.msgid.link/20260720072736.3381816-2-niharp@linux.ibm.com
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
sctp: auth: verify auth requirement when auth_chunk is NULL [+ + +]
Author: Qing Luo <luoqing@kylinos.cn>
Date:   Tue Jul 21 09:55:32 2026 +0800

    sctp: auth: verify auth requirement when auth_chunk is NULL
    
    [ Upstream commit 8e04823c120b376ef7dab14b60ebf6823aa16c14 ]
    
    sctp_auth_chunk_verify() returns true unconditionally when
    chunk->auth_chunk is NULL, silently skipping authentication.
    This is incorrect when:
    
    1. skb_clone() failed in the BH receive path, leaving auth_chunk
       NULL. In sctp_endpoint_bh_rcv() asoc is NULL for new
       connections, so the early sctp_auth_recv_cid() check cannot
       catch this.
    
    2. No AUTH chunk precedes COOKIE-ECHO, so skb_clone() is never
       called and auth_chunk remains NULL.
    
    Fix by checking sctp_auth_recv_cid() when auth_chunk is NULL:
    if authentication is required, return false to drop the chunk;
    otherwise continue normally.
    
    Fixes: bbd0d59809f9 ("[SCTP]: Implement the receive and verification of AUTH chunk")
    Signed-off-by: Qing Luo <luoqing@kylinos.cn>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260721015532.120157-2-l1138897701@163.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: clear control chunk transport if it is being removed [+ + +]
Author: Xin Long <lucien.xin@gmail.com>
Date:   Wed Aug 5 11:18:40 2026 -0400

    sctp: clear control chunk transport if it is being removed
    
    [ Upstream commit c9158ceaf27780ef64534ad72f44ffde3f8ccc49 ]
    
    sctp_make_heartbeat_ack() caches the destination transport in
    chunk->transport without taking a reference. When src_out_of_asoc_ok is
    enabled, the HEARTBEAT ACK may remain queued on control_chunk_list instead
    of being transmitted immediately.
    
    If the peer transport is removed while the chunk is still queued,
    sctp_assoc_rm_peer() drops the transport and schedules it for RCU freeing,
    but only clears cached transport pointers in out_chunk_list.  The queued
    control chunk therefore retains a dangling transport pointer.
    
    Once an ASCONF_ACK clears the suppression and the queued control chunk is
    transmitted, SCTP dereferences the stale transport pointer, leading to a
    use-after-free.
    
    Fix this by also clearing chunk->transport for queued control chunks in
    control_chunk_list when removing the transport.
    
    Fixes: 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host")
    Reported-by: Daniele Linguaglossa <danielelinguaglossa@gmail.com>
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/7e1168cb722132152a29d47e5eafaeac4a3bf6f3.1785943120.git.lucien.xin@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: clear new_transport when removing a peer [+ + +]
Author: Qing Ming <a0yami@mailbox.org>
Date:   Tue Aug 11 23:28:03 2026 +0800

    sctp: clear new_transport when removing a peer
    
    commit beb33f8ee1ca83acddb2a5ae80f3d22ec550b4c3 upstream.
    
    sctp_process_asconf_param() stores a newly added peer transport in
    asoc->new_transport. After all parameters in the ASCONF chunk have been
    processed, sctp_sf_do_asconf() uses this pointer to send a HEARTBEAT to the
    new transport.
    
    An authenticated ASCONF from a remote SCTP peer can add a transport and
    remove it again with a wildcard DEL-IP parameter in the same chunk. The
    wildcard deletion preserves the transport on which the ASCONF arrived, but
    removes the newly added transport through
    sctp_assoc_del_nonprimary_peers(). The removal does not clear
    asoc->new_transport, leaving it pointing to the removed transport.
    
    sctp_sf_do_asconf() then creates a HEARTBEAT whose chunk->transport points
    to the removed transport without holding a transport reference. During
    local address replacement, src_out_of_asoc_ok keeps this HEARTBEAT on
    control_chunk_list. After the transport is freed by RCU, a successful
    ASCONF_ACK for the replacement address releases the queued HEARTBEAT and
    sctp_outq_select_transport() reads the freed transport's state.
    
    The issue was found during a static audit of SCTP objects. With an
    authenticated peer, the reproducer triggered the same KASAN report in 2
    of 2 unpatched runs on a KASAN-enabled netdev/main kernel:
    
      BUG: KASAN: slab-use-after-free in sctp_outq_select_transport
      Read of size 4 at addr ffff88800b9bd95c by task python3/197
    
      Call Trace:
       sctp_outq_select_transport+0x549/0x8b0 [sctp]
       sctp_outq_flush+0x306/0x2c60 [sctp]
       sctp_transport_immediate_rtx+0xaf/0x260 [sctp]
       sctp_process_asconf_ack+0xa48/0xf70 [sctp]
    
      Allocated by task 197:
       sctp_transport_new+0x68/0x650 [sctp]
       sctp_assoc_add_peer+0x258/0x12a0 [sctp]
       sctp_process_asconf+0x5e9/0x1090 [sctp]
    
      Last potentially related work creation:
       __call_rcu_common.constprop.0+0x77/0xb70
       sctp_assoc_del_nonprimary_peers+0x7c/0xd0 [sctp]
       sctp_process_asconf+0xd9c/0x1090 [sctp]
    
    The first invalid access was a four-byte read of transport->state at
    net/sctp/outqueue.c:833. The same reproducer completed the full
    authenticated ASCONF and local-address replacement sequence with this
    change without a KASAN report or oops.
    
    Clear new_transport when its peer is removed, before it can be used to
    create the HEARTBEAT.
    
    Fixes: 6af29ccc223b ("sctp: Bundle HEAERTBEAT into ASCONF_ACK")
    Cc: stable@vger.kernel.org
    Signed-off-by: Qing Ming <a0yami@mailbox.org>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260811152803.5629-1-a0yami@mailbox.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: don't free the ASCONF's own transport in DEL-IP processing [+ + +]
Author: Jun Yang <junvyyang@tencent.com>
Date:   Tue Jul 21 21:14:05 2026 +0800

    sctp: don't free the ASCONF's own transport in DEL-IP processing
    
    commit 9b2854f86f0b56e9027d68e7a3fc909d1a9b566f upstream.
    
    sctp_process_asconf() caches the transport the ASCONF chunk is processed
    against in asconf->transport (== chunk->transport, set once in sctp_rcv()).
    For an ASCONF located through its Address Parameter by
    __sctp_rcv_asconf_lookup(), that cached transport corresponds to the
    Address Parameter, which need not be the packet's source address.
    
    sctp_process_asconf_param() rejects a DEL-IP for the packet source address
    (ADDIP D8, SCTP_ERROR_DEL_SRC_IP), but nothing protects asconf->transport.
    A single ASCONF can therefore carry, in order:
    
        [Address Parameter L] [DEL-IP L] [DEL-IP 0.0.0.0]
    
    where L differs from the source. The DEL-IP for L passes the D8 check and
    calls sctp_assoc_rm_peer() on the transport that asconf->transport still
    points at, freeing it (RCU-deferred). The following wildcard DEL-IP then
    reuses the now-dangling asconf->transport in sctp_assoc_set_primary() and
    sctp_assoc_del_nonprimary_peers(): set_primary() dereferences the freed
    transport (->ipaddr, ->state) and plants the dangling pointer into
    asoc->peer.primary_path / active_path, and del_nonprimary_peers(), keeping
    only the pointer that is no longer on the list, removes every real
    transport, leaving the association with a transport_count of 0 and
    primary_path/active_path pointing at freed memory.
    
    Reject a DEL-IP that targets the transport the ASCONF is being processed
    against, mirroring the existing source-address guard, so the wildcard
    branch can never reuse a freed transport.
    
    Fixes: 42e30bf3463c ("[SCTP]: Handle the wildcard ADD-IP Address parameter")
    Cc: stable@kernel.org
    Signed-off-by: Jun Yang <junvyyang@tencent.com>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/tencent_73762ED1DF08CC9D5F5F61954B01350CFE0A@qq.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: fix addip_serial increment on ASCONF_ACK allocation failure [+ + +]
Author: Qing Luo <luoqing@kylinos.cn>
Date:   Tue Aug 4 10:55:14 2026 +0800

    sctp: fix addip_serial increment on ASCONF_ACK allocation failure
    
    [ Upstream commit aa2e13ae8d3cbe2c15ef4f7e971b2de0832794aa ]
    
    In sctp_process_asconf(), when sctp_make_asconf_ack() fails to allocate
    the ASCONF_ACK chunk due to memory pressure, the code jumps to the
    done label where asoc->peer.addip_serial is unconditionally incremented.
    
    This leaves the peer's ASCONF (serial N) unacknowledged while the local
    endpoint now expects serial N+1. When the peer retransmits serial N, it
    falls into the serial < addip_serial + 1 branch ,
    which attempts to look up a cached ACK for serial N. No cached ACK
    exists since the allocation failed, so the retransmission is silently
    discarded. The peer eventually times out and ABORTs the association.
    
    Move the addip_serial increment inside the if (asconf_ack) block so that
    the serial number is only advanced when the ASCONF_ACK is successfully
    created and cached. This way, on allocation failure, the serial number
    is unchanged and the peer's retransmitted ASCONF will be correctly
    re-processed.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Qing Luo <luoqing@kylinos.cn>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260804025514.241767-1-l1138897701@163.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: fix auth_chunk_list capacity check in sctp_auth_ep_add_chunkid [+ + +]
Author: HanQuan <eilaimemedsnaimel@gmail.com>
Date:   Mon Jul 13 03:20:21 2026 +0000

    sctp: fix auth_chunk_list capacity check in sctp_auth_ep_add_chunkid
    
    [ Upstream commit ff04b26794a16a8a879eb4fd2c02c2d6b03850e9 ]
    
    sctp_auth_ep_add_chunkid() uses SCTP_NUM_CHUNK_TYPES (20) as the
    capacity limit for ep->auth_chunk_list, allowing it to hold up to
    20 chunk entries (param_hdr.length up to 24). However, the copy
    destination asoc->c.auth_chunks in struct sctp_cookie is only
    SCTP_AUTH_MAX_CHUNKS (16) entries (20 bytes). When more than 16
    chunks are added, sctp_association_init() memcpy overflows the
    destination by up to 4 bytes.
    
    Fix by using SCTP_AUTH_MAX_CHUNKS as the capacity limit, matching
    the destination capacity.
    
    Fixes: 1f485649f529 ("[SCTP]: Implement SCTP-AUTH internals")
    Signed-off-by: HanQuan <eilaimemedsnaimel@gmail.com>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260713032021.3491702-1-zhoujian.zja@antgroup.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: fix auth_hmacs array size in struct sctp_cookie [+ + +]
Author: Xin Long <lucien.xin@gmail.com>
Date:   Fri Jul 10 14:12:35 2026 -0400

    sctp: fix auth_hmacs array size in struct sctp_cookie
    
    [ Upstream commit e0b5252a59383b77d1b8dbeda00b7184dd95f4d3 ]
    
    The auth_hmacs array in struct sctp_cookie is supposed to store a complete
    SCTP_AUTH_HMAC_ALGO parameter, which consists of a struct sctp_paramhdr
    followed by N HMAC identifiers.
    
    However, the array size was calculated using an extra 2 bytes instead of
    sizeof(struct sctp_paramhdr), which is 4 bytes. When four HMAC identifiers
    are configured, the HMAC-ALGO parameter stored in the endpoint is larger
    than the auth_hmacs buffer in the cookie.
    
    As a result, sctp_association_init() copies beyond the end of auth_hmacs
    when initializing the association, corrupting the adjacent auth_chunks
    field. This can lead to an invalid HMAC identifier being accepted and later
    cause an out-of-bounds read in sctp_auth_get_hmac().
    
    Fix the array size calculation by including the full SCTP parameter header
    size.
    
    Fixes: 1f485649f529 ("[SCTP]: Implement SCTP-AUTH internals")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Xin Liu <dstsmallbird@foxmail.com>
    Reported-by: Zihan Xi <xizh2024@lzu.edu.cn>
    Reported-by: Ren Wei <enjou1224z@gmail.com>
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/634a0de0d5de29532915e6d47c92a0cbc206e03f.1783707155.git.lucien.xin@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: fix use-after-free of cached ASCONF chunk [+ + +]
Author: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Date:   Sun Aug 9 12:38:06 2026 +0800

    sctp: fix use-after-free of cached ASCONF chunk
    
    commit 8c283e7b56adce00193837f3311b06662466fb21 upstream.
    
    addip_last_asconf caches the outstanding outbound ASCONF chunk. The normal
    ASCONF-ACK completion path releases the chunk and clears the pointer.
    
    However, sctp_asconf_queue_teardown() releases the cached chunk without
    clearing addip_last_asconf. During peer restart handling,
    sctp_sf_do_dupcook_a() queues SCTP_CMD_PURGE_ASCONF_QUEUE, which invokes
    sctp_asconf_queue_teardown() while the association remains alive and leaves
    the pointer dangling.
    
    A delayed authenticated ASCONF-ACK can then reach sctp_sf_do_asconf_ack(),
    which accesses the stale chunk and passes it to sctp_process_asconf_ack(),
    causing a use-after-free and a second release.
    
    Clearing the pointer exposes a race with T4 expiry. Peer restart handling
    queues the timer stop before the purge, but SCTP_CMD_TIMER_STOP uses
    timer_delete(), which does not wait for a callback already running on
    another CPU. Such a callback can reach sctp_sf_t4_timer_expire() after
    the purge and dereference NULL.
    
    Clear addip_last_asconf after releasing the cached chunk, and make
    sctp_sf_t4_timer_expire() consume a stale T4 expiry if no outstanding
    ASCONF remains.
    
    Fixes: a000c01e60e4 ("sctp: stop pending timers and purge queues when peer restart asoc")
    Cc: stable@vger.kernel.org
    Suggested-by: Xin Long <lucien.xin@gmail.com>
    Signed-off-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260809043806.2768302-1-yangyx22@mails.tsinghua.edu.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: keep chunk->transport in step with the list it is queued on [+ + +]
Author: Baul Lee <baul.lee@xbow.com>
Date:   Thu Jul 30 01:00:28 2026 +0900

    sctp: keep chunk->transport in step with the list it is queued on
    
    commit 9f2cf069a9a72a2d6b97ca8b4c70e714aac99749 upstream.
    
    __sctp_outq_flush_rtx() moves a gap-acked chunk onto another transport's
    transmitted list without updating chunk->transport:
    
            if (chunk->tsn_gap_acked) {
                    list_move_tail(&chunk->transmitted_list,
                                   &transport->transmitted);
                    continue;
            }
    
    The chunk then sits on a live transport's list while chunk->transport still
    names a different one.  If that transport is removed - sctp_assoc_rm_peer()
    from an ASCONF Delete-IP - sctp_transport_free() RCU-frees it and the chunk
    is left with a dangling pointer.  sctp_assoc_rm_peer() scrubs
    peer->transmitted and asoc->outqueue.out_chunk_list, but the chunk is on
    neither.
    
    The pointer is not followed while tsn_gap_acked is set.  A SACK that
    reneges on the TSN clears the flag, and the next SACK reaches
    
            tchunk->transport->flight_size -= sctp_data_size(tchunk);
    
    inside the freed transport.  KASAN reports a slab-use-after-free read in
    sctp_check_transmitted(), freed from sctp_assoc_rm_peer().  Both the
    removal and the SACKs come from the association peer.
    
    Set chunk->transport at the move.  The ordinary resend path needs nothing:
    it reaches its list_move_tail() only after sctp_packet_append_chunk()
    returned SCTP_XMIT_OK, and __sctp_packet_append_chunk() has rebound the
    chunk by then.
    
    Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Baul Lee <baul.lee@xbow.com>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260729160028.54546-1-baul.lee@xbow.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: prevent peer transport count overflow [+ + +]
Author: Asim Viladi Oglu Manizada <manizada@pm.me>
Date:   Sat Jul 25 03:21:06 2026 +0000

    sctp: prevent peer transport count overflow
    
    commit bd0e9289e2642f6a5c54faad304ce0f41e926d22 upstream.
    
    sctp_assoc_add_peer() increments the association's 16-bit transport_count
    for every new unique peer. Adding the 65,536th transport wraps the count to
    zero.
    
    SCTP sock_diag uses transport_count to reserve the INET_DIAG_PEERS payload,
    then copies one sockaddr_storage for every entry in transport_addr_list.
    After the wrap, a diagnostic dump reserves an empty payload and writes
    8 MiB of peer addresses past the skb tail.
    
    Reject a new unique peer when transport_count has reached U16_MAX. Perform
    the check after the existing-peer lookup so a duplicate address continues
    to return its existing transport at the limit.
    
    Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file")
    Cc: stable@vger.kernel.org
    Signed-off-by: Asim Viladi Oglu Manizada <manizada@pm.me>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260725032053.521705-1-manizada@pm.me
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: reject stale cookies with mismatched verification tags [+ + +]
Author: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Date:   Thu Jul 23 22:56:23 2026 +0000

    sctp: reject stale cookies with mismatched verification tags
    
    commit 9d8da8e0a9bce4a340af60dd0446bc7eb8d07587 upstream.
    
    sctp_unpack_cookie() skips cookie expiration checks whenever an
    association already exists.  This is broader than the exception in
    RFC 9260 Section 5.2.4.
    
    For an existing association, Section 5.2.4 permits an expired State
    Cookie only when both Verification Tags in the cookie match the current
    association.  Otherwise, the packet SHOULD be discarded and a Stale
    Cookie ERROR MUST be sent.
    
    The broad check lets an expired Action A restart cookie reach
    sctp_sf_do_dupcook_a().  In a runtime test with the default 60 second
    cookie lifetime, replaying such a cookie after 65 seconds returned a
    COOKIE-ACK and restarted the association.
    
    Check cookie expiration unless both Verification Tags match.  This
    preserves the Action D exception for a lost COOKIE ACK while rejecting
    expired cookies in all other cases.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260723225623.2658868-1-yangyx22@mails.tsinghua.edu.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: validate Adaptation Indication parameter length [+ + +]
Author: Charles Vosburgh <trilobyte777@gmail.com>
Date:   Mon Jul 27 19:17:30 2026 -0400

    sctp: validate Adaptation Indication parameter length
    
    commit 74b21f52c5c5a71a05c0ff70e513f4f04ff28b17 upstream.
    
    The Adaptation Layer Indication parameter contains a fixed 32-bit
    Adaptation Code Point after its parameter header. However,
    sctp_verify_param() accepts a header-only parameter because the generic
    parameter walker only requires the header to be present.
    
    sctp_process_param() then reads adaptation_ind beyond the declared
    parameter. When the malformed parameter is last in an INIT, the read
    starts at the receive skb tail, and the value is copied into the state
    cookie returned in the INIT ACK. This may disclose four receive-buffer
    tail bytes.
    
    Require the declared parameter length to match the fixed structure size
    and abort the association through the existing invalid parameter length
    path otherwise.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Charles Vosburgh <trilobyte777@gmail.com>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260727-sctp-adaptation-length-v1-1-0ab58b2810a5@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: validate stream count in sctp_process_strreset_inreq() [+ + +]
Author: Cen Zhang (Microsoft) <blbllhy@gmail.com>
Date:   Thu Jul 9 21:07:18 2026 -0400

    sctp: validate stream count in sctp_process_strreset_inreq()
    
    [ Upstream commit 18ae07691d43183d270de8be9dc8e027906015d9 ]
    
    When processing a RESET_IN_REQUEST from a peer,
    sctp_process_strreset_inreq() derives the stream count from the
    parameter length but does not check whether the resulting
    RESET_OUT_REQUEST would exceed SCTP_MAX_CHUNK_LEN.
    
    The OUT request header (sctp_strreset_outreq, 16 bytes) is 8 bytes
    larger than the IN request header (sctp_strreset_inreq, 8 bytes).
    Generally, the IP payload is bounded to 65535 bytes, so the stream
    list cannot be large enough to trigger the overflow. However, on
    interfaces with MTU > 65535 (e.g., loopback with IPv6 jumbograms), a
    stream list that fits within the incoming IN parameter can cause a
    __u16 overflow in sctp_make_strreset_req() when computing the OUT
    request size, leading to an undersized skb allocation and a kernel
    BUG:
    
      net/core/skbuff.c:207         skb_panic
      net/core/skbuff.c:2625        skb_put
      net/sctp/sm_make_chunk.c:1535 sctp_addto_chunk
      net/sctp/sm_make_chunk.c:3695 sctp_make_strreset_req
      net/sctp/stream.c:655         sctp_process_strreset_inreq
    
    The local setsockopt path validates the generated reset request size.
    However, for an incoming-only reset, it accounts for the smaller IN
    request even though the peer must generate an OUT request with the same
    stream list. Such a request cannot be completed successfully by the
    peer.
    
    Reject peer IN requests whose corresponding OUT request would exceed
    SCTP_MAX_CHUNK_LEN. Also tighten the local check so it does not send an
    IN request that would require an oversized OUT request from the peer.
    
    Fixes: 7f9d68ac944e ("sctp: implement sender-side procedures for SSN Reset Request Parameter")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Closes: https://lore.kernel.org/all/20260707203215.2752-1-blbllhy@gmail.com/
    Suggested-by: Xin Long <lucien.xin@gmail.com>
    Signed-off-by: Cen Zhang (Microsoft) <blbllhy@gmail.com>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260710010718.20318-1-blbllhy@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
selftests/clone3: fix wild pointer access of getline due to missing init [+ + +]
Author: Chris Gellermann <christian.gellermann@codasip.com>
Date:   Wed Jul 22 15:02:45 2026 +0200

    selftests/clone3: fix wild pointer access of getline due to missing init
    
    commit 8f6f9fd93cd7a5dd607ad5cd910476dd68fff3ed upstream.
    
    Patch series "selftests: Add missing initalization of pointer passed to
    getline", v2.
    
    
    This patch (of 2):
    
    Clone3_set_tid uses getline(&line, ...) in a loop to read the child's
    process status.  The code expects that getline allocates the buffer for
    the line on the first loop iteration.  According to the Open Group
    Spec[1], char *line has to be null pointer for this:
    
    > ssize_t getline(char **restrict lineptr, ...);
    > If *lineptr is a null pointer or if the object pointed to by *lineptr
    > is of insufficient size, an object shall be allocated as if by
    malloc()
    > or the object shall be reallocated as if by realloc()[...].
    
    However, char *line is only declared, leading to an undefined value that
    is potentially non-null.  In an example run with Musl v1.2.6, the realloc
    call[2] of getdelim, which implements getline, triggers a segfault:
    
    ./run_kselftest.sh --test clone3:clone3_set_tid
    [ 1366.165898] kselftest: Running tests in clone3
    ...
    [ 1367.799244] clone3_set_tid[811]: unhandled signal 11 code 0x1 at
    0x0000000000000000 in libc.so[68184,3fbf69f000+4c000]
    [ 1367.802808] CPU: 0 UID: 0 PID: 811 Comm: clone3_set_tid Not tainted
    ..
    [ 1367.804188]  epc: 0x0000003fbf6b0184
    [ 1367.804188]  ra : 0x0000003fbf6d4664
    [ 1367.804188]  sp : 0x0000003fce5f2e40
    [ 1367.805314]  gp : 0x0000002aaab0dfb8
    [ 1367.805314]  tp : 0x0000003fbf6f14a8
    [ 1367.805314]  t0 : 0x0000003fbf63d000
    ...
    
    Looking at the realloc implementation, Musl mallocs for a null pointer
    memory.  But for a non-null pointer, it assumes it's passed a valid
    pointer to the heap and tries to access its meta-data.  This leads to the
    segfault we see:
    
    void *realloc(void *p, size_t n)
    {
            if (!p) return malloc(n);
            if (size_overflows(n)) return 0;
    
            struct meta *g = get_meta(p);
            ...
    }
    
    Fix this by properly initializing the line pointer to NULL.
    
    Link: https://lore.kernel.org/20260722130246.2135563-1-christian.gellermann@codasip.com
    Link: https://lore.kernel.org/20260722130246.2135563-2-christian.gellermann@codasip.com
    Link: https://pubs.opengroup.org/onlinepubs/9799919799/functions/getline.html [1]
    Link: https://git.musl-libc.org/cgit/musl/tree/src/stdio/getdelim.c#n38 [2]
    Fixes: 41585bbeeef9 ("selftests: add tests for clone3() with *set_tid")
    Signed-off-by: Chris Gellermann <christian.gellermann@codasip.com>
    Acked-by: David Hildenbrand (arm) <david@kernel.org>
    Reviewed-by: Lorenzo Stoakes <ljs@kernel.org>
    Cc: Christian Brauner <brauner@kernel.org>
    Cc: Liam R. Howlett <liam@infradead.org>
    Cc: Lorenzo Stoakes <ljs@kernel.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: Vlastimil Babka <vbabka@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
selftests/ftrace: Add test case for GRP/ only input [+ + +]
Author: Linyu Yuan <quic_linyyuan@quicinc.com>
Date:   Mon Jun 27 10:19:08 2022 +0800

    selftests/ftrace: Add test case for GRP/ only input
    
    [ Upstream commit 5db19792f0660ad1ece247829bddd24bb2f8db25 ]
    
    Add kprobe and eprobe event test for new GRP/ only format.
    
    Link: https://lore.kernel.org/all/1656296348-16111-5-git-send-email-quic_linyyuan@quicinc.com/
    
    Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Reviewed-by: Tom Zanussi <zanussi@kernel.org>
    Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Stable-dep-of: 6e3abef2a27e ("selftests/ftrace: refactor eprobes test to fix argument checks")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests/ftrace: refactor eprobes test to fix argument checks [+ + +]
Author: Martin Kaiser <martin@kaiser.cx>
Date:   Tue Aug 4 21:46:35 2026 +0200

    selftests/ftrace: refactor eprobes test to fix argument checks
    
    [ Upstream commit 6e3abef2a27e7402a94111c9eff85d887e64a309 ]
    
    The add/remove eprobe test installs an eprobe for the openat syscall and
    runs ls. It checks the filenames that were opened by ls against a
    whitelist and a blacklist.
    
    Commit 206b25c09080 ("tracing: eprobe: read the complete FILTER_PTR_STRING
    pointer") fixed access to some string fields in eprobes. This triggers
    test failures as the blacklist does not allow relative paths for the
    openat parameters.
    
    What makes this test unstable is the fact that the openat calls vary a
    lot between different systems.
    
    Refactor the test to make it more robust. "cd <directory>" will issue a
    chdir syscall with the target directory as parameter. Set an eprobe on
    the sys_enter_chdir event and filter for the exact directory name. Allow
    (fault) as fallback.
    
    Link: https://lore.kernel.org/all/20260804194705.760893-1-martin@kaiser.cx/
    
    Fixes: 206b25c09080 ("tracing: eprobe: read the complete FILTER_PTR_STRING pointer")
    Reported-by: kernel test robot <oliver.sang@intel.com>
    Closes: https://lore.kernel.org/oe-lkp/202607151010.b68428e1-lkp@intel.com
    Signed-off-by: Martin Kaiser <martin@kaiser.cx>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
serial: 8250_dma: Clear stale RX state on shutdown [+ + +]
Author: Cunhao Lu <1579567540@qq.com>
Date:   Mon Jul 27 14:25:22 2026 +0800

    serial: 8250_dma: Clear stale RX state on shutdown
    
    commit e2fe6a0efecbef00e3ecc2db64dd5afa8c212b41 upstream.
    
    serial8250_release_dma() terminates RX DMA and releases the channel, but
    leaves rx_running set.  If the port is closed while an RX transfer is
    active, the stale state remains while rxchan is NULL until the channel is
    requested again on the next open.
    
    The DesignWare BUSY workaround added by commit a7b9ce39fbe4
    ("serial: 8250_dw: Ensure BUSY is deasserted") calls
    serial8250_rx_dma_flush() from the LCR write path during startup.  This
    happens before serial8250_request_dma() obtains a new RX channel.  On
    reopen, the stale rx_running state therefore makes the flush path pass a
    NULL channel to dmaengine_pause(), causing a kernel Oops.
    
    Clear rx_running after terminating RX DMA, matching the TX cleanup.  Also
    make the flush helper return if the DMA object or RX channel is not
    available so startup and teardown paths cannot pass a NULL channel to the
    DMAengine API.
    
    Fixes: 0fcb7901f9d6 ("tty: serial: 8250_dma: keep own book keeping about RX transfers")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Cunhao Lu <1579567540@qq.com>
    Link: https://patch.msgid.link/tencent_9EE2945F4C933B4D810C73C2D7485E000F06@qq.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
smb/client: handle overlapping allocated ranges in fallocate [+ + +]
Author: Huiwen He <hehuiwen@kylinos.cn>
Date:   Fri Jul 3 13:32:56 2026 +0800

    smb/client: handle overlapping allocated ranges in fallocate
    
    [ Upstream commit b09ae45d85dc816987a71db9eebc54b0ae288e94 ]
    
    smb3_simple_fallocate_range() can skip holes when an allocated range
    returned by the server starts before the current fallocate offset. The
    skipped hole is not zero-filled, but fallocate still returns success. A
    later write to that hole may therefore fail with ENOSPC.
    
    The function queries allocated ranges so that it can preserve existing
    contents and write zeroes only into holes. However, the server may return
    a range that starts before the current fallocate offset.
    
    For example, assume the fallocate request is [100, 400) and the only
    allocated range returned by the server is [0, 200):
    
            Request:      [100, 400)
            Server range: [  0, 200)  allocated
    
            Correct:
            [100, 200)    allocated data, skip
            [200, 400)    hole, zero-fill
    
            Current:
            [100, 300)    skipped
            [300, 400)    zero-filled afterwards
    
    The current code adds the full server range length, 200, to the current
    offset 100 and moves to 300. As a result, the hole in [200, 300) is
    skipped without being zero-filled.
    
    Fix this by advancing only over the part of the allocated range that
    overlaps the current fallocate offset.  Ignore ranges that end before the
    current offset and reject ranges whose end offset overflows.
    
    This also prevents a malformed range length from causing an out-of-bounds
    zero-buffer read.
    
    Fixes: 966a3cb7c7db ("cifs: improve fallocate emulation")
    Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
    Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
smb: client: fix buffer leaks in SMB1 read and write [+ + +]
Author: Dawei Feng <dawei.feng@seu.edu.cn>
Date:   Sun Jun 28 14:59:09 2026 +0800

    smb: client: fix buffer leaks in SMB1 read and write
    
    [ Upstream commit 6a3e16d60e81a4aa3056ab15617036cfbea2e07d ]
    
    CIFSSMBRead(), CIFSSMBWrite() and CIFSSMBWrite2() allocate a request
    buffer before checking whether tcon->ses->server is NULL. If that
    defensive check ever fails, the helper returns -ECONNABORTED without
    releasing the request buffer.
    
    Fix these leaks by releasing the allocated request buffer before
    returning from these error paths. Use cifs_small_buf_release() for the
    buffers allocated by small_smb_init() and cifs_buf_release() for the
    buffer allocated by smb_init().
    
    The bug was first flagged by an experimental analysis tool we are
    developing for kernel memory-management bugs while analyzing
    v6.13-rc1. The tool is still under development and is not yet publicly
    available. Manual inspection confirms that the bug is still
    present in v7.1.1.
    
    An x86_64 allyesconfig build showed no new warnings.
    
    Runtime validation used a temporary fault-injection hook to force
    tcon->ses->server to NULL after request-buffer initialization. On the
    unfixed kernel, the harness observed two leaked small request buffers and
    one leaked large request buffer, with directed kmemleak dumps confirming
    the CIFS buffer allocation stacks. After the fix, no CIFS request-buffer
    deltas remained.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
spi: spi-fsl-dspi: Avoid setup_accel logic for DMA transfers [+ + +]
Author: Larisa Grigore <larisa.grigore@nxp.com>
Date:   Thu May 22 15:51:37 2025 +0100

    spi: spi-fsl-dspi: Avoid setup_accel logic for DMA transfers
    
    [ Upstream commit cac7e5054115fcc41b1cb050af8e8971f7c9b22b ]
    
    Repacking multiple smaller words into larger ones to make use of the
    full FIFO doesn't save anything in DMA mode, so don't bother doing it.
    
    Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Link: https://patch.msgid.link/20250522-james-nxp-spi-v2-8-bea884630cfb@linaro.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
staging: rtl8723bs: fix inverted HT40 secondary channel offset [+ + +]
Author: MinJea Kim <qndkdrnl@gmail.com>
Date:   Tue Jul 14 22:14:21 2026 +0900

    staging: rtl8723bs: fix inverted HT40 secondary channel offset
    
    commit 30d49cba27f8905bc288cef5846963f0004f644c upstream.
    
    rtw_get_chan_type() maps the driver's channel offset to nl80211 channel
    types the wrong way around.
    
    In this driver HAL_PRIME_CHNL_OFFSET_LOWER means the primary channel is
    the lower 20 MHz half of the 40 MHz pair, i.e. the secondary channel is
    above the primary one: rtw_get_center_ch() computes the center channel
    as "channel + 2" for OFFSET_LOWER, and bwmode_update_check() sets
    OFFSET_LOWER when the AP's HT operation IE announces SCA (secondary
    channel above). In nl80211 terms that is NL80211_CHAN_HT40PLUS, not
    HT40MINUS.
    
    Because of the inversion, cfg80211_rtw_get_channel() reports an HT40+
    association as HT40-. For an HT40+ AP on a low channel (e.g. channel 3)
    the resulting chandef spans below the 2.4 GHz band edge and is invalid,
    so the regulatory core tears the connection down 60 seconds
    (REG_ENFORCE_GRACE_MS) after the AP's country IE triggers a regdomain
    change: reg_check_chans_work() considers the reported chandef unusable
    and calls cfg80211_leave(). The supplicant then reconnects, the country
    IE changes the regdomain again, and the cycle repeats, causing a
    disconnect/reconnect loop every ~65 seconds for as long as the link is
    up.
    
    Observed on a TECLAST X80 Power tablet (RTL8723BS) associated to an
    HT40+ AP on channel 3 with a KR country IE; a kprobe trace showed
    cfg80211_disconnect() being invoked from reg_check_chans_work(). With
    the mapping fixed, "iw dev wlan0 info" reports the correct
    "width: 40 MHz, center1: 2432 MHz" and the periodic disconnects stop.
    
    Fixes: 5402cc178c5d ("staging: rtl8723bs: add get_channel cfg80211 implementation")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude-Code:claude-fable-5 bpftrace
    Signed-off-by: MinJea Kim <qndkdrnl@gmail.com>
    Link: https://patch.msgid.link/20260714131421.3980-1-qndkdrnl@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: rtl8723bs: fix missing shared-key auth challenge length check [+ + +]
Author: Panagiotis Petrakopoulos <npetrakopoulos2003@gmail.com>
Date:   Mon Jul 20 11:24:09 2026 +0300

    staging: rtl8723bs: fix missing shared-key auth challenge length check
    
    commit 2c56ef658ac8c6bca36bc5574715e8f717207c6c upstream.
    
    The WEP shared-key authentication handler uses the challenge-text
    element's attacker-controlled length without checking it against the
    fixed 128-byte chg_txt buffer.
    
    In OnAuthClient() the length from rtw_get_ie() - up to 255 - is used
    to perform memcpy() into the 128-byte pmlmeinfo->chg_txt, so a
    malicious AP sending a malformed WLAN_EID_CHALLENGE element can
    overflow/underfill chg_txt by up to 127 bytes. It is reachable over the
    air, before association, during shared-key authentication. In the case
    of an overflow, the driver can write out of bounds. In the case of an
    underfill, the driver can echo stale buffer memory.
    
    The challenge text is defined to be exactly 128 octets, which is
    already provided as the WLAN_AUTH_CHALLENGE_LEN define; require the
    element to be exactly that length before use.
    
    Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Panagiotis Petrakopoulos <npetrakopoulos2003@gmail.com>
    Link: https://patch.msgid.link/20260720082409.168379-1-npetrakopoulos2003@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: rtl8723bs: fix OOB read in rtw_get_wpa_ie() [+ + +]
Author: Muhammad Bilal <meatuni001@gmail.com>
Date:   Sun Jul 19 08:06:31 2026 +0500

    staging: rtl8723bs: fix OOB read in rtw_get_wpa_ie()
    
    commit 1c3e23e78862493e8cf1adad02b10ffcb8b9921c upstream.
    
    rtw_get_wpa_ie() reads bytes at fixed offsets into a vendor-specific
    information element without checking that the element is long enough,
    causing an out-of-bounds read for a short trailing IE.
    
    The function locates a vendor-specific IE (EID 221) with rtw_get_ie()
    and then compares a 4-byte OUI+type at pbuf + 2 and reads a 2-byte
    version word at pbuf + 6. Those accesses require the IE body to be at
    least 6 bytes, but rtw_get_ie() only guarantees that the element fits
    within the buffer; it does not enforce a minimum body length. A
    vendor-specific IE whose length byte is 0 to 5, placed at the end of
    the buffer, therefore makes these reads run past the end of the IE and
    past the end of the buffer itself.
    
    The buffer holds information elements taken from received management
    frames and from the IE blob passed to rtw_cfg80211_set_wpa_ie(), which
    is kmemdup'd to its exact length, so the read can run off the end of
    the allocation.
    
    The sibling helpers rtw_get_sec_ie(), rtw_get_wapi_ie() and
    rtw_get_wps_ie() in this file already reject too-short vendor-specific
    IEs before their OUI memcmp(); rtw_get_wpa_ie() was never brought in
    line with them, and needs a minimum of 6 rather than 4 bytes because
    of the version word. Add the missing length check.
    
    Fixes: 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
    Link: https://patch.msgid.link/20260719030631.88254-1-meatuni001@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: rtl8723bs: fix OOB read in WMM_param_handler() [+ + +]
Author: Muhammad Bilal <meatuni001@gmail.com>
Date:   Sun Jul 19 09:15:09 2026 +0500

    staging: rtl8723bs: fix OOB read in WMM_param_handler()
    
    commit ae21407350151bddfd4fea7aa39bd0643c0ca9d3 upstream.
    
    WMM_param_handler() copies a fixed-size WMM parameter element out of a
    received information element without checking that the element is long
    enough, causing an out-of-bounds read for a short WMM IE.
    
    The handler reads sizeof(struct WMM_para_element) (18) bytes at
    pIE->data + 6, so it requires pIE->length to be at least 24
    (WLAN_WMM_LEN), but it never validates the length. Two of its three
    callers reach it after matching only the WMM OUI: OnAssocRsp() in
    rtw_mlme_ext.c matches a 6-byte OUI, and join_cmd_hdl() matches a
    4-byte OUI, before calling the handler. A vendor-specific IE carrying
    the WMM OUI but a length between 6 and 23, placed in an association
    response or in the IE blob handed to join_cmd_hdl(), passes the OUI
    check and then makes the memcmp() and memcpy() at pIE->data + 6 read
    past the end of the element. OnAssocRsp() parses a frame received from
    the AP, so this is reachable from a remote peer.
    
    The remaining caller in rtw_wlan_util.c already guards the handler with
    "pIE->length == WLAN_WMM_LEN". Move the equivalent check into the
    handler itself so every caller is covered; the sibling IE handlers in
    the same parsing loop (HT_caps_handler(), HT_info_handler(),
    ERP_IE_handler()) likewise bound their accesses by pIE->length.
    
    Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
    Link: https://patch.msgid.link/20260719041509.97894-1-meatuni001@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: rtl8723bs: fix OOB reads in rtw_get_wps_ie() [+ + +]
Author: Moksh Panicker <mokshpanicker.7@gmail.com>
Date:   Thu Jun 25 20:29:11 2026 +0000

    staging: rtl8723bs: fix OOB reads in rtw_get_wps_ie()
    
    commit 0e95ff792ae0aa6fbad9455943e9e1e4062670e9 upstream.
    
    rtw_get_wps_ie() iterates over IE data from network frames without
    validating that the IE header and payload fit within the remaining
    buffer before reading them. Specifically:
    
    - in_ie[cnt + 1] is read without checking cnt + 1 < in_len
    - memcmp(&in_ie[cnt + 2], ...) accesses cnt + 2 without bounds check
    - in_ie[cnt + 1] is used as length without verifying payload fits
    
    Add bounds checks at the top of the loop body to break early if fewer
    than 2 bytes remain for the IE header, or if the declared payload
    extends past the end of the buffer. Also require at least 4 bytes of
    payload before comparing the WPS OUI.
    
    Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
    Link: https://patch.msgid.link/20260625202911.26782-1-mokshpanicker.7@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: rtl8723bs: validate monitor transmit frame lengths [+ + +]
Author: Mariano Baragiola <mbaragiola@linux.com>
Date:   Mon Jul 27 13:08:59 2026 -0300

    staging: rtl8723bs: validate monitor transmit frame lengths
    
    commit 6829665d050983907b560173e49dcc6c11cb2730 upstream.
    
    rtw_cfg80211_monitor_if_xmit_entry() removes the radiotap header and
    then reads the 802.11 frame control field without checking that a base
    802.11 header remains.
    
    The data path also pulls the calculated 802.11, QoS and SNAP header
    span before confirming that the skb contains it. A truncated frame can
    therefore cause out-of-bounds reads or leave insufficient data for the
    Ethernet address writes.
    
    Reject frames that do not contain the base 802.11 header and data
    frames that do not contain their complete calculated header span.
    
    Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Mariano Baragiola <mbaragiola@linux.com>
    Link: https://patch.msgid.link/20260727160859.1917096-1-mbaragiola@linux.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tcp: fix TFO max_qlen accounting across reuseport migration [+ + +]
Author: Jiayuan Chen <jiayuan.chen@linux.dev>
Date:   Mon Aug 3 14:17:38 2026 +0800

    tcp: fix TFO max_qlen accounting across reuseport migration
    
    [ Upstream commit a0ab2ba83e35159d81cec830a92e885ecf8139be ]
    
    A listener's TCP_FASTOPEN max_qlen stops being accurate and lets through
    far more pending Fast Open requests than it was configured for.
    
    This only shows up with SO_REUSEPORT listener migration, where closing a
    listener hands its still-pending TFO children over to a surviving one.
    
    fastopenq.qlen is charged in tcp_fastopen_create_child() when the child
    is created and uncharged in reqsk_fastopen_remove() when the handshake
    completes.  The uncharge follows rsk_listener of the request the child
    points at, and inet_reqsk_clone() has repointed the child at a new
    request owned by the new listener, so the ++ and the -- land on two
    different sockets.  The new listener's qlen drifts negative and its
    limit no longer binds.
    
    Charge the new listener during migration, like reqsk_queue_migrated()
    already does for queue->young and queue->qlen.
    
    Fixes: 54b92e841937 ("tcp: Migrate TCP_ESTABLISHED/TCP_SYN_RECV sockets in accept queues.")
    Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
    Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20260803061739.134737-1-jiayuan.chen@linux.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
thunderbolt: Bound the DROM dual link port number before indexing sw->ports [+ + +]
Author: Bryam Vargas <hexlabsecurity@proton.me>
Date:   Thu Jun 25 06:54:09 2026 -0500

    thunderbolt: Bound the DROM dual link port number before indexing sw->ports
    
    commit d6764992f17b23d91ff93ce905ab53c2aa7191f0 upstream.
    
    tb_drom_parse_entry_port() validates the device-supplied header->index
    against sw->config.max_port_number before indexing sw->ports[], but the
    sibling field entry->dual_link_port_nr -- a 6-bit value also read from
    the DROM -- indexes the same array with no such check. A malicious or
    malformed Thunderbolt device can set dual_link_port_nr beyond the
    allocated sw->ports[] (max_port_number + 1 entries), producing an
    out-of-bounds tb_port pointer that is stored and later dereferenced.
    
    Reject a port entry whose dual_link_port_nr exceeds max_port_number,
    the same bound already applied to header->index.
    
    Fixes: cd22e73bdf5e ("thunderbolt: Read port configuration from eeprom.")
    Cc: stable@vger.kernel.org
    Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: icm: Preserve USB4 proxy data-valid bit [+ + +]
Author: Xu Rao <raoxu@uniontech.com>
Date:   Mon Jul 13 17:32:37 2026 +0800

    thunderbolt: icm: Preserve USB4 proxy data-valid bit
    
    commit e48844ece5e3ed1d1eb865f6da2b16f62cd9f86d upstream.
    
    The ICM USB4 switch operation request encodes two values in
    request.data_len_valid: bit 4 marks the data payload valid, while bits
    3:0 hold the payload length in dwords.  A zero length with the valid bit
    set represents the full 16-dword data array.
    
    icm_usb4_switch_op() sets the valid bit when a transmit payload is
    present.  For payloads shorter than the full 16 dwords, it then assigns
    the length to the whole field and clears the valid bit that was just set.
    The payload is still copied into the request, but the descriptor sent to
    firmware marks that data as invalid.
    
    This affects USB4 router operations that send short payloads through the
    firmware connection manager.  In particular, USB4 NVM writes can send a
    short final block when the image size is not aligned to the 64-byte proxy
    payload size.  Firmware may then ignore or reject that final block, while
    full 16-dword blocks are unaffected because they are encoded as length 0
    with the valid bit set.
    
    OR the short payload length into data_len_valid so the valid bit is
    preserved.
    
    Fixes: 9039387e166e ("thunderbolt: Add USB4 router operation proxy for firmware connection manager")
    Cc: stable@vger.kernel.org
    Signed-off-by: Xu Rao <raoxu@uniontech.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tipc: avoid use-after-free in poll trace queue dumps [+ + +]
Author: Zihan Xi <zihanx@nebusec.ai>
Date:   Fri Jul 24 00:38:41 2026 +0800

    tipc: avoid use-after-free in poll trace queue dumps
    
    commit b4f1719dfea023220e0e6bd892b087d76b2a6a49 upstream.
    
    TIPC socket tracepoints dump queue state through tipc_sk_dump(). Most
    queue-dump callsites already serialize that walk under the socket lock or
    sk->sk_lock.slock, but tipc_poll() calls trace_tipc_sk_poll(...,
    TIPC_DUMP_ALL, ...) without holding either lock.
    
    That lets the poll trace path reach tipc_list_dump() and backlog head/tail
    dumping while another context dequeues and frees an skb, leaving the trace
    helper dereferencing a stale queue entry.
    
    Stop the unlocked poll trace site from requesting queue dumps. Other queue
    dump trace callsites keep their existing output under the locking they
    already provide, while poll still emits the event itself without walking
    live queue members from an unlocked context.
    
    Fixes: b4b9771bcbbd ("tipc: enable tracepoints in tipc")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
    Signed-off-by: Ren Wei <enjou1224z@gmail.com>
    Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
    Link: https://patch.msgid.link/f8119abd5e5ecc400597de667ae9d39656de56d0.1784794294.git.zihanx@nebusec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tipc: clear sock->sk on the failed-insert path in tipc_sk_create() [+ + +]
Author: Daehyeon Ko <4ncienth@gmail.com>
Date:   Tue Jul 14 22:19:39 2026 +0900

    tipc: clear sock->sk on the failed-insert path in tipc_sk_create()
    
    commit ba0533fc163f905fe817cfabdf8ed4058da44800 upstream.
    
    When tipc_sk_create() fails to insert the new socket (tipc_sk_insert()
    returns non-zero), its error path frees the sk with sk_free() but leaves
    sock->sk pointing at the freed object:
    
            if (tipc_sk_insert(tsk)) {
                    sk_free(sk);
                    pr_warn("Socket create failed; port number exhausted\n");
                    return -EINVAL;
            }
    
    This is harmless for plain socket(): the syscall layer clears sock->ops
    before releasing, so tipc_release() is never called. It is not harmless
    on the accept() path. tipc_accept() creates the pre-allocated child
    socket with tipc_sk_create(net, new_sock, 0, kern); on failure it leaves
    new_sock->sk dangling and new_sock->ops non-NULL, and do_accept() then
    fput()s the new file, so __sock_release() -> tipc_release() runs
    lock_sock(new_sock->sk) on the freed sk -- a use-after-free write of the
    sk_lock spinlock.
    
    tipc_release() already guards this exact "failed accept() releases a
    pre-allocated child" case with "if (sk == NULL) return 0;", but the
    guard is bypassed because tipc_sk_create() left sock->sk non-NULL
    (dangling) rather than NULL.
    
    Clear sock->sk on the failed-insert path so the existing tipc_release()
    NULL check fires and the use-after-free is avoided.
    
    The tipc_sk_insert() failure is reached when the per-netns socket
    rhashtable hits its max_size (tsk_rht_params.max_size = 1048576, ~2M
    elements) -- i.e. once a netns holds ~2M TIPC sockets every insert
    returns -E2BIG.
    
      BUG: KASAN: slab-use-after-free in lock_sock_nested (net/core/sock.c:3839)
      Write of size 8 at addr ffff8880047cdc38 by task init/1
       lock_sock_nested (net/core/sock.c:3839)
       tipc_release (net/tipc/socket.c:638)
       __sock_release (net/socket.c:710)
       sock_close (net/socket.c:1501)
       __fput (fs/file_table.c:512)
      Allocated by task 1:
       sk_alloc (net/core/sock.c:2308)
       tipc_sk_create (net/tipc/socket.c:487)
       tipc_accept (net/tipc/socket.c:2744)
       do_accept (net/socket.c:2034)
      Freed by task 1:
       __sk_destruct (net/core/sock.c:2391)
       tipc_sk_create (net/tipc/socket.c:504)
       tipc_accept (net/tipc/socket.c:2744)
       do_accept (net/socket.c:2034)
    
    Fixes: 00aff3590fc0 ("net: tipc: fix possible refcount leak in tipc_sk_create()")
    Cc: stable@vger.kernel.org
    Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
    Reviewed-by: Breno Leitao <leitao@debian.org>
    Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260714131939.1255974-1-4ncienth@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tipc: fix infinite loop in __tipc_nl_compat_dumpit [+ + +]
Author: Helen Koike <koike@igalia.com>
Date:   Mon Jul 13 17:49:35 2026 -0300

    tipc: fix infinite loop in __tipc_nl_compat_dumpit
    
    [ Upstream commit 22f8aa35964e8f2ab026578f45befc9605fd1b28 ]
    
    cmd->dumpit callback can return a negative errno, causing an infinite
    loop due to the while(len) condition. As the loop never terminates,
    genl_mutex is never released, and other tasks waiting on it starve in D
    state.
    
    Check dumpit's return value, propagate it and jump to err_out on error.
    
    Reported-by: syzbot+85d0bec020d805014a3a@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=85d0bec020d805014a3a
    Fixes: d0796d1ef63d ("tipc: convert legacy nl bearer dump to nl compat")
    Signed-off-by: Helen Koike <koike@igalia.com>
    Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech
    Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
    Link: https://patch.msgid.link/20260713204940.647668-1-koike@igalia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tipc: fix u16 MTU truncation in media and bearer MTU validation [+ + +]
Author: Cen Zhang (Microsoft) <blbllhy@gmail.com>
Date:   Tue Jul 14 00:15:41 2026 -0400

    tipc: fix u16 MTU truncation in media and bearer MTU validation
    
    [ Upstream commit 9f29cd8a8e7901a2617c8064ce9f50fc67b97cb8 ]
    
    Both TIPC_NL_MEDIA_SET and TIPC_NL_BEARER_SET accept user-supplied
    MTU values but only enforce a minimum bound, not a maximum. When a user
    sets the MTU to a value exceeding U16_MAX (65535), it passes validation
    but is silently truncated when assigned to u16 fields l->mtu and
    l->advertised_mtu in tipc_link_create(). Values like 65536 (0x10000)
    truncate to 0, causing a division by zero in tipc_link_set_queue_limits()
    which computes TIPC_MAX_PUBL / (l->mtu / ITEM_SIZE). Other overflowing
    values (e.g. 65537-131071) produce small incorrect MTU values, resulting
    in link malfunction behaviors.
    
    Crash stack (triggered as unprivileged user via user namespace):
    
      tipc_link_set_queue_limits  net/tipc/link.c:2531
      tipc_link_create            net/tipc/link.c:520
      tipc_node_check_dest        net/tipc/node.c:1279
      tipc_disc_rcv               net/tipc/discover.c:252
      tipc_rcv                    net/tipc/node.c:2129
      tipc_udp_recv               net/tipc/udp_media.c:392
    
    Two independent paths lack the upper bound check:
    1. tipc_udp_mtu_bad() -- called from __tipc_nl_media_set() (MEDIA_SET)
    2. inline check in __tipc_nl_bearer_set() at bearer.c:1160 (BEARER_SET)
    
    Fix both by rejecting MTU values above U16_MAX.
    
    Fixes: 901271e0403a ("tipc: implement configuration of UDP media MTU")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Closes: https://lore.kernel.org/all/CAB8m9WgETt0AjmFwE=F-CKjGXsK6_WDv0=kbYRcC8-noo+amnA@mail.gmail.com
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Signed-off-by: Cen Zhang (Microsoft) <blbllhy@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260714041541.307702-1-blbllhy@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tipc: fix use-after-free of the discoverer in tipc_disc_rcv() [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Wed Jul 29 15:16:03 2026 +0300

    tipc: fix use-after-free of the discoverer in tipc_disc_rcv()
    
    commit 1579342d71133da7f00daa02c75cebec7372097b upstream.
    
    bearer_disable() frees b->disc with tipc_disc_delete()'s plain kfree(),
    but tipc_disc_rcv() still dereferences b->disc in RX softirq under
    rcu_read_lock() (tipc_udp_recv -> tipc_rcv -> tipc_disc_rcv).
    
    L2 bearers are safe thanks to the synchronize_net() in
    tipc_disable_l2_media(), but the UDP bearer defers that call to the
    cleanup_bearer() workqueue, so the discoverer is freed with no grace
    period:
    
     BUG: KASAN: slab-use-after-free in tipc_disc_rcv (net/tipc/discover.c:149)
     Read of size 8 at addr ffff88802348b728 by task poc_tipc/184
     <IRQ>
      tipc_disc_rcv (net/tipc/discover.c:149)
      tipc_rcv (net/tipc/node.c:2126)
      tipc_udp_recv (net/tipc/udp_media.c:391)
      udp_rcv (net/ipv4/udp.c:2643)
      ip_local_deliver_finish (net/ipv4/ip_input.c:241)
     </IRQ>
     Freed by task 181:
      kfree (mm/slub.c:6565)
      bearer_disable (net/tipc/bearer.c:418)
      tipc_nl_bearer_disable (net/tipc/bearer.c:1001)
    
    The bearer is freed with kfree_rcu(); free the discoverer the same way.
    Add an rcu_head to struct tipc_discoverer and free it and its skb from an
    RCU callback.
    
    Because the RCU callback (tipc_disc_free_rcu) lives in module text, a
    call_rcu() that is still pending when the tipc module is unloaded would
    invoke a freed function. Add an rcu_barrier() to tipc_exit() after the
    bearer subsystem has been torn down, so all pending discoverer callbacks
    have run before the module text goes away.
    
    Reachable from an unprivileged user namespace: the TIPCv2 genl family is
    netnsok and its bearer commands have no GENL_ADMIN_PERM. Needs CONFIG_TIPC
    and CONFIG_TIPC_MEDIA_UDP.
    
    Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values")
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
    Link: https://patch.msgid.link/20260617135744.3383175-3-bestswngs@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Alexander Martyniuk <alexevgmart@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tipc: read le->link under the node lock in tipc_node_link_down() [+ + +]
Author: Jun Yang <junvyyang@tencent.com>
Date:   Mon Aug 10 18:21:38 2026 +0800

    tipc: read le->link under the node lock in tipc_node_link_down()
    
    commit cba9ccb47e9fa4cc77692fb896cc5ab57a667882 upstream.
    
    tipc_node_link_down() caches the link pointer before taking n->lock:
    
            struct tipc_link *l = le->link;         /* unlocked */
    
            if (!l)
                    return;
            tipc_node_write_lock(n);
            if (!tipc_link_is_establishing(l)) {    /* deref l */
            ...
                    tipc_link_reset(l);             /* write into l */
            if (delete) {
                    kfree(l);
                    le->link = NULL;
    
    The delete=true caller frees that very object under n->lock, so the lock
    does not protect the cached pointer against it:
    
     - CPU A, delete=false: tipc_rcv() on TIPC_LINK_DOWN_EVT, or the link
       supervision timer via tipc_node_timeout(), reads l unlocked and then
       dereferences it under n->lock;
     - CPU B, delete=true: netlink TIPC_NL_BEARER_DISABLE -> bearer_disable()
       -> tipc_node_delete_links() -> tipc_node_link_down(n, bearer_id, true)
       -> kfree(l).
    
    The link is freed with plain kfree(), not kfree_rcu(), and for UDP bearers
    disable_media() only schedules the asynchronous cleanup_bearer() work, so
    its synchronize_net() runs after the links are already gone.  An in-flight
    CPU A that has read l therefore dereferences freed memory once B frees it:
    a use-after-free read in tipc_link_is_establishing(), and a use-after-free
    write via tipc_link_reset() on the establishing branch.
    
    The following trace was captured on 7.2.0-rc5-00284-gaf39eb111ce6:
    
      BUG: KASAN: slab-use-after-free in tipc_link_is_establishing (net/tipc/link.c:285)
      Read of size 4 at addr ffff88802e2aa068 by task swapper/2/0
       tipc_link_is_establishing (net/tipc/link.c:285)
       tipc_node_link_down (net/tipc/node.c:1076)
       tipc_node_timeout (net/tipc/node.c:843)
      Allocated by task 9549:
       tipc_link_create (net/tipc/link.c:490)
       tipc_node_check_dest (net/tipc/node.c:1279)
       tipc_disc_rcv (net/tipc/discover.c:252)
       tipc_udp_recv (net/tipc/udp_media.c:389)
      Freed by task 9549:
       tipc_node_link_down (net/tipc/node.c:1084)
       tipc_node_delete_links (net/tipc/node.c:1320)
       bearer_disable (net/tipc/bearer.c:414)
       __tipc_nl_bearer_disable (net/tipc/bearer.c:992)
    
    Move the le->link read inside tipc_node_write_lock(), so it is serialised
    against the kfree() in the delete path.  A racing teardown now either has
    not run yet, and we see a valid link, or has already run, and we see NULL.
    
    Fixes: 73f646cec354 ("tipc: delay ESTABLISH state event when link is established")
    Cc: stable@kernel.org
    Reported-by: TencentOS Corvus AI <corvus@tencent.com>
    Assisted-by: tencentos-corvus-ai:kimi-k3
    Signed-off-by: Jun Yang <junvyyang@tencent.com>
    Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
    Link: https://patch.msgid.link/20260810102147.48191-1-juny24602@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tls: don't abort the connection on signal-interrupted sends [+ + +]
Author: Maximilian Immanuel Brandtner <maxbr@linux.ibm.com>
Date:   Wed Aug 5 08:22:48 2026 +0200

    tls: don't abort the connection on signal-interrupted sends
    
    [ Upstream commit af0e5cdd031f4f4a8f6d4160bfbda4f36872b0ed ]
    
    When a signal interrupts a blocking send, tls_tx_records() treats the
    resulting -ERESTARTSYS as a transmission failure and marks the socket
    errored via tls_err_abort() with the raw error code. Later syscalls
    return the kernel-internal errno 512 (ERESTARTSYS) to userspace, as the
    signal it stems from is no longer pending during syscall exit and thus
    never translated.
    
    An interrupted send is not a connection error: the partially sent record
    stays queued and is resent later. Interrupt error codes are therefore
    excluded from the abort in the same way as -EAGAIN.
    
    Fixes: b341ca51d267 ("tls: Fix tls_sw_sendmsg error handling")
    Signed-off-by: Maximilian Immanuel Brandtner <maxbr@linux.ibm.com>
    Link: https://patch.msgid.link/20260805063109.1772314-1-maxbr@linux.ibm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tls: separate no-async decryption request handling from async [+ + +]
Author: Sabrina Dubroca <sd@queasysnail.net>
Date:   Mon Aug 3 12:32:16 2026 -0700

    tls: separate no-async decryption request handling from async
    
    commit 41532b785e9d79636b3815a64ddf6a096647d011 upstream.
    
    If we're not doing async, the handling is much simpler. There's no
    reference counting, we just need to wait for the completion to wake us
    up and return its result.
    
    We should preferably also use a separate crypto_wait. I'm not seeing a
    UAF as I did in the past, I think aec7961916f3 ("tls: fix race between
    async notify and socket close") took care of it.
    
    This will make the next fix easier.
    
    Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
    Link: https://lore.kernel.org/r/47bde5f649707610eaef9f0d679519966fc31061.1709132643.git.sd@queasysnail.net
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tracing/eprobe: Fix exact system name matching in eprobe_dyn_event_match() [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Mon Jul 20 19:12:38 2026 +0900

    tracing/eprobe: Fix exact system name matching in eprobe_dyn_event_match()
    
    commit f418d68d71fd4a0a9cef92377bc8c4c3334b5b53 upstream.
    
    eprobe_dyn_event_match() checks if the target event system in argv[0]
    matches ep->event_system using strncmp(ep->event_system, argv[0], len).
    However, if ep->event_system is longer than len (e.g. "eprobes" vs
    "ep/event"), strncmp() still returns 0 because the first len characters
    match.
    
    Check that ep->event_system[len] is '\0' to ensure exact system name
    matching.
    
    Link: https://lore.kernel.org/all/178454235856.290363.14872590900774231133.stgit@devnote2/
    
    Fixes: 7d5fda1c841f ("tracing: Fix event probe removal from dynamic events")
    Cc: stable@vger.kernel.org
    Assisted-by: Antigravity:gemini-3.5-flash
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tracing/filters: Fix false positive match in regex_match_full() [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Wed Jul 29 09:28:07 2026 +0900

    tracing/filters: Fix false positive match in regex_match_full()
    
    commit c22c7b735f9810ad276014f788f9aa5c879ec238 upstream.
    
    regex_match_full() calls strncmp(str, r->pattern, len) where len is the
    target field buffer size. When len is smaller than r->len (the filter
    pattern length), strncmp() checks only len bytes of r->pattern against
    str. If those len bytes match, strncmp() returns 0, resulting in a
    false-positive match where a shorter string in a fixed-size field
    matches a longer filter pattern.
    
    For example, a 4-byte static string field containing "abcd" matched the
    filter pattern "abcdefgh" because strncmp("abcd", "abcdefgh", 4)
    returned 0. In this case, @len does NOT include '\0' because it is
    fixed-size array.
    
    Fix this by returning 0 (no match) early when len < r->len.
    
    Fixes: 1889d20922d1 ("tracing/filters: Provide basic regex support")
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/178528488779.124250.5571741156199253769.stgit@devnote2
    Assisted-by: Antigravity:gemini-3.5-flash
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tracing/mmiotrace: Reset dropped_count in mmio_reset_data() [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Tue Jul 28 21:49:51 2026 +0900

    tracing/mmiotrace: Reset dropped_count in mmio_reset_data()
    
    [ Upstream commit c786d2bdf1f3964deee192ad942dee2a741c1e2c ]
    
    mmio_reset_data() is called during tracer initialization, reset, and
    start. While it resets overrun_detected and prev_overruns, it neglects
    to reset dropped_count. Consequently, dropped event counts from prior
    tracing sessions persist in dropped_count and corrupt overrun reports
    in subsequent runs.
    
    Fix this by explicitly calling atomic_set(&dropped_count, 0) in
    mmio_reset_data().
    
    Link: https://patch.msgid.link/178524299122.56416.16277704230639425172.stgit@devnote2
    Fixes: 173ed24ee2d6 ("mmiotrace: count events lost due to not recording")
    Assisted-by: Antigravity:gemini-3.6-flash
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tracing/probes: Avoid temporary buffer truncation in trace_probe_match_command_args() [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Mon Jul 20 19:12:10 2026 +0900

    tracing/probes: Avoid temporary buffer truncation in trace_probe_match_command_args()
    
    commit 15f197856d68882af9416fc97516bb55079b7677 upstream.
    
    In trace_probe_match_command_args(), a stack buffer buf[MAX_ARGSTR_LEN + 1]
    (256 bytes) is used to format "<name>=<comm>". However, since name can
    be up to 32 bytes (MAX_ARG_NAME_LEN) and comm up to 255 bytes
    (MAX_ARGSTR_LEN), the formatted string can exceed 256 bytes and get
    truncated by snprintf(), causing spurious argument matching failures.
    
    Instead of formatting into a temporary buffer on stack, compare the
    argument name, the '=' delimiter, and the comm expression directly.
    
    Link: https://lore.kernel.org/all/178454233010.290363.10428767141343428804.stgit@devnote2/
    
    Fixes: eb5bf81330a7 ("tracing/kprobe: Add per-probe delete from event")
    Cc: stable@vger.kernel.org
    Assisted-by: Antigravity:gemini-3.5-flash
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tracing/probes: Fix potential underflow in LEN_OR_ZERO macro [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Mon Jul 20 19:12:29 2026 +0900

    tracing/probes: Fix potential underflow in LEN_OR_ZERO macro
    
    commit 8ce20bfba48902e1382187cd1a852f7cf3a1e739 upstream.
    
    In __set_print_fmt(), LEN_OR_ZERO is defined as (len ? len - pos : 0).
    If len is non-zero but smaller than pos, len - pos evaluates to a negative
    integer. When passed as a size argument to snprintf(), this negative value
    is cast to a large unsigned size_t, bypassing buffer size limits.
    
    Ensure len > pos before subtracting to avoid integer underflow.
    
    Link: https://lore.kernel.org/all/178454234934.290363.15247317871499514139.stgit@devnote2/
    
    Fixes: 5bf652aaf46c ("tracing/probes: Integrate duplicate set_print_fmt()")
    Cc: stable@vger.kernel.org
    Assisted-by: Antigravity:gemini-3.5-flash
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tracing/probes: Prevent out-of-bounds write in __trace_probe_log_err() [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Mon Jul 20 19:12:20 2026 +0900

    tracing/probes: Prevent out-of-bounds write in __trace_probe_log_err()
    
    commit a9d6fb284039a5d3858a1d9f9a0d7e46cfb7c2d4 upstream.
    
    If trace_probe_log.argc is 0 in __trace_probe_log_err(), the loop
    constructing the command string will not execute and p will remain equal to
    command. Writing to *(p - 1) will cause an out-of-bounds access before
    command. This should not happen, but better to be treated.
    
    Reject if trace_probe_log.argc is 0.
    
    Link: https://lore.kernel.org/all/178454233992.290363.18323091580600697731.stgit@devnote2/
    
    Fixes: ab105a4fb894 ("tracing: Use tracing error_log with probe events")
    Cc: stable@vger.kernel.org
    Assisted-by: Antigravity:gemini-3.5-flash
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tracing: Check return value of __register_event() in trace_module_add_events() [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Wed Jul 29 09:27:58 2026 +0900

    tracing: Check return value of __register_event() in trace_module_add_events()
    
    commit ac8719969e6c3c54e939834df812bc41f25453cf upstream.
    
    trace_module_add_events() ignores the return value of __register_event()
    and unconditionally calls __add_event_to_tracers() for each event.
    
    If __register_event() fails (for example, if event_init() fails), the
    trace_event_call is not added to ftrace_events list, but
    __add_event_to_tracers() still creates a trace_event_file pointing to it.
    If module loading subsequently fails and module memory is freed, tracing
    state retains a stale trace_event_call pointer in trace_event_file,
    leading to a use-after-free when tracefs or tracing subsystem operations
    are later executed.
    
    Fix this by checking the return value of __register_event() and only
    calling __add_event_to_tracers() if event registration succeeded.
    
    Fixes: ae63b31e4d0e ("tracing: Separate out trace events from global variables")
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/178528487878.124250.14170824576025743236.stgit@devnote2
    Assisted-by: Antigravity:gemini-3.5-flash
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tracing: Fix mmiotrace possible NULL dereferencing of hiter->dev [+ + +]
Author: Steven Rostedt <rostedt@goodmis.org>
Date:   Tue Jul 21 21:11:43 2026 -0400

    tracing: Fix mmiotrace possible NULL dereferencing of hiter->dev
    
    commit 144f29e85702234b23d2a62abf723e6a17eb5427 upstream.
    
    If the mmio_pipe_open() fails to find a PCI device, the hiter->dev
    will be assigned to NULL. The mmiotrace read() function dereferences the
    hiter->dev if hiter exists.
    
    Change the test of the read to not only check hiter being NULL, but also
    the hiter->dev before dereferencing it.
    
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/20260721211143.36dbd559@gandalf.local.home
    Fixes: f984b51e0779 ("ftrace: add mmiotrace plugin")
    Reported-by: Sashiko <sashiko-bot@kernel.org>
    Link: https://sashiko.dev/#/patchset/20260715143604.14481-1-gaikwad.dcg%40gmail.com
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tracing: Fix race between update_event_fields and, event_define_fields [+ + +]
Author: Michael Wu <michael@allwinnertech.com>
Date:   Mon Aug 10 14:32:30 2026 +0800

    tracing: Fix race between update_event_fields and, event_define_fields
    
    commit c3730b8373bb5059d735509b9e6a00d7eb337d7c upstream.
    
    The following sequence may leads race between event_define_fields()
    and update_event_fields():
    
     CPU0 (loads module A)                      CPU1 (loads module B)
     ===============================            ===============================
     load_module(A)                             load_module(B)
       notifier_call_chain                        notifier_call_chain
         trace_module_notify                        trace_module_notify
           mutex_lock(&event_mutex)                   trace_event_update_all()
             trace_module_add_events(A)                 down_write(&trace_event_sem)
                __register_event(call_A)
                  __add_event_to_tracers(call_A)
                    event_define_fields(call_A)
                      for each f:                         list_for_each_entry(field,
                        list_add(&f->link,                                    &class->fields, link)
                                 &class->fields)            field = class->fields->next;
    
    Where access to the class->fields is not protected by the event_mutex in
    trace_event_update_all().
    
    This produces the following panic:
       Unable to handle kernel access ... at virtual address 0000000000000018
       pc : update_event_fields+0xf8/0x368
       Call trace:
        update_event_fields+0xf8/0x368
        trace_event_update_all+0x7c/0x2b4
        trace_module_notify+0x4c/0x1dc
        notifier_call_chain+0x84/0x168
        blocking_notifier_call_chain_robust+0x64/0xd4
        load_module+0x10c8/0x123c
        __arm64_sys_finit_module+0x230/0x31c
    
    Fix by taking event_mutex in trace_event_update_all() before
    trace_event_sem.
    
    Cc: stable@vger.kernel.org
    Fixes: b3bc8547d3be ("tracing: Have TRACE_DEFINE_ENUM affect trace event types as well")
    Link: https://patch.msgid.link/2e5730d2-c631-da41-3a3a-ae35bb4895f3@allwinnertech.com
    Signed-off-by: Michael Wu <michael@allwinnertech.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tracing: Fix resource leak on mmiotrace trace_pipe close [+ + +]
Author: deepakraog <gaikwad.dcg@gmail.com>
Date:   Wed Jul 15 20:06:04 2026 +0530

    tracing: Fix resource leak on mmiotrace trace_pipe close
    
    commit c1d87e724ae55e781b7cc7ccafb34d9e668582b2 upstream.
    
    The mmiotrace tracer was added May 12th 2008. At that time, resources
    created in pipe_open() could not be freed because there was not
    pipe_close function pointer of the tracer. The pipe_close function pointer
    was added in December 7th, 2009, but the mmiotrace tracer was not updated.
    
    mmio_pipe_open() allocates a header_iter and takes a pci_dev reference
    when trace_pipe is opened. mmio_close() frees them, but it was only
    wired to the tracer's .close callback.
    
    tracing_release_pipe() invokes .pipe_close, not .close, when the
    trace_pipe file is released. As a result, closing trace_pipe with the
    mmiotrace tracer active leaked the header_iter allocation and left a
    stale pci_dev reference.
    
    Set .pipe_close to mmio_close, matching how function_graph wires both
    callbacks to the same handler.
    
    Note, if the trace_pipe is read to completion, it will clean up the
    resources, but if one were to run:
    
      # head -n 1 /sys/kernel/tracing/trace_pipe
     VERSION 20070824
    
    Over and over again, it would trigger a massive leak.
    
    Cc: stable@vger.kernel.org
    Fixes: c521efd1700a8 ("tracing: Add pipe_close interface)
    Link: https://patch.msgid.link/20260715143604.14481-1-gaikwad.dcg@gmail.com
    Signed-off-by: deepakraog <gaikwad.dcg@gmail.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
udp: fix potential use-after-free in tunnel segmentation [+ + +]
Author: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Date:   Thu Jul 30 17:35:54 2026 +0800

    udp: fix potential use-after-free in tunnel segmentation
    
    [ Upstream commit d0f86fb36eb260abd10007b62c9dcc1028e03e61 ]
    
    __skb_udp_tunnel_segment() gets the UDP header before ensuring the
    tunnel header is in the skb head. If the pull reallocates skb->head,
    the saved UDP header pointer is no longer valid.
    
    Get the UDP header after the pull to avoid a potential use-after-free.
    
    Fixes: dbef491ebe7f ("udp: Use uh->len instead of skb->len to compute checksum in segmentation")
    Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
    Reviewed-by: Antoine Tenart <atenart@kernel.org>
    Link: https://patch.msgid.link/20260730093554.68127-1-xuanqiang.luo@linux.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
um: vector: fix use-after-free in vector_mmsg_rx() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon Jun 22 08:47:22 2026 -0400

    um: vector: fix use-after-free in vector_mmsg_rx()
    
    commit af421e9aed3920c7ac88c24daa48606c7112feca upstream.
    
    When vector_mmsg_rx() discards a packet whose overlay header fails
    verify_header(), it frees the skb and continues the loop:
    
            if (header_check < 0) {
                    dev_kfree_skb_irq(skb);
                    vp->estats.rx_encaps_errors++;
                    continue;
            }
    
    The normal and short-packet paths fall through to the bottom of the
    loop body, which clears the consumed slot and advances the cursors:
    
            (*skbuff_vector) = NULL;
            mmsg_vector++;
            skbuff_vector++;
    
    The verify_header() < 0 path skips that via continue, so the freed skb
    is left in skbuff_vector[] and the cursors do not advance. The next
    iteration reads the same slot, gets the freed skb, and frees it again,
    producing a refcount underflow / use-after-free in the RX path.
    
    Discard the slot the same way the other paths do before continuing.
    
    Only transports whose verify_header() can return negative are affected:
    GRE and L2TPv3 do so on a cookie/session-id mismatch (raw/tap do not),
    so any peer on such a transport can trigger it without authentication.
    
    Fixes: 49da7e64f33e ("High Performance UML Vector Network Driver")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: atm: cxacru: properly kill rcv_urb on error in cxacru_cm() [+ + +]
Author: Aleksandr Nogikh <nogikh@google.com>
Date:   Fri Jul 31 10:15:20 2026 +0000

    usb: atm: cxacru: properly kill rcv_urb on error in cxacru_cm()
    
    commit c2f811314be351d86b6ab41e9297ae80d8da6f86 upstream.
    
    If cxacru_cm() encounters an error while submitting or waiting for snd_urb,
    it aborts and returns the error without killing the already submitted
    rcv_urb. This leaves the rcv_urb active.
    
    When this happens during initialization (e.g., in cxacru_atm_start()), the
    driver may ignore the error and proceed to call cxacru_poll_status(), which
    invokes cxacru_cm() again. Attempting to submit the still-active rcv_urb
    triggers a warning in usb_submit_urb():
    
    cxacru 1-1:1.0: send of cm 0x84 failed (-104)
    ATM dev 0: cxacru_atm_start: CHIP_ADSL_LINE_START returned -104
    ------------[ cut here ]------------
    URB ffff88812658d200 submitted while active
    WARNING: drivers/usb/core/urb.c:379 at usb_submit_urb+0x79/0x18b0
    drivers/usb/core/urb.c:379
    ...
    Call Trace:
     <TASK>
     cxacru_cm+0x21a/0xf10 drivers/usb/atm/cxacru.c:631
     cxacru_cm_get_array drivers/usb/atm/cxacru.c:722 [inline]
     cxacru_poll_status+0x178/0x1110 drivers/usb/atm/cxacru.c:828
     cxacru_atm_start+0x185/0x360 drivers/usb/atm/cxacru.c:814
     usbatm_atm_init+0x144/0x3a0 drivers/usb/atm/usbatm.c:927
     usbatm_usb_probe+0x15cb/0x1db0 drivers/usb/atm/usbatm.c:1178
     cxacru_usb_probe+0x17f/0x220 drivers/usb/atm/cxacru.c:1370
    ...
    
    To fix this, ensure that rcv_urb is properly killed if cxacru_cm() aborts
    early. We can safely call usb_kill_urb() on rcv_urb in the error path, as
    it is safe to call even if the URB is not active (e.g., if it failed to
    submit in the first place, or if it already completed).
    
    Fixes: 1b0e61465234 ("[PATCH] USB ATM: driver for the Conexant AccessRunner chipset cxacru")
    Cc: stable <stable@kernel.org>
    Assisted-by: Gemini:gemini-3.5-flash Gemini:gemini-3.1-pro-preview syzbot
    Reported-by: syzbot+c9dff578c3a41775176a@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=c9dff578c3a41775176a
    Link: https://syzkaller.appspot.com/ai_job?id=75fec6f2-c8a6-43b1-b184-4d26baba86cc
    Signed-off-by: Aleksandr Nogikh <nogikh@google.com>
    Link: https://patch.msgid.link/91edfa4c-a63d-400c-9f00-31f3e1f98c00@mail.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: atm: ueagle-atm: reject descriptors that confuse probe and disconnect [+ + +]
Author: Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
Date:   Fri Jul 17 02:07:04 2026 -0600

    usb: atm: ueagle-atm: reject descriptors that confuse probe and disconnect
    
    [ Upstream commit 71132cedd1ecbc4032d76e9928c18a10f7e39b80 ]
    
    uea_probe() distinguishes a pre-firmware device from a post-firmware one
    using the USB id (UEA_IS_PREFIRM()), and stores a different object as the
    interface data in each case: a 'struct completion' for a pre-firmware
    device (to be waited on in .disconnect()), or a 'struct usbatm_data' for a
    post-firmware one.
    
    uea_disconnect() instead tells the two apart by the number of interfaces
    of the active configuration (a pre-firmware device exposes a single
    interface, ADI930 has 2 and eagle has 3), and casts the interface data
    accordingly.
    
    Because the two handlers use different criteria, a crafted device that
    advertises a pre-firmware id together with a multi-interface descriptor
    (or a post-firmware id with a single interface) makes them disagree: the
    small 'struct completion' stored by uea_probe() is then passed to
    usbatm_usb_disconnect(), which casts it to 'struct usbatm_data' and takes
    instance->serialize, reading past the end of the allocation:
    
      BUG: KASAN: slab-out-of-bounds in __mutex_lock+0x152a/0x1b80
      Read of size 8 at addr ffff8880470e2c60 by task kworker/1:2/982
      ...
       __mutex_lock+0x152a/0x1b80
       usbatm_usb_disconnect+0x70/0x820
       uea_disconnect+0x133/0x2c0
       usb_unbind_interface+0x1dd/0x9e0
      ...
      which belongs to the cache kmalloc-96 of size 96
      The buggy address is located 0 bytes to the right of
       allocated 96-byte region [ffff8880470e2c00, ffff8880470e2c60)
    
    Reject such inconsistent descriptors in uea_probe() so that both handlers
    always make the same pre/post-firmware decision.
    
    Reported-by: syzbot+e62a973f8322b3bbe3ac@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=e62a973f8322b3bbe3ac
    Fixes: e2674dfbed8a ("usb: atm: ueagle-atm: wait for pre-firmware load in .disconnect()")
    Signed-off-by: Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
    Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
    Link: https://patch.msgid.link/20260717080704.1264-1-diegomancera.dev@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: cdnsp: fix incorrect endian conversions for APB timeout register [+ + +]
Author: Pawel Laszczak <pawell@cadence.com>
Date:   Mon Jul 20 13:11:58 2026 +0200

    usb: cdnsp: fix incorrect endian conversions for APB timeout register
    
    commit 50b303f3d0f7de543ee90d50879970783d06da33 upstream.
    
    readl() already returns a CPU-endian value. Passing its return value to
    le32_to_cpu() is therefore redundant and causes an incorrect double byte
    swap on big-endian systems.
    
    Similarly, writel() expects a CPU-endian value, so passing the result of
    cpu_to_le32() is incorrect.
    
    Remove the unnecessary conversions and operate on the MMIO register value
    as a CPU-endian u32.
    
    Fixes: 241e2ce88e5a ("usb: cdnsp: Fix issue with resuming from L1")
    Suggested-by: Arnd Bergmann <arnd@arndb.de>
    Cc: stable <stable@kernel.org>
    Signed-off-by: Pawel Laszczak <pawell@cadence.com>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Link: https://patch.msgid.link/20260720-endian-fix-v1-v1-1-b5681fa1ea9f@cadence.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: chipidea: fix usage_count leak when autosuspend_delay is negative [+ + +]
Author: Xu Yang <xu.yang_2@nxp.com>
Date:   Thu Jul 16 18:41:26 2026 +0800

    usb: chipidea: fix usage_count leak when autosuspend_delay is negative
    
    commit fc3afb5728e297994863f8a2a01b88a920bbf53e upstream.
    
    The probe() calls pm_runtime_use_autosuspend(), but remove() does not call
    pm_runtime_dont_use_autosuspend(). This can lead to a usage_count leak if
    autosuspend_delay is set to a negative value.
    
    The pm_runtime_use_autosuspend() also notes that it's important to undo
    this with pm_runtime_dont_use_autosuspend() at driver exit time.
    
    Fixes: 1f874edcb731 ("usb: chipidea: add runtime power management support")
    Cc: stable <stable@kernel.org>
    Assisted-by: Claude:claude-sonnet-4.6
    Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Link: https://patch.msgid.link/20260716104126.2763454-1-xu.yang_2@oss.nxp.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: dummy_hcd: prevent fifo_req reuse during giveback [+ + +]
Author: Jinchao Wang <wangjinchao600@gmail.com>
Date:   Thu Jul 16 06:42:17 2026 -0400

    usb: gadget: dummy_hcd: prevent fifo_req reuse during giveback
    
    commit d5e5cd3654d2b5359a12ea6586120f05b28634ee upstream.
    
    dummy_hcd embeds a single shared usb_request (dum->fifo_req) that the
    "emulated single-request FIFO" fast-path in dummy_queue() reuses for
    small IN transfers: it copies the caller's request into it
    (req->req = *_req) and queues it, treating list_empty(&fifo_req.queue)
    as "the slot is free".
    
    The completion side (dummy_timer/transfer/nuke/dummy_dequeue) follows
    the standard pattern: list_del_init(&req->queue) unlinks the request,
    then the lock is dropped and usb_gadget_giveback_request() invokes
    req->complete().  But list_del_init() makes fifo_req.queue look empty
    *before* the completion callback returns, so a concurrent dummy_queue()
    on another CPU sees the slot as free, reuses fifo_req and runs
    req->req = *_req -- overwriting req->complete while dummy_timer is
    mid-calling it.  The indirect call then jumps to a clobbered pointer,
    causing a general protection fault / page fault in dummy_timer
    (syzkaller extid faf3a6cf579fc65591ca).  The clobbering write is an
    in-bounds memcpy on a live shared object, so KASAN cannot flag it.
    
    Add a fifo_req_busy bit covering the shared request's whole lifetime:
    set it in dummy_queue() when the FIFO fast-path takes fifo_req (making
    it the fast-path guard, replacing the list_empty(&fifo_req.queue)
    test), and clear it after the completion callback has returned, via a
    dummy_giveback() helper used at all four gadget-request giveback
    sites.  The shared slot can no longer be reused until its completion
    callback has finished.
    
    Reported-by: syzbot+faf3a6cf579fc65591ca@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=faf3a6cf579fc65591ca
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Jinchao Wang <wangjinchao600@gmail.com>
    Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
    Link: https://patch.msgid.link/5db8bba5b3499a86cd2e776f9918126b68b2508b.1784198306.git.wangjinchao600@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: f_midi: cancel pending IN work before freeing the midi object [+ + +]
Author: Fan Wu <fanwu01@zju.edu.cn>
Date:   Thu Jul 9 15:07:17 2026 +0000

    usb: gadget: f_midi: cancel pending IN work before freeing the midi object
    
    commit 5650c18d93a1db7e27cb5a40b394747eb4686d5b upstream.
    
    The f_midi driver embeds a work item (midi->work) whose handler,
    f_midi_in_work(), dereferences the enclosing struct f_midi through
    container_of().  This work is armed from two sites: f_midi_complete(),
    on a normal IN-endpoint completion, and f_midi_in_trigger(), on an ALSA
    rawmidi output-stream start.
    
    Neither f_midi_disable() nor f_midi_unbind() cancels midi->work.
    f_midi_disable() only disables the endpoints and drains the in_req_fifo;
    it does not synchronize the work item, and the sound card is released
    asynchronously to the final free of the midi object.
    
    The midi object is reference-counted (midi->free_ref) and is freed in
    f_midi_free() only once both the usb_function reference and the rawmidi
    private_data reference have been dropped.  In f_midi_unbind(),
    f_midi_disable() runs before the sound card is released, so while the
    USB endpoints are already disabled the rawmidi device is still usable by
    an open substream.  A concurrent userspace write on such a substream can
    reach f_midi_in_trigger() and queue midi->work again after
    f_midi_disable() has returned.  A work item armed this way may still be
    pending when the last reference drops and f_midi_free() proceeds to
    kfree(midi), letting f_midi_in_work() dereference the struct after it
    has been freed, a use-after-free.
    
    For this reason cancelling midi->work in f_midi_disable() would not be
    sufficient: the ALSA trigger path can rearm the work after disable()
    returns.  Cancelling at the refcount-zero free site is the boundary
    after which neither arming source can survive, because by then both
    references that keep the midi object alive have been dropped: the USB
    endpoints are already disabled and the rawmidi device has been released.
    
    Fix this by calling cancel_work_sync(&midi->work) in the refcount-zero
    block of f_midi_free(), before the embedded work_struct is freed along
    with the rest of the structure.  opts->lock is a sleeping mutex, so
    calling cancel_work_sync() under it is permitted, and the handler takes
    midi->transmit_lock rather than opts->lock, so no self-deadlock can
    occur while it waits for a running instance of the work to finish.
    
    This issue was found by an in-house static analysis tool.
    
    Fixes: 8653d71ce3763 ("usb/gadget: f_midi: Replace tasklet with work")
    Cc: stable <stable@kernel.org>
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
    Link: https://patch.msgid.link/20260709150717.399083-1-fanwu01@zju.edu.cn
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: f_ncm: Use unsigned int for ndp_index [+ + +]
Author: Sonali Pradhan <sonalipradhan@google.com>
Date:   Mon Jul 20 16:56:54 2026 +0000

    usb: gadget: f_ncm: Use unsigned int for ndp_index
    
    commit 6b1c8a9403a26cb0fed7a648916c74dc236da591 upstream.
    
    The variable ndp_index is declared as a signed integer, but it stores
    the return value of get_ncm(), which is unsigned.
    
    A malicious host can supply a large offset that overflows the signed
    ndp_index, making it negative. Because ndp_index is compared against
    unsigned bounds, this negative value bypasses sanity checks and leads
    to an out-of-bounds read when calculating the address of the NDP
    block (ntb_ptr + ndp_index).
    
    Fix this by changing ndp_index to unsigned int to ensure consistent
    unsigned comparisons throughout the function.
    
    Fixes: 370af734dfaf ("usb: gadget: NCM: RX function support multiple NDPs")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Sonali Pradhan <sonalipradhan@google.com>
    Link: https://patch.msgid.link/20260720165654.2224591-1-sonalipradhan@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: f_ncm: validate datagram bounds in ncm_unwrap_ntb() [+ + +]
Author: Sonali Pradhan <sonalipradhan@google.com>
Date:   Fri Jul 3 08:37:24 2026 +0000

    usb: gadget: f_ncm: validate datagram bounds in ncm_unwrap_ntb()
    
    commit 1febec7e47cdcd01f43fb0211094e3010474666e upstream.
    
    When unpacking host-supplied NTBs, ncm_unwrap_ntb() checks datagram length
    against frame_max but does not verify that the datagram fits within the
    declared block length. Additionally, when decoding multiple NTBs from a
    single socket buffer, subsequent block lengths are not checked against the
    actual remaining buffer data.
    
    With these checks missing, a malicious USB host can specify datagram
    offsets and lengths that point beyond the block, or supply secondary NTB
    headers declaring lengths larger than the buffer. skb_put_data() then
    copies adjacent kernel memory from skb_shared_info into the network skb.
    
    Fix this by verifying that sufficient buffer space remains for the NTB
    header before parsing, handling zero-length block declarations, ensuring
    that block lengths never exceed the remaining buffer space, and verifying
    that each datagram payload stays strictly within the block boundary.
    
    Fixes: 427694cfaafa ("usb: gadget: ncm: Handle decoding of multiple NTB's in unwrap call")
    Fixes: 2b74b0a04d3e ("USB: gadget: f_ncm: add bounds checks to ncm_unwrap_ntb()")
    Cc: stable <stable@kernel.org>
    Assisted-by: Jetski:Gemini-2.5-Pro
    Signed-off-by: Sonali Pradhan <sonalipradhan@google.com>
    Link: https://patch.msgid.link/20260703083725.1903850-1-sonalipradhan@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
USB: gadget: fsl-udc: fix device name leak on probe failure [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jul 2 16:15:33 2026 +0200

    USB: gadget: fsl-udc: fix device name leak on probe failure
    
    commit 6b874d00c466e73c6448a89856407fe46b2f50e4 upstream.
    
    The gadget device name is set by UDC core when registering the gadget
    and must not be set before to avoid leaking the name in intermediate
    error paths (e.g. on dma pool creation failure).
    
    Fixes: eab35c4e6d95 ("usb: gadget: fsl_udc_core: let udc-core manage gadget->dev")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260702141536.90887-2-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: gadget: printer: fix infinite loop in printer_read() [+ + +]
Author: Melbin K Mathew <mlbnkm1@gmail.com>
Date:   Thu Jul 9 21:56:22 2026 +0100

    usb: gadget: printer: fix infinite loop in printer_read()
    
    commit c2e819be6a5c7f34344926b4bd7e3dfca58cf48a upstream.
    
    printer_read() uses the same variable for the requested copy size and
    the number of bytes actually copied to user space. copy_to_user()
    returns the number of bytes not copied, so when it fails to copy
    anything, the computed copied length becomes zero.
    
    In that case len, buf, current_rx_bytes and current_rx_buf are left
    unchanged. If RX data is available and the user buffer remains
    unwritable, the read loop can repeat indefinitely.
    
    Track the copied length separately and return -EFAULT, or the number of
    bytes already copied, if an iteration makes no progress.
    
    Fixes: b185f01a9ab7 ("usb: gadget: printer: factor out f_printer")
    Cc: stable <stable@kernel.org>
    Reviewed-by: Peter Chen <peter.chen@kernel.org>
    Signed-off-by: Melbin K Mathew <mlbnkm1@gmail.com>
    Link: https://patch.msgid.link/20260709205622.55700-1-mlbnkm1@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
USB: gadget: snps-udc: fix device name leak on probe failure [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jul 2 16:15:34 2026 +0200

    USB: gadget: snps-udc: fix device name leak on probe failure
    
    commit 29a142d3e8b35ebc9e0bcc78f4bc26c9b6a9ac0b upstream.
    
    The gadget device name is set by UDC core when registering the gadget
    and must not be set before to avoid leaking the name in intermediate
    error paths (e.g. when detecting an older chip revision).
    
    Fixes: 12ad0fcaf2fb ("usb: gadget: amd5536udc: let udc-core manage gadget->dev")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260702141536.90887-3-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: gadget: udc: bdc: free IRQ and drain func_wake_notify before teardown [+ + +]
Author: Fan Wu <fanwu01@zju.edu.cn>
Date:   Thu Jul 9 02:09:04 2026 +0000

    usb: gadget: udc: bdc: free IRQ and drain func_wake_notify before teardown
    
    commit 0583f2fbf8f86ae3a0ce054f96783dd83e65d9bb upstream.
    
    The Broadcom BDC UDC driver registers its IRQ handler with
    devm_request_irq() in bdc_udc_init(), so the IRQ is released by devm
    only after bdc_remove() returns.  devm releases resources in reverse
    LIFO order, but bdc_remove() runs bdc_udc_exit() and bdc_hw_exit() ->
    bdc_mem_free() manually before returning: bdc_udc_exit() tears down
    individual endpoint objects via bdc_free_ep(), while bdc_hw_exit() ->
    bdc_mem_free() frees and NULLs the DMA-coherent status-report ring
    (bdc->srr.sr_bds) and kfree()s bdc->bdc_ep_array.  Both happen while
    the IRQ handler (bdc_udc_interrupt, requested with IRQF_SHARED)
    remains deliverable in the window up to the post-remove devm
    free_irq().
    
    On receipt of a shared interrupt in that window, bdc_udc_interrupt()
    dereferences bdc->srr.sr_bds[bdc->srr.dqp_index] (NULL or freed DMA)
    and dispatches sr_handler callbacks that index into bdc_ep_array,
    causing a NULL-deref or use-after-free.
    
    The same window affects the delayed_work bdc->func_wake_notify, which is
    armed from the IRQ handler via bdc_sr_uspc() -> handle_link_state_change()
    -> schedule_delayed_work() and may self-rearm from its own callback
    bdc_func_wake_timer().  No cancel exists anywhere in the driver, so a
    queued work item that fires after bdc_remove() returns and the bdc
    structure is devm-freed dereferences freed memory.
    
    Replace devm_request_irq() with request_irq() and add an explicit
    free_irq(bdc->irq, bdc) in bdc_remove().  Clear BDC_GIE before
    free_irq() to stop the device from asserting interrupts, then
    free_irq() drains any in-flight handler, then cancel_delayed_work_sync()
    drains the func_wake_notify delayed work.  This ordering ensures the
    IRQ handler and delayed work cannot interfere with the subsequent
    endpoint and DMA teardown in bdc_udc_exit() and bdc_hw_exit().  Wire the
    matching free_irq() into the bdc_udc_init() error path so the IRQ is
    released on probe failure, and route the bdc_init_ep() failure through
    err0 instead of returning directly.
    
    This issue was found by an in-house static analysis tool.
    
    Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC")
    Cc: stable <stable@kernel.org>
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
    Link: https://patch.msgid.link/20260709020904.502611-1-fanwu01@zju.edu.cn
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: uvc: clamp SEND_RESPONSE length to the response buffer [+ + +]
Author: Muhammad Bilal <meatuni001@gmail.com>
Date:   Tue Jun 30 00:50:04 2026 +0500

    usb: gadget: uvc: clamp SEND_RESPONSE length to the response buffer
    
    commit b70dc75e85ba968b7b76eebfe5d63000080b875b upstream.
    
    uvc_send_response() builds the UVC control response from a user-supplied
    struct uvc_request_data:
    
            req->length = min_t(unsigned int, uvc->event_length, data->length);
            ...
            memcpy(req->buf, data->data, req->length);
    
    req->length is clamped to uvc->event_length, which is taken from the
    host control request wLength (up to UVC_MAX_REQUEST_SIZE, 64), and to
    data->length, which comes from the UVCIOC_SEND_RESPONSE ioctl and is
    only checked for being negative.  The source buffer data->data is only
    60 bytes, so a response with uvc->event_length and data->length both
    greater than 60 makes memcpy() read past the end of data->data.
    
    Clamp req->length to sizeof(data->data) as well.
    
    Fixes: a5eaaa1f33e7 ("usb: gadget: uvc: use capped length value")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
    Link: https://patch.msgid.link/20260629195004.148405-1-meatuni001@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
USB: serial: ftdi_sio: add support for E+H FXA291 [+ + +]
Author: Tim Pambor <timpambor@gmail.com>
Date:   Sat Jul 11 17:36:30 2026 +0000

    USB: serial: ftdi_sio: add support for E+H FXA291
    
    commit fad0fd120e29041b3e6cdf41bb12e3184fb524a2 upstream.
    
    The Commubox FXA291 by Endress+Hauser AG is a USB serial converter
    based on FT232B which is used to communicate with field devices.
    
    It enumerates using the FTDI vendor ID and a custom PID.
    
    usb 1-9: New USB device found, idVendor=0403, idProduct=e510, bcdDevice= 4.00
    usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 1-9: Product: FXA291
    usb 1-9: Manufacturer: Endress+Hauser
    usb 1-9: SerialNumber: 00000000
    ftdi_sio 1-9:1.0: FTDI USB Serial Device converter detected
    usb 1-9: Detected FT232B
    usb 1-9: FTDI USB Serial Device converter now attached to ttyUSB0
    
    Signed-off-by: Tim Pambor <timpambor@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: io_edgeport: cap received transmit credits [+ + +]
Author: Sunho Park <shpark061104@gmail.com>
Date:   Tue Jul 14 19:42:30 2026 +0900

    USB: serial: io_edgeport: cap received transmit credits
    
    commit faaddd811c5099f11a5f52e68a6b31a5898cda4f upstream.
    
    The interrupt-status packet reports transmit credits returned by the
    device. edge_interrupt_callback() adds the 16-bit value to txCredits
    without checking maxTxCredits.
    
    edge_write() uses txCredits minus the software FIFO count as the amount
    of data that fits. Since the FIFO is allocated with maxTxCredits bytes,
    txCredits exceeding maxTxCredits can cause OOB write in ring buffer.
    
    Cap accumulated credits at maxTxCredits. Conforming devices should never
    hit the cap.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Assisted-by: Codex:GPT-5
    Signed-off-by: Sunho Park <shpark061104@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: keyspan_pda: fix data loss on receive throttling [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed Jul 8 16:31:35 2026 +0200

    USB: serial: keyspan_pda: fix data loss on receive throttling
    
    commit 42a97c0480f96a2977e6d51ce512adc780f1ef5d upstream.
    
    Killing the interrupt-in urb when the line disciple requests throttling
    may lead to data loss if an ongoing transfer is cancelled.
    
    Instead set a flag to prevent the completion handler from resubmitting
    the urb until the port is unthrottled.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: add TDTECH MT5710-CN [+ + +]
Author: Chukun Pan <amadeus@jmu.edu.cn>
Date:   Wed Jul 8 18:00:01 2026 +0800

    USB: serial: option: add TDTECH MT5710-CN
    
    commit 55645e4f3c6022ffb160ad3617d2b624eaa38501 upstream.
    
    Add support for the TDTECH MT5710-CN (5G redcap) module based on the
    Huawei HiSilicon Balong chip.
    
    T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
    D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=3466 ProdID=3301 Rev=ff.ff
    S:  Manufacturer=TD Tech Ltd.
    S:  Product=TDTECH MT571X
    S:  SerialNumber=0123456789ABCDEF
    C:* #Ifs= 6 Cfg#= 1 Atr=c0 MxPwr=  0mA
    A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0d Prot=00
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver=cdc_ncm
    E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver=cdc_ncm
    I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver=cdc_ncm
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=13 Driver=option
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=12 Driver=option
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=1c Driver=option
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=14 Driver=option
    E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    Interface: ECM / NCM + DIAG + AT + SERIAL + GPS
    
    Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: storage: add NO_ATA_1X quirk for Longmai USB Key [+ + +]
Author: Huang Wei <huangwei@kylinos.cn>
Date:   Thu Jul 16 11:33:41 2026 +0800

    USB: storage: add NO_ATA_1X quirk for Longmai USB Key
    
    commit 3b4ca2e01c1dd8c00b675b794732945f460a471b upstream.
    
    The Longmai Technologies USB Key (0x04b4:0xb708) advertises itself as a
    SCSI/Bulk-only mass storage device but does not correctly handle ATA
    pass-through commands. When such a command (ATA_12 or ATA_16) is sent to
    the device it fails to respond and the transfer eventually times out,
    leaving the device unusable.
    
    Add an unusual_devs entry for this device that sets the US_FL_NO_ATA_1X
    flag, so usb-storage short-circuits ATA pass-through commands and returns
    INVALID COMMAND OPERATION CODE (0x20 0x05 0x24 0x00) instead of forwarding
    them to the device.
    
    Information about the device in /sys/kernel/debug/usb/devices:
    
    T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 12 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=06 Prot=50 MxPS=64 #Cfgs=  1
    P:  Vendor=04b4 ProdID=b708 Rev= 1.00
    S:  Manufacturer=Longmai Technologies
    S:  Product=USB Key
    C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    Reported-by: Ai Chao <aichao@kylinos.cn>
    Cc: stable <stable@kernel.org>
    Signed-off-by: Huang Wei <huangwei@kylinos.cn>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Link: https://patch.msgid.link/20260716033341.2830872-1-huangwei@kylinos.cn
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: xhci-pci: Limit VIA VL805 DMA addressing to 36 bits [+ + +]
Author: Xincheng Zhang <zhangxincheng@ultrarisc.com>
Date:   Tue Jul 28 10:25:14 2026 +0800

    usb: xhci-pci: Limit VIA VL805 DMA addressing to 36 bits
    
    commit 1fc50f1ecde39feb4fccdaf4bc71aa6c0eb25c49 upstream.
    
    The VIA VL805/806 xHCI controller advertises AC64, but fails to handle
    DMA addresses at or above 0x1000000000. On systems with large amounts of
    RAM, this can cause USB device failures when the controller is given DMA
    addresses beyond its usable address width.
    
    Do not use XHCI_NO_64BIT_SUPPORT for this controller. That quirk clears
    the cached AC64 capability and limits DMA to 32 bits, causing unnecessary
    bouncing for addresses between 4GiB and 64GiB and hiding the controller's
    real AC64 capability from code that may need to distinguish register
    access width from usable DMA address width.
    
    Track the usable DMA address width separately from the AC64 capability.
    Initialize the generic xhci->dma_mask_bits field to 64 and let PCI quirks
    reduce it for controllers with narrower DMA support. Set VIA VL805/806 to
    36 bits so the DMA API only hands it addresses in the range it can handle
    while keeping HCCPARAMS1.AC64 visible.
    
    Cc: stable@kernel.org
    Signed-off-by: Xincheng Zhang <zhangxincheng@ultrarisc.com>
    Link: https://patch.msgid.link/20260630-xhci-via-dma-fix-v3-1-690dcb8cf75a@ultrarisc.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
vhost/vdpa: reject overflowing PA map page counts on 32-bit [+ + +]
Author: Yousef Alhouseen <alhouseenyousef@gmail.com>
Date:   Wed Jun 24 15:02:02 2026 -0700

    vhost/vdpa: reject overflowing PA map page counts on 32-bit
    
    [ Upstream commit 0619aaa34c0c2a2dcb07f0e9c8a34e7efb8c4cdf ]
    
    vhost_vdpa_pa_map() adds the IOVA page offset to the user-controlled map
    size before computing the number of pages to pin. On 32-bit systems,
    where unsigned long is narrower than u64, that addition can overflow and
    the code can pin and map fewer pages than the requested IOTLB range.
    
    Reject sizes that overflow the unsigned long page-count calculation.
    
    Fixes: 22af48cf91aa ("vdpa: factor out vhost_vdpa_pa_map() and vhost_vdpa_pa_unmap()")
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Message-ID: <CAMuQ4bX-iDvcUOPPY+NLz95tkRJYwWqvzAr=U48uNaub_HZLGw@mail.gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
vhost: reset the vring metadata cache on vring reconfiguration [+ + +]
Author: Jun Yang <junvyyang@tencent.com>
Date:   Mon Aug 3 09:45:14 2026 +0800

    vhost: reset the vring metadata cache on vring reconfiguration
    
    commit de845981da67a6b049080c87e605130b0c30adc5 upstream.
    
    vq->meta_iotlb[] caches the vhost_iotlb_map that backs each vring
    metadata region, and iotlb_access_ok() returns early on a cache hit,
    taking the hit as proof that the region has already been validated:
    
            if (vhost_vq_meta_fetch(vq, addr, len, type))
                    return true;
    
    The cache is reset on VHOST_IOTLB_UPDATE and VHOST_IOTLB_INVALIDATE, on
    device IOTLB (re)initialisation and on vq reset, but not when
    VHOST_SET_VRING_ADDR replaces vq->desc, vq->avail and vq->used, nor when
    VHOST_SET_VRING_NUM changes the region sizes.
    
    With a device IOTLB attached both ioctls are accepted while the vq is
    live, and neither validates the addresses at ioctl time: vq_access_ok()
    and vq_log_used_access_ok() return true early because the addresses are
    GIOVAs, deferring validation to prefetch time.  Once the cache has been
    populated that deferred validation no longer runs -- vq_meta_prefetch()
    hits the stale entry and returns true -- and vhost_vq_meta_fetch() keeps
    translating through the old mapping as
    
            map->addr + addr - map->start
    
    for an address the mapping no longer covers.  vhost_copy_to_user() and
    vhost_copy_from_user() consume the result with __copy_to_user() and
    __copy_from_user(), which do not check it either, so a subsequent used
    ring update or descriptor fetch accesses memory outside the region the
    IOTLB actually maps.
    
    Reset the metadata cache whenever the vring is reconfigured, so the new
    addresses are pushed back through iotlb_access_ok()'s slow path.
    
    Fixes: f88949138058 ("vhost: introduce O(1) vq metadata cache")
    Cc: stable@vger.kernel.org
    Assisted-by: tencentos-corvus-ai:kimi-k3
    Signed-off-by: Jun Yang <junvyyang@tencent.com>
    Message-ID: <20260803014823.68623-1-juny24602@gmail.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
vmxnet3: fix BUG_ON in vmxnet3_get_hdr_len() for Geneve packets [+ + +]
Author: Harshaka Narayana <harshaka.narayana@broadcom.com>
Date:   Mon Jul 13 07:09:15 2026 -0700

    vmxnet3: fix BUG_ON in vmxnet3_get_hdr_len() for Geneve packets
    
    [ Upstream commit 34a71f5361fc3adb5b7138da78750b0d535a8252 ]
    
    vmxnet3_get_hdr_len() assumes gdesc->rcd.v4/v6/tcp always describe the
    outer header, but for a Geneve-encapsulated packet the device can set
    them based on the inner header instead, signalled by the
    VMXNET3_RCD_HDR_INNER_SHIFT bit in the completion descriptor. Since the
    function never skips the outer encapsulation, this mismatch triggers:
    
    - BUG_ON(hdr.ipv4->protocol != IPPROTO_TCP), because the outer
      protocol is UDP (Geneve), not TCP.
    - BUG_ON(hdr.eth->h_proto != ...), when the tunnel's outer and inner
      IP versions differ (e.g. outer IPv6/inner IPv4 or vice versa).
    
    Check VMXNET3_RCD_HDR_INNER_SHIFT up front and bail out, since the
    function cannot locate the inner header it would need to parse. Also
    convert the remaining BUG_ON()s in this function to return 0
    defensively.
    
    Fixes: 45dac1d6ea04 ("vmxnet3: Changes for vmxnet3 adapter version 2 (fwd)")
    Signed-off-by: Harshaka Narayana <harshaka.narayana@broadcom.com>
    Reviewed-by: Ronak Doshi <ronak.doshi@broadcom.com>
    Reviewed-by: Sankararaman Jayaraman <sankararaman.jayaraman@broadcom.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260713140915.3381715-1-harshaka.narayana@broadcom.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
vsock/virtio: avoid refilling the RX queue after teardown [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Wed Jul 29 12:16:55 2026 -0700

    vsock/virtio: avoid refilling the RX queue after teardown
    
    commit a31e0ad444698d8aa7534a0f89fda543730f97a5 upstream.
    
    Commit b917507e5ad9 ("vsock/virtio: stop workers during the .remove()")
    made the RX worker jump to its common exit when rx_run is clear.  That
    exit still refills the RX queue when the buffer count is low, so work
    queued across virtio_vsock_vqs_del() can add buffers after the virtqueues
    have been deleted.
    
    BUG: KASAN: slab-use-after-free in virtqueue_add_sgs
    Read of size 4 by task kworker/0:1
    Workqueue: virtio_vsock virtio_transport_rx_work
    Call Trace:
     virtqueue_add_sgs (drivers/virtio/virtio_ring.c:2796)
     virtio_vsock_rx_fill (net/vmw_vsock/virtio_transport.c:332)
     virtio_transport_rx_work (net/vmw_vsock/virtio_transport.c:701)
     process_one_work (kernel/workqueue.c:3314)
     worker_thread (kernel/workqueue.c:3478)
     kthread (kernel/kthread.c:436)
     ret_from_fork (arch/x86/kernel/process.c:158)
     ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
    ...
    Freed by task 141:
     kfree (mm/slub.c:6566)
     vp_del_vq (drivers/virtio/virtio_pci_common.c:259)
     vp_del_vqs (drivers/virtio/virtio_pci_common.c:285)
     virtio_vsock_freeze (net/vmw_vsock/virtio_transport.c:912)
     virtio_device_freeze (drivers/virtio/virtio.c:658)
     virtio_pci_freeze (drivers/virtio/virtio_pci_common.c:601)
     pci_pm_freeze (drivers/pci/pci-driver.c:1098)
     device_suspend (drivers/base/power/main.c:1968)
    Kernel panic - not syncing: KASAN: panic_on_warn set ...
    
    Jump to a no-refill exit when rx_run is clear, leaving the normal exit
    to replenish a running queue.
    
    Fixes: b917507e5ad9 ("vsock/virtio: stop workers during the .remove()")
    Cc: stable@vger.kernel.org
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Link: https://lore.kernel.org/r/20260727035804.1860862-1-bestswngs@gmail.com
    Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
    Link: https://patch.msgid.link/f9c8c1d64cad9d262f305d02ffe164c2f900fadf.1785352330.git.bestswngs@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

vsock/virtio: read virtqueues under worker locks [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Wed Jul 29 12:16:54 2026 -0700

    vsock/virtio: read virtqueues under worker locks
    
    commit ebac8f6b1ef0e9278afe204b8692a7479988dace upstream.
    
    Commit bd50c5dc182b ("vsock/virtio: add support for device
    suspend/resume") made the *_run flags transition from false to true when
    restore installs replacement virtqueues.  The RX, TX and event workers
    read their virtqueue before locking and checking the corresponding flag,
    so a worker delayed across freeze and restore can observe the replacement
    queue's running state while retaining a pointer to the deleted queue.
    
    Read each virtqueue under its mutex after checking the run flag, keeping
    the pointer and state in the same queue generation.
    
    Fixes: bd50c5dc182b ("vsock/virtio: add support for device suspend/resume")
    Cc: stable@vger.kernel.org
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Link: https://lore.kernel.org/r/20260727035804.1860862-1-bestswngs@gmail.com
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
    Link: https://patch.msgid.link/e79f68ad9284c983364fc3ac46904b6d9ef50231.1785352330.git.bestswngs@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
vt: add permission check for KDSKBMETA ioctl [+ + +]
Author: Joshua Rogers <linux@joshua.hu>
Date:   Fri Jul 31 09:56:17 2026 +0200

    vt: add permission check for KDSKBMETA ioctl
    
    commit a7ad0034453ba4c353f9b8f810ee2569de33d283 upstream.
    
    KDSKBMETA modifies keyboard meta mode but lacks the !perm check that all
    other keyboard setter ioctls in vt_k_ioctl() enforce, allowing a process
    to change meta mode on a non-controlling console without authorization.
    
    Assisted-by: AISLE:Snapshot
    Cc: stable <stable@kernel.org>
    Signed-off-by: Joshua Rogers <linux@joshua.hu>
    Link: https://patch.msgid.link/20260731-tty-vt-stuff-v1-2-be99b9da8e30@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

vt: stabilize tty reference in kbd_keycode with tty_port_tty_get [+ + +]
Author: Joshua Rogers <linux@joshua.hu>
Date:   Fri Jul 31 09:56:16 2026 +0200

    vt: stabilize tty reference in kbd_keycode with tty_port_tty_get
    
    commit e25d47a526939ad44b75f778b8a7500562b84fc1 upstream.
    
    kbd_keycode() reads vc->port.tty without acquiring a tty reference,
    racing against con_shutdown() which clears port.tty under a different
    lock. Use tty_port_tty_get()/tty_kref_put() to hold a proper reference
    for the duration the tty pointer is needed.
    
    Assisted-by: AISLE:Snapshot
    Signed-off-by: Joshua Rogers <linux@joshua.hu>
    Cc: stable <stable@kernel.org>
    Link: https://patch.msgid.link/20260731-tty-vt-stuff-v1-1-be99b9da8e30@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
vxlan: do not arm the ageing timer on a device that is down [+ + +]
Author: Baul Lee <baul.lee@xbow.com>
Date:   Sun Aug 9 20:18:29 2026 +0900

    vxlan: do not arm the ageing timer on a device that is down
    
    commit b37971686ec59fb027fa4910ba16805e68fddb97 upstream.
    
    vxlan_changelink() arms vxlan->age_timer whenever the requested ageing
    interval differs from the configured one:
    
            if (conf.age_interval != vxlan->cfg.age_interval)
                    mod_timer(&vxlan->age_timer, jiffies);
    
    There is no netif_running() test, so the timer is armed even on a device
    that was never brought up.  The only synchronous cancel in the driver is
    the timer_delete_sync() in vxlan_stop(), which is .ndo_stop.
    netif_close_many() drops devices without IFF_UP before
    __dev_close_many() runs, so that cancel is skipped for such a device.
    
    vxlan_setup() sets dev->needs_free_netdev = true and age_timer is a
    member of struct vxlan_dev, so free_netdev() releases the allocation the
    timer lives in while it is still queued on a timer_base.
    expire_timers() unlinks the entry before it loads timer->function, so
    the timer core writes through the freed object's list pointers:
    
      BUG: KASAN: slab-use-after-free in __run_timers+0x208/0x654
      Write of size 8 at addr ffff00001adace68 by task true/192
       __asan_store8+0x84/0xac
       __run_timers+0x208/0x654
       run_timer_softirq+0x154/0x18c
      Allocated by task 189:
       alloc_netdev_mqs+0x64/0x720
       rtnl_create_link+0x4ac/0x520
       rtnl_newlink+0x758/0xd00
      Freed by task 191:
       netdev_release+0x40/0x58
       netdev_run_todo+0x4a4/0x8c0
       rtnl_dellink+0x200/0x4e8
    
    The rtnl operations involved are netns-scoped, so an unprivileged user
    can perform them in a new user and network namespace.
    
    Arming the timer on a down device never had an effect: vxlan_cleanup()
    returns early on !netif_running(), and vxlan_open() arms the timer for
    any non-zero interval once the device is brought up.  Add the missing
    test.
    
    Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
    
    Fixes: 40051c4dcad5 ("vxlan: Allow changing ageing time")
    Cc: stable@vger.kernel.org
    Signed-off-by: Baul Lee <baul.lee@xbow.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260809111829.78834-1-baul.lee@xbow.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

vxlan: re-fetch eth header after route_shortcircuit() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jul 23 14:42:45 2026 +0000

    vxlan: re-fetch eth header after route_shortcircuit()
    
    commit 1395a676ec15a0a02a2a6d86602324f2d5fd41d5 upstream.
    
    Before route_shortcircuit(), the eth header pointer is cached from eth_hdr(skb).
    
    Inside route_shortcircuit(), pskb_may_pull() can be called, which may
    reallocate skb->head.
    
    In this case, returning to vxlan_xmit() leaves the cached eth pointer pointing to
    freed memory, leading to a use-after-free when dereferencing eth->h_dest.
    
    Fix this by updating eth = eth_hdr(skb) after calling route_shortcircuit().
    
    Fixes: ae8840825605 ("VXLAN: Allow L2 redirection with L3 switching")
    Cc: stable@vger.kernel.org
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Link: https://patch.msgid.link/20260723144249.759100-2-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

vxlan: require CAP_NET_ADMIN in the device netns for changelink [+ + +]
Author: Doruk Tan Ozturk <doruk@0sec.ai>
Date:   Thu Jul 16 22:34:59 2026 +0200

    vxlan: require CAP_NET_ADMIN in the device netns for changelink
    
    commit 3a61bd9637f3d929aa846e4eb3d98b48c26fcb0e upstream.
    
    A tunnel changelink() operates on at most two netns, dev_net(dev) and
    the sticky underlay netns vxlan->net. They differ once the device is
    created in or moved to a netns other than the one the request runs in.
    The rtnl changelink path checks CAP_NET_ADMIN only against dev_net(dev),
    so a caller privileged there but not in vxlan->net can rewrite a vxlan
    device whose underlay lives in vxlan->net.
    
    vxlan_changelink() validates and applies the new configuration against
    vxlan->net (vxlan_config_validate(vxlan->net, ...)) and can reopen the
    underlay socket in that netns, so the same reasoning as the tunnel
    changelink series applies here.
    
    Gate vxlan_changelink() with rtnl_dev_link_net_capable(), at the top of
    the op before any attribute is parsed, matching ipgre_changelink() and
    the rest of the "require CAP_NET_ADMIN in the device netns for
    changelink" series.
    
    Found by 0sec automated security-research tooling (https://0sec.ai).
    
    Fixes: 8bcdc4f3a20b ("vxlan: add changelink support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Link: https://patch.msgid.link/20260716203500.70573-2-doruk@0sec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

vxlan: unclone skb head before modifying eth header in route_shortcircuit() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jul 23 14:42:46 2026 +0000

    vxlan: unclone skb head before modifying eth header in route_shortcircuit()
    
    commit 760d36e737f2b3867762f42af36c663f55babcc4 upstream.
    
    When route_shortcircuit() performs L3 short-circuit routing, it modifies
    the Ethernet header of the skb in-place:
        memcpy(eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, dev->addr_len);
        memcpy(eth_hdr(skb)->h_dest, n->ha, dev->addr_len);
    
    If the incoming skb is cloned (for example by packet sockets, tcpdump, or
    dev_queue_xmit), modifying the Ethernet header without uncloning can corrupt
    the packet header for other readers holding a reference to the cloned skb.
    
    Ensure the skb header is writable and unshared by calling skb_cow_head(skb, 0)
    prior to updating the Ethernet header. If skb_cow_head() fails, abort short-circuiting
    and return false to allow standard packet processing fallback.
    
    Fixes: e4f67addf158 ("add DOVE extensions for VXLAN")
    Cc: stable@vger.kernel.org
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20260723144249.759100-3-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

vxlan: use neigh_ha_snapshot() in route_shortcircuit() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jul 23 14:42:47 2026 +0000

    vxlan: use neigh_ha_snapshot() in route_shortcircuit()
    
    commit 8eca411347e1d38964f9ed2c8d3b6ab0e7e4473d upstream.
    
    The neighbour hardware address n->ha can be updated asynchronously by the
    neighbour subsystem, protected by n->ha_lock seqlock. Reading n->ha without
    holding the seqlock loop can lead to torn reads or reading a partially updated
    MAC address.
    
    Use neigh_ha_snapshot() in route_shortcircuit() to safely copy n->ha under
    read_seqbegin()/read_seqretry() lock protection before using it.
    
    Note that arp_reduce() and neigh_reduce() seem to have the same issue
    left for future patches.
    
    Fixes: e4f67addf158 ("add DOVE extensions for VXLAN")
    Cc: stable@vger.kernel.org
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Link: https://patch.msgid.link/20260723144249.759100-4-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

vxlan: use pskb_network_may_pull() in route_shortcircuit() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jul 23 14:42:48 2026 +0000

    vxlan: use pskb_network_may_pull() in route_shortcircuit()
    
    commit 26bb2dd0a8839617e2c79ffbbe1923f8e4bab9fb upstream.
    
    route_shortcircuit() currently calls pskb_may_pull(skb, sizeof(struct iphdr))
    (or ipv6hdr), which checks if bytes are available starting from skb->data.
    
    However, in vxlan_xmit(), skb->data points to the MAC header, so
    skb_network_offset(skb) is ETH_HLEN (14 bytes). Using pskb_may_pull(skb, 20)
    only checks 20 bytes from skb->data (which is 14 bytes MAC header + 6 bytes of
    IP header), leaving the rest of the IP header potentially un-pulled in non-linear
    frags. Subsequent dereferences of ip_hdr(skb)->daddr can read beyond the pulled
    linear buffer length.
    
    Fix this by using pskb_network_may_pull(), which adds skb_network_offset(skb) to
    the length check to ensure the full network header is present in the linear buffer.
    
    Fixes: e4f67addf158 ("add DOVE extensions for VXLAN")
    Cc: stable@vger.kernel.org
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Link: https://patch.msgid.link/20260723144249.759100-5-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
wan: wanxl: Only reset hardware after BAR mapping [+ + +]
Author: Ruoyu Wang <ruoyuw560@gmail.com>
Date:   Wed Jul 8 22:34:15 2026 +0800

    wan: wanxl: Only reset hardware after BAR mapping
    
    [ Upstream commit 91957b89da995607cb654b1f9a3c126ddbaee10f ]
    
    wanxl_pci_init_one() stores the freshly allocated card in driver data
    before the PLX BAR is mapped.  Several early probe failures then unwind
    through wanxl_pci_remove_one(), including failure to allocate the coherent
    status area or to restore the DMA mask.
    
    wanxl_pci_remove_one() unconditionally calls wanxl_reset(), and
    wanxl_reset() dereferences card->plx.  On those early failures card->plx
    is still NULL, so the error path can dereference a NULL MMIO pointer.
    
    Only issue the hardware reset once the BAR mapping exists.  The remaining
    cleanup in wanxl_pci_remove_one() already checks whether later resources
    were allocated.
    
    This issue was found by a static analysis checker and confirmed by
    manual source review.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
    Link: https://patch.msgid.link/20260708143415.3169358-1-ruoyuw560@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
watchdog: pretimeout: Fix UAF in watchdog_unregister_governor() [+ + +]
Author: Tzung-Bi Shih <tzungbi@kernel.org>
Date:   Tue Jul 7 10:18:03 2026 +0000

    watchdog: pretimeout: Fix UAF in watchdog_unregister_governor()
    
    [ Upstream commit 7362ba0f9c96ac3ad6a2ca3995bd9fc9a28a8661 ]
    
    When a watchdog governor is unregistered, it updates existing watchdog
    devices that were using this governor by falling back to `default_gov`.
    
    If the governor being unregistered is currently set as `default_gov`,
    the `default_gov` is never cleared.  This leads to 2 use-after-free
    issues:
    1. New watchdog devices registered after this point will inherit the
       dangling `default_gov`.
    2. Existing watchdog devices using the unregistered governor will have
       their `wdd->gov` reassigned to the dangling `default_gov`.
    
    Fix the UAF by clearing `default_gov` if it matches the governor being
    unregistered.
    
    Fixes: da0d12ff2b82 ("watchdog: pretimeout: add panic pretimeout governor")
    Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
    Link: https://lore.kernel.org/r/20260707101803.3598173-1-tzungbi@kernel.org
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
wifi: at76c50x-usb: avoid length underflow in at76_guess_freq() [+ + +]
Author: Huihui Huang <hhhuang@smu.edu.sg>
Date:   Wed Jul 15 22:08:10 2026 +0800

    wifi: at76c50x-usb: avoid length underflow in at76_guess_freq()
    
    commit 61a799ffd1e5a4fd3702d547828b7ff3d161468e upstream.
    
    at76_guess_freq() checks only that the received frame is at least a bare
    802.11 header (24 bytes) before subtracting the fixed management-body
    offset:
    
            len -= el_off;
    
    For both beacon and probe response frames, el_off is 36. If the frame is
    shorter than el_off, subtracting it causes the calculated IE length to
    wrap. The length is eventually passed to cfg80211_find_elem_match() as a
    very large unsigned value, so the element walk runs beyond the RX skb.
    
    This path is reached from at76_rx_tasklet() while scanning. If the device
    delivers a truncated beacon or probe response, the oversized IE length
    causes an out-of-bounds read during scanning.
    
    Skip the IE lookup if the frame does not reach the variable elements,
    before subtracting el_off.
    
    Fixes: 1264b951463a ("at76c50x-usb: add driver")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Huihui Huang <hhhuang@smu.edu.sg>
    Link: https://patch.msgid.link/20260715140815.1242033-1-hhhuang@smu.edu.sg
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: ath11k: fix potential buffer underflow in ath11k_hal_rx_msdu_list_get() [+ + +]
Author: Dmitry Morgun <d.morgun@ispras.ru>
Date:   Sat May 30 11:42:52 2026 +0000

    wifi: ath11k: fix potential buffer underflow in ath11k_hal_rx_msdu_list_get()
    
    [ Upstream commit 7f11e70629650ff6ea140984e5ce188b775b2683 ]
    
    When the first entry in msdu_details has a zero buffer address,
    the code accesses msdu_details[i - 1] with i == 0, causing a
    buffer underflow.
    
    Fix similarly to ath12k_wifi7_hal_rx_msdu_list_get() by adding
    a separate check for i == 0 before the main condition to prevent
    the out-of-bounds access.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
    Signed-off-by: Dmitry Morgun <d.morgun@ispras.ru>
    Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
    Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260530114252.42615-1-d.morgun@ispras.ru
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ath6kl: fix OOB access from firmware ADDBA window size [+ + +]
Author: Tristan Madani <tristan@talencesecurity.com>
Date:   Thu Jul 2 00:50:20 2026 +0000

    wifi: ath6kl: fix OOB access from firmware ADDBA window size
    
    commit 44126b6994eeb28f2103b638e698f40a1244f327 upstream.
    
    aggr_recv_addba_req_evt() logs a debug message when the firmware-supplied
    win_sz is outside [AGGR_WIN_SZ_MIN, AGGR_WIN_SZ_MAX] but does not
    return. The out-of-range win_sz is then used in TID_WINDOW_SZ() to
    compute a kzalloc size and stored in rxtid->hold_q_sz, leading to
    zero-size or overflowed allocations and subsequent out-of-bounds access.
    
    Clean up any previously active aggregation session for the TID first,
    then return early when win_sz is out of the valid range, instead of
    proceeding with a broken allocation size.
    
    Fixes: bdcd81707973 ("Add ath6kl cleaned up driver")
    Cc: stable@vger.kernel.org
    Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
    Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
    Link: https://patch.msgid.link/20260702005020.708717-1-tristmd@gmail.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: ath6kl: fix OOB read from firmware IE lengths in connect event [+ + +]
Author: Tristan Madani <tristan@talencesecurity.com>
Date:   Tue Apr 21 13:50:08 2026 +0000

    wifi: ath6kl: fix OOB read from firmware IE lengths in connect event
    
    [ Upstream commit 6b47b29730de3232b919d8362749f6814c5f2a33 ]
    
    The firmware-controlled beacon_ie_len, assoc_req_len, and assoc_resp_len
    fields in ath6kl_wmi_connect_event_rx() are not validated against the
    buffer length. Their sum (up to 765) can exceed the actual WMI event
    data, causing out-of-bounds reads during IE parsing and state corruption
    of wmi->is_wmm_enabled.
    
    Add a check that the total IE length fits within the buffer.
    
    Fixes: bdcd81707973 ("Add ath6kl cleaned up driver")
    Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
    Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260421135009.348084-3-tristmd@gmail.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ath6kl: fix OOB read from firmware num_msg in TX complete handler [+ + +]
Author: Tristan Madani <tristan@talencesecurity.com>
Date:   Thu Jun 25 23:29:07 2026 +0000

    wifi: ath6kl: fix OOB read from firmware num_msg in TX complete handler
    
    [ Upstream commit 3a21c89215cc18f1a97c5e5bfd1da6d4f3d44495 ]
    
    The firmware-controlled num_msg field (u8, 0-255) drives the loop in
    ath6kl_wmi_tx_complete_event_rx() without validation against the buffer
    length. This allows out-of-bounds reads of up to 1020 bytes past the
    WMI event buffer when the firmware sends an inflated num_msg.
    
    Add a check that the buffer is large enough to hold the fixed struct
    and the num_msg variable-length entries.
    
    Fixes: bdcd81707973 ("Add ath6kl cleaned up driver")
    Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
    Link: https://patch.msgid.link/20260625232907.3620746-1-tristmd@gmail.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ath9k: hif_usb: don't dereference hif_dev after re-arming firmware request [+ + +]
Author: Cheng Yongkang <teel4res@gmail.com>
Date:   Fri Jun 5 08:32:10 2026 -0700

    wifi: ath9k: hif_usb: don't dereference hif_dev after re-arming firmware request
    
    [ Upstream commit dad9f96945d77ecd4708f730c06ef54dcd8cc057 ]
    
    ath9k_hif_request_firmware() re-arms an asynchronous firmware load via
    request_firmware_nowait(), passing hif_dev as the completion context, and
    then still dereferences hif_dev:
    
            dev_info(&hif_dev->udev->dev, "ath9k_htc: Firmware %s requested\n",
                     hif_dev->fw_name);
    
    The re-armed callback ath9k_hif_usb_firmware_cb() runs on the "events"
    workqueue and, when the firmware is missing, walks the retry chain into
    ath9k_hif_usb_firmware_fail() -> complete_all(&hif_dev->fw_done). That
    releases the wait_for_completion(&hif_dev->fw_done) in a concurrent
    ath9k_hif_usb_disconnect(), which then kfree()s hif_dev. The trailing
    dev_info() in the frame that re-armed the request can therefore read freed
    memory (hif_dev->udev, the first field of struct hif_device_usb):
    
      BUG: KASAN: slab-use-after-free in ath9k_hif_request_firmware
      Read of size 8 ... by task kworker/...
       ath9k_hif_request_firmware
       ath9k_hif_usb_firmware_cb           drivers/net/wireless/ath/ath9k/hif_usb.c:1247
       request_firmware_work_func
      Allocated by ...:
       ath9k_hif_usb_probe                 drivers/net/wireless/ath/ath9k/hif_usb.c
      Freed by ...:
       ath9k_hif_usb_disconnect -> kfree   drivers/net/wireless/ath/ath9k/hif_usb.c
    
    The fw_done barrier only makes disconnect wait for the firmware chain to
    *terminate*; it does not protect the outer ath9k_hif_request_firmware()
    frame that re-armed the request and keeps touching hif_dev afterwards.
    
    Drop the post-request dev_info(): it is the only use of hif_dev after the
    async request is armed, and it is purely informational (the dev_err() on the
    failure path runs only when request_firmware_nowait() did not arm a callback,
    so hif_dev is still alive there).
    
    This was first reported by syzbot as a single, non-reproduced crash that was
    later auto-obsoleted, and was independently rediscovered by the reFuzz fuzzer,
    which produced a C reproducer (USB-gadget connect/disconnect of an ath9k_htc
    device whose firmware download fails). The vulnerable code is unchanged and
    still present in v7.1-rc6, where the slab-use-after-free reproduces under KASAN
    once the (sub-microsecond) race window is widened.
    
    Fixes: e904cf6fe230 ("ath9k_htc: introduce support for different fw versions")
    Reported-by: syzbot+50122cbc2874b1eb25b0@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=50122cbc2874b1eb25b0
    Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
    Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
    Link: https://patch.msgid.link/20260605153210.20471-1-1020691186@qq.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: brcmfmac: fix 802.1X-SHA256 call trace warning [+ + +]
Author: Shelley Yang <shelley.yang@infineon.com>
Date:   Mon May 25 16:38:59 2026 +0800

    wifi: brcmfmac: fix 802.1X-SHA256 call trace warning
    
    [ Upstream commit 7cb34f6c4fe8a68af621d870abe63bfca2275dd6 ]
    
    Based on wpa_auth as 1x_256 mode, need to set up
    "use_fwsup" with BRCMF_PROFILE_FWSUP_1X.
    Or it will happen trace warning when call brcmf_cfg80211_set_pmk().
    
    [ 4481.831101] ------------[ cut here ]------------
    [ 4481.831102] WARNING: CPU: 1 PID: 2997 at
    drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:7242 brcmf_cfg80211_set_pmk+0x77/0xd0 [brcmfmac]
    [...]
    [ 4481.831202] Call Trace:
    [ 4481.831204]  <TASK>
    [ 4481.831205]  nl80211_set_pmk+0x183/0x250 [cfg80211]
    [ 4481.831233]  genl_family_rcv_msg_doit+0xea/0x150
    [ 4481.831237]  genl_rcv_msg+0x104/0x240
    [ 4481.831239]  ? cfg80211_probe_status+0x2c0/0x2c0 [cfg80211]
    [ 4481.831257]  ? genl_family_rcv_msg_doit+0x150/0x150
    [ 4481.831259]  netlink_rcv_skb+0x4e/0x100
    [ 4481.831261]  genl_rcv+0x24/0x40
    [ 4481.831262]  netlink_unicast+0x236/0x380
    [ 4481.831264]  netlink_sendmsg+0x250/0x4b0
    [ 4481.831266]  sock_sendmsg+0x5c/0x70
    [ 4481.831269]  ____sys_sendmsg+0x236/0x2b0
    [ 4481.831271]  ? copy_msghdr_from_user+0x6d/0xa0
    [ 4481.831272]  ___sys_sendmsg+0x86/0xd0
    [ 4481.831274]  ? avc_has_perm+0x8c/0x1a0
    [ 4481.831276]  ? preempt_count_add+0x6a/0xa0
    [ 4481.831279]  ? sock_has_perm+0x82/0xa0
    [ 4481.831280]  __sys_sendmsg+0x57/0xa0
    [ 4481.831282]  do_syscall_64+0x38/0x90
    [ 4481.831284]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
    [ 4481.831286] RIP: 0033:0x7fd270d369b4
    
    Fixes: 2526ff21aa77 ("brcmfmac: support 4-way handshake offloading for 802.1X")
    Signed-off-by: Shelley Yang <shelley.yang@infineon.com>
    Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Link: https://patch.msgid.link/20260525083859.581246-1-shelley.yang@infineon.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: brcmfmac: initialize SDIO data work before cleanup [+ + +]
Author: Runyu Xiao <runyu.xiao@seu.edu.cn>
Date:   Fri Jun 19 14:44:01 2026 +0800

    wifi: brcmfmac: initialize SDIO data work before cleanup
    
    [ Upstream commit 2a665946e0407a05a3f81bd56a08553c446498e0 ]
    
    brcmf_sdio_probe() stores the newly allocated bus in sdiodev->bus before
    allocating the ordered workqueue. If that allocation fails, the function
    jumps to fail and calls brcmf_sdio_remove().
    
    brcmf_sdio_remove() unconditionally cancels bus->datawork. Initialize the
    work item before the first failure path that can reach brcmf_sdio_remove(),
    so the cleanup path always observes a valid work object.
    
    This issue was found by our static analysis tool and then confirmed by
    manual review of the probe error path and the remove-time work drain. The
    problem pattern is an early setup failure that reaches a cleanup helper
    which cancels an embedded work item before its initializer has run.
    
    A QEMU PoC forced alloc_ordered_workqueue() to fail at the same point in
    brcmf_sdio_probe(), before INIT_WORK(&bus->datawork) is reached. The
    resulting fail path calls brcmf_sdio_remove(), and DEBUG_OBJECTS reports
    the invalid work drain with brcmf_sdio_probe() and brcmf_sdio_remove() in
    the stack.
    
    Fixes: 9982464379e8 ("brcmfmac: make sdio suspend wait for threads to freeze")
    Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
    Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Link: https://patch.msgid.link/20260619064401.1048976-1-runyu.xiao@seu.edu.cn
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: brcmfmac: make release_scratchbuffers idempotent [+ + +]
Author: Fan Wu <fanwu01@zju.edu.cn>
Date:   Sat Jul 18 02:43:52 2026 +0000

    wifi: brcmfmac: make release_scratchbuffers idempotent
    
    commit 538c51e9d124cf656f2dd0c0394a8545efc7102d upstream.
    
    brcmf_pcie_release_scratchbuffers() frees the shared.scratch and
    shared.ringupd DMA buffers with dma_free_coherent() but does not clear
    the pointers afterwards, unlike the sibling release_ringbuffers() which
    NULLs commonrings/flowrings/idxbuf on release.
    
    Both the bus_reset .reset callback (brcmf_pcie_reset) and
    brcmf_pcie_remove() call release_scratchbuffers.  When reset teardown
    has run before removal, remove's own teardown would call
    dma_free_coherent() a second time on the already-freed DMA allocation.
    
    NULL the pointers after free, matching release_ringbuffers(), so a later
    release observes that the allocation has already been released.  This
    patch makes repeated sequential release safe; the reset-work lifetime is
    handled separately by the following patch.
    
    This issue was found by an in-house static analysis tool.
    
    Fixes: 4684997d9eea ("brcmfmac: reset PCIe bus on a firmware crash")
    Cc: stable@vger.kernel.org
    Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
    Assisted-by: Codex:gpt-5.6
    Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Link: https://patch.msgid.link/20260718024353.3147201-2-fanwu01@zju.edu.cn
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: carl9170: bound memcpy length in cmd callback to prevent OOB read [+ + +]
Author: Tristan Madani <tristan@talencesecurity.com>
Date:   Tue Apr 21 13:49:26 2026 +0000

    wifi: carl9170: bound memcpy length in cmd callback to prevent OOB read
    
    [ Upstream commit 4cde55b2feff9504d1f993ab80e84e7ccb62791c ]
    
    When the firmware sends a command response with a length mismatch,
    carl9170_cmd_callback() logs the mismatch and calls carl9170_restart()
    but then falls through to memcpy(ar->readbuf, buffer + 4, len - 4).
    Since len comes from the firmware and can exceed ar->readlen, this
    copies more data than the readbuf was allocated for.
    
    Bound the memcpy to min(len - 4, ar->readlen) so that the response
    is still completed -- avoiding repeated restarts from queued garbage --
    while preventing an overread past the response buffer.
    
    Fixes: a84fab3cbfdc ("carl9170: 802.11 rx/tx processing and usb backend")
    Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
    Acked-by: Christian Lamparter <chunkeey@gmail.com>
    Closes: https://syzkaller.appspot.com/bug?extid=5c1ca6ccaa1215781cac
    Link: https://patch.msgid.link/20260421134929.325662-2-tristmd@gmail.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: carl9170: fix buffer overflow in rx_stream failover path [+ + +]
Author: Tristan Madani <tristan@talencesecurity.com>
Date:   Tue Apr 21 13:49:28 2026 +0000

    wifi: carl9170: fix buffer overflow in rx_stream failover path
    
    [ Upstream commit a1a21995c2e1cc2ca6b2226cfe4f5f018370182a ]
    
    The failover continuation in carl9170_rx_stream() copies the full tlen
    from the second USB transfer instead of capping at rx_failover_missing
    bytes. When both transfers are near maximum size, the total exceeds the
    65535-byte failover SKB, triggering skb_over_panic.
    
    Limit the copy size to the missing byte count.
    
    Fixes: a84fab3cbfdc ("carl9170: 802.11 rx/tx processing and usb backend")
    Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
    Acked-by: Christian Lamparter <chunkeey@gmail.com>
    Closes: https://syzkaller.appspot.com/bug?extid=5c1ca6ccaa1215781cac
    Link: https://patch.msgid.link/20260421134929.325662-4-tristmd@gmail.com
    [Fix checkpatch CHECK:PARENTHESIS_ALIGNMENT]
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: carl9170: fix OOB read from off-by-two in TX status handler [+ + +]
Author: Tristan Madani <tristan@talencesecurity.com>
Date:   Tue Apr 21 13:49:27 2026 +0000

    wifi: carl9170: fix OOB read from off-by-two in TX status handler
    
    [ Upstream commit a3f42f1049ad80c65560d2b078ad426c3134f78d ]
    
    The bounds check in carl9170_tx_process_status() uses
    `i > ((cmd->hdr.len / 2) + 1)` which is off by two, allowing
    2 extra iterations past valid _tx_status entries when the firmware-
    controlled hdr.ext exceeds hdr.len/2. Fix by using the correct
    comparison `i >= (cmd->hdr.len / 2)`.
    
    Fixes: a84fab3cbfdc ("carl9170: 802.11 rx/tx processing and usb backend")
    Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
    Acked-by: Christian Lamparter <chunkeey@gmail.com>
    Closes: https://syzkaller.appspot.com/bug?extid=5c1ca6ccaa1215781cac
    Link: https://patch.msgid.link/20260421134929.325662-3-tristmd@gmail.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: cfg80211: bound element ID read when checking non-inheritance [+ + +]
Author: HE WEI (ギカク) <skyexpoc@gmail.com>
Date:   Tue Jul 7 18:48:28 2026 +0900

    wifi: cfg80211: bound element ID read when checking non-inheritance
    
    [ Upstream commit cb8afea4655ff004fa7feee825d5c79783525383 ]
    
    cfg80211_is_element_inherited() reads the first data octet of the
    candidate element (id = elem->data[0]) to look it up in an extension
    non-inheritance list. It does so after testing elem->id, but without
    verifying that the element actually has a data octet. A zero-length
    extension element (WLAN_EID_EXTENSION with length 0) therefore makes it
    read one octet past the end of the element.
    
    _ieee802_11_parse_elems_full() runs this check for every element of a
    frame once a non-inheritance context exists -- e.g. while parsing a
    per-STA profile of a Multi-Link element in a (re)association response,
    or a non-transmitted BSS profile -- so a crafted frame from an AP can
    trigger a one-octet slab-out-of-bounds read during element parsing:
    
      BUG: KASAN: slab-out-of-bounds in cfg80211_is_element_inherited
      Read of size 1 ... in net/wireless/scan.c
    
    Return early (treat the element as inherited) when an extension element
    carries no data, mirroring the existing handling of empty ID lists.
    
    The bug was found by fuzzing ieee802_11_parse_elems_full() under KASAN.
    
    Fixes: f7dacfb11475 ("cfg80211: support non-inheritance element")
    Signed-off-by: HE WEI (ギカク) <skyexpoc@gmail.com>
    Link: https://patch.msgid.link/20260707094828.16465-1-skyexpoc@gmail.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: cfg80211: cancel sched scan results work on unregister [+ + +]
Author: Cen Zhang <zzzccc427@gmail.com>
Date:   Sat Jun 20 00:25:42 2026 +0800

    wifi: cfg80211: cancel sched scan results work on unregister
    
    [ Upstream commit edf0730be33696a1bd142792830d392129e495cc ]
    
    cfg80211_sched_scan_results() can queue rdev->sched_scan_res_wk from a
    driver result notification while a scheduled scan request is present. The
    work callback recovers the containing cfg80211_registered_device and then
    locks the wiphy and walks the scheduled-scan request list.
    
    wiphy_unregister() already makes the wiphy unreachable and drains rdev work
    items before cfg80211_dev_free() can release the object, but it does not
    drain sched_scan_res_wk. A queued or running result work item can therefore
    cross the unregister/free boundary and access freed rdev state.
    
    The buggy scenario involves two paths, with each column showing the order
    within that path:
    
    scheduled-scan result path:        unregister/free path:
    1. cfg80211_sched_scan_results()   1. interface teardown stops and
       queues rdev->sched_scan_res_wk.    removes the scheduled scan request.
    2. cfg80211_wq starts the work     2. wiphy_unregister() drains other
       item and recovers rdev.            rdev work items.
    3. The worker locks rdev->wiphy    3. cfg80211_dev_free() destroys and
       and walks rdev state.              frees rdev.
    
    Cancel sched_scan_res_wk in wiphy_unregister() alongside the other rdev
    work items. cancel_work_sync() removes a pending result notification and
    waits for an already running callback, so cfg80211_dev_free() cannot free
    rdev while this work item is still active.
    
    Validation reproduced this kernel report:
    BUG: KASAN: use-after-free in cfg80211_sched_scan_results_wk+0x4a6/0x530
    Workqueue: cfg80211 cfg80211_sched_scan_results_wk [cfg80211]
    Read of size 8
    Call trace:
      dump_stack_lvl+0x66/0xa0
      print_report+0xce/0x630
      cfg80211_sched_scan_results_wk+0x4a6/0x530
      srso_alias_return_thunk+0x5/0xfbef5
      __virt_addr_valid+0x224/0x430
      kasan_report+0xac/0xe0
      lockdep_hardirqs_on_prepare+0xea/0x1a0
      process_one_work+0x8d0/0x18f0 (kernel/workqueue.c:3212)
      lock_is_held_type+0x8f/0x100
      worker_thread+0x5ad/0xfd0
      __kthread_parkme+0xc6/0x200
      kthread+0x31e/0x410
      trace_hardirqs_on+0x1a/0x170
      ret_from_fork+0x576/0x810
      __switch_to+0x57e/0xe20
      __switch_to_asm+0x33/0x70
      ret_from_fork_asm+0x1a/0x30
    
    Fixes: 807f8a8c3004 ("cfg80211/nl80211: add support for scheduled scans")
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
    Link: https://patch.msgid.link/20260619162542.3878296-1-zzzccc427@gmail.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: cfg80211: reject unsupported PMSR FTM location requests [+ + +]
Author: Zhao Li <enderaoelyther@gmail.com>
Date:   Fri Jun 12 21:37:11 2026 +0800

    wifi: cfg80211: reject unsupported PMSR FTM location requests
    
    [ Upstream commit 69ef6a7ec277f16d216be8da2b3cbe872786c999 ]
    
    PMSR FTM location request flags are syntactically valid, but they must
    be rejected when the device capability does not advertise support for
    them.
    
    Return an error immediately after rejecting unsupported LCI or civic
    location request bits so the request cannot reach the driver.
    
    Fixes: 9bb7e0f24e7e7 ("cfg80211: add peer measurement with FTM initiator API")
    Assisted-by: Codex:gpt-5.5
    Assisted-by: Claude:claude-opus-4.8
    Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
    Link: https://patch.msgid.link/20260612133710.93544-2-enderaoelyther@gmail.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: cfg80211: validate PMSR FTM preamble range [+ + +]
Author: Zhao Li <enderaoelyther@gmail.com>
Date:   Fri Jun 12 21:37:04 2026 +0800

    wifi: cfg80211: validate PMSR FTM preamble range
    
    [ Upstream commit 36230936468f0ba4930e94aef496fc229d4bb951 ]
    
    PMSR FTM request parsing accepts preamble values outside the
    enumerated nl80211 preamble range.
    
    Reject out-of-range values before using them in the parser capability
    bit test using the policy.
    
    Fixes: 9bb7e0f24e7e7 ("cfg80211: add peer measurement with FTM initiator API")
    Assisted-by: Codex:gpt-5.5
    Assisted-by: Claude:claude-opus-4.8
    Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
    Link: https://patch.msgid.link/20260612133703.93274-2-enderaoelyther@gmail.com
    [drop unnecessary check]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: cfg80211: validate PMSR measurement type data [+ + +]
Author: Zhao Li <enderaoelyther@gmail.com>
Date:   Fri Jun 12 21:36:57 2026 +0800

    wifi: cfg80211: validate PMSR measurement type data
    
    [ Upstream commit 41aa973eb05922848dded26875c55ef982ac1c49 ]
    
    PMSR request parsing accepts missing or duplicated measurement type
    entries in NL80211_PMSR_REQ_ATTR_DATA.
    
    Track whether one measurement type was already provided, reject a
    second one immediately, and return an error if the request data block
    contains no measurement type at all.
    
    Fixes: 9bb7e0f24e7e7 ("cfg80211: add peer measurement with FTM initiator API")
    Assisted-by: Codex:gpt-5.5
    Assisted-by: Claude:claude-opus-4.8
    Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
    Link: https://patch.msgid.link/20260612133656.92900-2-enderaoelyther@gmail.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ipw2100: fix potential memory leak in ipw2100_pci_init_one() [+ + +]
Author: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Date:   Sat Jun 20 12:22:39 2026 +0530

    wifi: ipw2100: fix potential memory leak in ipw2100_pci_init_one()
    
    [ Upstream commit 0d388f62031dbabcba0f44bb91b59f10e88cac17 ]
    
    The memory allocated in the ipw2100_alloc_device() function is not freed
    in some of the error paths in ipw2100_pci_init_one(). Fix that by
    converting the direct return into a goto to the error path return.
    
    The error path when pci_enable_device() fails cannot jump to fail, since
    at this point priv is not set, so perform error handling inline.
    
    Fixes: 2c86c275015c ("Add ipw2100 wireless driver.")
    Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
    Link: https://patch.msgid.link/20260620065242.93798-1-nihaal@cse.iitm.ac.in
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: libertas: fix memory leak in helper_firmware_cb() [+ + +]
Author: Dawei Feng <dawei.feng@seu.edu.cn>
Date:   Wed Jun 24 16:53:43 2026 +0800

    wifi: libertas: fix memory leak in helper_firmware_cb()
    
    [ Upstream commit 63c2391deefb31e1b801b7f32bd502ca4808639b ]
    
    helper_firmware_cb() neglects to free the single-stage firmware image
    after a successful async load, leading to a memory leak in the USB
    firmware-download path.
    
    Fix this memory leak by calling release_firmware() immediately after
    lbs_fw_loaded() returns.
    
    The bug was first flagged by an experimental analysis tool we are
    developing for kernel memory-management bugs while analyzing
    v6.13-rc1. The tool is still under development and is not yet publicly
    available. Manual inspection confirms that the bug is still present in
    the current wireless tree.
    
    An x86_64 allyesconfig build showed no new warnings. As we do not have
    compatible Libertas USB hardware for exercising this firmware-download
    path, no runtime testing was able to be performed.
    
    Fixes: 1dfba3060fe7 ("libertas: move firmware lifetime handling to firmware.c")
    Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
    Link: https://patch.msgid.link/20260624085343.575508-1-dawei.feng@seu.edu.cn
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mac80211: free AP_VLAN bc_buf SKBs outside IRQ lock [+ + +]
Author: Cen Zhang <zzzccc427@gmail.com>
Date:   Mon Jul 6 22:08:41 2026 +0800

    wifi: mac80211: free AP_VLAN bc_buf SKBs outside IRQ lock
    
    [ Upstream commit f3858d5b1432098c1936e03d6e03dd0e33facf60 ]
    
    ieee80211_do_stop() removes AP_VLAN packets from the parent AP
    ps->bc_buf while holding ps->bc_buf.lock with IRQs disabled. It then
    calls ieee80211_free_txskb() before dropping the lock.
    
    ieee80211_free_txskb() is not just a passive SKB release. For SKBs with
    TX status state it can report a dropped frame through cfg80211/nl80211,
    and that path can reach netlink tap transmit. This is the same reason
    the pending queue cleanup in ieee80211_do_stop() already unlinks SKBs
    under the queue lock and frees them after IRQ state is restored.
    
    The buggy scenario involves two paths, with each column showing the
    order within that path:
    
    AP_VLAN management TX:             AP_VLAN stop:
    1. attach ACK-status state         1. clear the running state
    2. queue a multicast SKB on        2. take ps->bc_buf.lock with IRQs
       parent ps->bc_buf                  disabled
                                       3. unlink the AP_VLAN SKB
                                       4. call ieee80211_free_txskb()
    
    Unlink matching AP_VLAN SKBs from ps->bc_buf under the existing lock,
    but move them to a local free queue. Drop the lock and restore IRQ state
    before calling ieee80211_free_txskb().
    
    WARNING: kernel/softirq.c:430 at __local_bh_enable_ip
    
    Fixes: 397a7a24ef8c ("mac80211: free ps->bc_buf skbs on vlan device stop")
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
    Link: https://patch.msgid.link/20260706140841.581566-1-zzzccc427@gmail.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mac80211: recalculate TIM when a station enters power save [+ + +]
Author: Andrew Pope <andrew.pope@morsemicro.com>
Date:   Fri Jul 17 11:17:51 2026 +1000

    wifi: mac80211: recalculate TIM when a station enters power save
    
    [ Upstream commit a007a384c9eb17610f53a53e2f59944c31f1565a ]
    
    When an AP buffers frames for a station on its per-station TXQs and the
    station subsequently enters power save, sta_ps_start() records the
    buffered TIDs in txq_buffered_tids but does not update the TIM. The
    station's TIM bit is only ever set when a further frame is buffered
    while the station is already asleep
    (ieee80211_tx_h_unicast_ps_buf() -> sta_info_recalc_tim()).
    
    If no further downlink frame arrives for that station the beacon
    TIM never advertises the buffered traffic. A station relying on the
    TIM then remains in doze indefinitely on top of a non-empty queue. Its
    TXQs were removed from the scheduler's active list at PS entry, nothing
    pages it, and the flow deadlocks until an unrelated event wakes the
    station.
    
    Recalculate the TIM at the end of sta_ps_start(), so traffic
    already buffered at PS entry is advertised immediately.
    sta_info_recalc_tim() already consults txq_buffered_tids, which is
    updated above, and is safe in this context (it is already called
    from equivalent paths such as the tx handlers and
    ieee80211_handle_filtered_frame()).
    
    Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
    Signed-off-by: Andrew Pope <andrew.pope@morsemicro.com>
    Link: https://patch.msgid.link/20260717011751.79524-1-andrew.pope@morsemicro.com
    [add wifi: subject prefix]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mac80211: validate individual TWT params before driver setup [+ + +]
Author: Zhao Li <enderaoelyther@gmail.com>
Date:   Thu Jul 23 09:09:28 2026 +0800

    wifi: mac80211: validate individual TWT params before driver setup
    
    [ Upstream commit 0502d5077e419427d80f4d46ba95d0067f5fb916 ]
    
    ieee80211_process_rx_twt_action() only partially validates a received
    S1G TWT setup frame before queueing it.
    
    An individual agreement can therefore reach ieee80211_s1g_rx_twt_setup()
    with twt->length too short for the full struct ieee80211_twt_params.
    
    The individual path passes twt to drv_add_twt_setup(). Both the tracepoint
    and the driver callback consume the complete parameters block, not merely
    req_type. Do not pass a short individual agreement to the driver.
    Broadcast agreements remain unchanged because they are rejected locally
    after accessing only req_type.
    
    Fixes: f5a4c24e689f ("mac80211: introduce individual TWT support in AP mode")
    Assisted-by: Codex:gpt-5
    Assisted-by: Claude:opus-4.8
    Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
    Link: https://patch.msgid.link/20260723010928.76551-1-enderaoelyther@gmail.com
    [edit commit message to not overclaim lack of validation nor
     understate driver impact]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mac80211_hwsim: clamp virtio RX length before skb_put [+ + +]
Author: Bryam Vargas <hexlabsecurity@proton.me>
Date:   Sat Jun 20 21:45:18 2026 -0500

    wifi: mac80211_hwsim: clamp virtio RX length before skb_put
    
    [ Upstream commit 10a2b430f8f06ae14b9590b6f6faa6b588ef0654 ]
    
    hwsim_virtio_rx_work() passes the virtqueue used-ring length reported by
    the device straight to skb_put() on a fixed-size receive skb. A backend
    reporting a length larger than the skb tailroom drives skb_put() past the
    buffer end and hits skb_over_panic() -- a host-triggerable guest panic
    (denial of service).
    
    Clamp the length to the skb's available room before skb_put(). A
    conforming device never reports more than the posted buffer size, so valid
    frames are unaffected; a truncated over-report then fails the
    length/header checks in hwsim_virtio_handle_cmd() and is dropped, so
    truncating rather than dropping here cannot be turned into a parsing
    problem.
    
    Fixes: 5d44fe7c9808 ("mac80211_hwsim: add frame transmission support over virtio")
    Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
    Link: https://patch.msgid.link/20260620-b4-disp-474bee37-v1-1-1a4d37f3e2d4@proton.me
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mt76: connac: fix possible NULL-pointer deref in mt76_connac_mcu_uni_bss_he_tlv() [+ + +]
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date:   Sun Jun 21 15:24:59 2026 +0200

    wifi: mt76: connac: fix possible NULL-pointer deref in mt76_connac_mcu_uni_bss_he_tlv()
    
    [ Upstream commit 2c1fb2335f5e3afb34f91bc07ecb63517c328090 ]
    
    mt76_connac_get_he_phy_cap routine can theoretically return NULL so
    check cap pointer before dereferencing it.
    
    Fixes: d0e274af2f2e4 ("mt76: mt76_connac: create mcu library")
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Link: https://patch.msgid.link/20260621-mt76_connac_get_he_phy_cap-fix-v1-1-ed4ccf7a0363@kernel.org
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mt76: mt7615: drop TXRX_NOTIFY on non-mmio buses [+ + +]
Author: Devin Wittmayer <lucid_duck@justthetip.ca>
Date:   Wed Jul 29 08:00:56 2026 -0700

    wifi: mt76: mt7615: drop TXRX_NOTIFY on non-mmio buses
    
    commit 39afc46c0243d10b7795e6e6cf4ae91f41732120 upstream.
    
    PKT_TYPE_TXRX_NOTIFY is an mmio-only event, but mt7615_rx_check() and
    mt7615_queue_rx_skb() dispatch it to mt7615_mac_tx_free() on every bus.
    mt7615_mac_tx_free() cleans the DMA tx queues with
    mt76_queue_tx_cleanup(), which calls queue_ops->tx_cleanup(). Only the
    mmio queue ops implement that callback; on the mt7663 USB and SDIO
    buses it is NULL, so a TXRX_NOTIFY there calls a NULL pointer in the RX
    worker. Same defect as the mt7921 and mt7925 patches in this series.
    
    Drop the event on non-mmio buses via mt76_is_mmio(), as in
    commit 5683e1488aa9 ("wifi: mt76: connac: do not check WED status for
    non-mmio devices").
    
    Fixes: eb99cc95c3b6 ("mt76: mt7615: introduce mt7663u support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
    Link: https://patch.msgid.link/20260627191336.20223-4-lucid_duck@justthetip.ca
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    [ No mt7615_rx_check() on this tree, so only the mt7615_queue_rx_skb()
      hunk applies, and mt7615_mac_tx_free() takes the skb rather than
      (data, len), so the guard frees it here. ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mwifiex: bound uAP association event IEs to the event buffer [+ + +]
Author: HE WEI (ギカク) <skyexpoc@gmail.com>
Date:   Wed Jul 15 22:57:11 2026 +0900

    wifi: mwifiex: bound uAP association event IEs to the event buffer
    
    [ Upstream commit f0858bfc7d3cab411a447b88e3ef970e575032c9 ]
    
    mwifiex_process_uap_event() handles EVENT_UAP_STA_ASSOC by exposing the
    (re)association request IEs that the firmware copies into the event:
    
            sinfo->assoc_req_ies = &event->data[len];
            len = (u8 *)sinfo->assoc_req_ies - (u8 *)&event->frame_control;
            sinfo->assoc_req_ies_len = le16_to_cpu(event->len) - (u16)len;
    
    event->len is supplied by the device firmware and is never validated,
    and the subtraction is unchecked.  assoc_req_ies points into
    adapter->event_body[MAX_EVENT_SIZE], a fixed-size array embedded in the
    kmalloc()'d struct mwifiex_adapter.
    
    On the ap_11n_enabled path mwifiex_set_sta_ht_cap() walks these IEs with
    cfg80211_find_ie(), whose for_each_element() loop dereferences each
    element header.  A firmware-reported event->len larger than the bytes
    actually received makes assoc_req_ies_len describe IEs that extend past
    event_body, so the walk reads out of the adapter slab object, a
    slab-out-of-bounds read (KASAN: slab-out-of-bounds in cfg80211_find_ie).
    An event->len smaller than the header instead makes the int subtraction
    negative, which wraps to a huge size_t when stored in assoc_req_ies_len.
    The same length is handed to cfg80211_new_sta(), so a more modest
    over-claim can also copy stale event_body bytes into the
    NL80211_CMD_NEW_STATION notification.
    
    A malicious or malfunctioning mwifiex device (USB/SDIO/PCIe) can deliver
    such an event while the interface is in AP/uAP mode.
    
    Validate event->len before use: reject a length that underflows the
    header or that would place the IEs outside the event_body[] buffer the
    event was copied into.  event->len here is struct mwifiex_assoc_event.len,
    a payload field internal to this event, not the transport frame length,
    so it is validated in this handler rather than at the generic
    MWIFIEX_TYPE_EVENT receive path, which only sees the event cause and the
    transport frame length.  The bound is against event_body[MAX_EVENT_SIZE]
    rather than the actually-received length because the transports store the
    event differently (USB and SDIO leave the 4-byte event header in
    event_skb, PCIe strips it via skb_pull), whereas event_body is the single
    fixed buffer all of them copy the event into.  This is the event-path
    analogue of the receive-path bounds checks added in commit 119585281617
    ("wifi: mwifiex: Fix OOB and integer underflow when rx packets").
    
    Fixes: e568634ae7ac ("mwifiex: add AP event handling framework")
    Signed-off-by: HE WEI (ギカク) <skyexpoc@gmail.com>
    Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
    Link: https://patch.msgid.link/20260715135711.34688-1-skyexpoc@gmail.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mwifiex: fix NULL dereference when the AP has HT-cap but no HT-oper [+ + +]
Author: Doruk Tan Ozturk <doruk@0sec.ai>
Date:   Thu Jul 16 12:30:42 2026 +0200

    wifi: mwifiex: fix NULL dereference when the AP has HT-cap but no HT-oper
    
    commit c3d68e294cbb6a4090bb219d3dcaca85a011809b upstream.
    
    mwifiex_tdls_add_ht_oper() gates its follow-the-AP-bandwidth path on
    bss_desc->bcn_ht_cap being present, but then dereferences a different
    pointer, bss_desc->bcn_ht_oper:
    
            if (ISSUPP_CHANWIDTH40(priv->adapter->hw_dot_11n_dev_cap) &&
                bss_desc->bcn_ht_cap &&
                ISALLOWED_CHANWIDTH40(bss_desc->bcn_ht_oper->ht_param))
    
    bcn_ht_cap and bcn_ht_oper are populated independently while parsing the
    associated AP's beacon in mwifiex_update_bss_desc_with_ie(): an AP that
    advertises an HT Capabilities element but no HT Operation element leaves
    bcn_ht_cap non-NULL and bcn_ht_oper NULL. Setting up a TDLS link to a
    peer while associated to such an AP then dereferences the NULL
    bcn_ht_oper and crashes the kernel. Every other bcn_ht_oper user in the
    driver NULL-checks it first.
    
    Guard on the pointer that is actually dereferenced.
    
    Found by 0sec automated security-research tooling (https://0sec.ai).
    
    Fixes: 396939f94084 ("mwifiex: add HT operation IE in TDLS setup confirm")
    Cc: stable@vger.kernel.org
    Assisted-by: 0sec:multi-model
    Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
    Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
    Link: https://patch.msgid.link/20260716103042.88469-1-doruk@0sec.ai
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: mwifiex: use the subframe length when parsing A-MSDU TDLS frames [+ + +]
Author: Zhao Li <enderaoelyther@gmail.com>
Date:   Tue Jul 28 19:53:25 2026 +0800

    wifi: mwifiex: use the subframe length when parsing A-MSDU TDLS frames
    
    commit 99a948382af8a225e2d5e54a7052158cd6281cc6 upstream.
    
    mwifiex_11n_dispatch_amsdu_pkt() splits an A-MSDU with
    ieee80211_amsdu_to_8023s() and walks the resulting subframes. For each
    subframe it passes the subframe data pointer to
    mwifiex_process_tdls_action_frame(), but pairs it with skb->len, the
    length of the A-MSDU parent, instead of rx_skb->len:
    
            rx_skb = __skb_dequeue(&list);
            rx_hdr = (struct rx_packet_hdr *)rx_skb->data;
            if (ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info) &&
                ntohs(rx_hdr->eth803_hdr.h_proto) == ETH_P_TDLS) {
                    mwifiex_process_tdls_action_frame(priv, (u8 *)rx_hdr,
                                                      skb->len);
            }
    
    The parent is not a valid description of that buffer, and may not be
    valid memory at all. ieee80211_amsdu_to_8023s() ends with
    
            if (!reuse_skb)
                    dev_kfree_skb(skb);
    
    and it only sets reuse_skb when the parent is linear, is not a
    head_frag, and is being consumed as the *last* subframe. So when the
    parent does not qualify for reuse it has already been freed, and the
    read of skb->len is a use-after-free. When it is reused, skb->len is
    the length of the last subframe, applied to every earlier subframe,
    which over-states the buffer whenever an earlier subframe is shorter.
    
    The callee cannot absorb a wrong length, because it derives its own
    ceiling from the value it is given. Each frame type computes
    
            ies_len = len - sizeof(struct ethhdr) - TDLS_*_FIX_LEN;
    
    and the element walk is then bounded entirely against that ceiling,
    
            for (end = pos + ies_len; pos + 1 < end; pos += 2 + pos[1]) {
                    u8 ie_len = pos[1];
    
                    if (pos + 2 + ie_len > end)
                            break;
    
    so a too-large len moves end past the end of the subframe and the walk
    reads and copies beyond it. The A-MSDU layout is chosen by the sender,
    which makes the difference between the last subframe and a shorter
    earlier one remotely selectable. Reaching this requires TDLS support in
    firmware and the TDLS ethertype on the subframe.
    
    The other caller, mwifiex_process_rx_packet(), is correct: it passes a
    pointer and a length that describe the same region of the RX buffer.
    
    Pass rx_skb->len, the length of the subframe actually being parsed.
    
    Fixes: 776f742040ca ("mwifiex: fix AMPDU not setup on TDLS link problem")
    Assisted-by: Codex:gpt-5.6-sol
    Assisted-by: Kimi:K3
    Cc: stable@vger.kernel.org
    Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
    Link: https://patch.msgid.link/20260728115325.19128-1-enderaoelyther@gmail.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: p54: validate RX frame length in p54_rx_eeprom_readback() [+ + +]
Author: Xiang Mei <xmei5@asu.edu>
Date:   Sat Jun 27 17:05:10 2026 -0700

    wifi: p54: validate RX frame length in p54_rx_eeprom_readback()
    
    [ Upstream commit ebd6d37fa94bee929e0b4c9ca19fdf9b1dcf6cea ]
    
    p54_rx_eeprom_readback() copies the requested EEPROM slice out of a
    device-supplied readback frame without checking that the skb actually holds
    that many bytes. Commit da1b9a55ff11 ("wifi: p54: prevent buffer-overflow in
    p54_rx_eeprom_readback()") closed the destination overflow by copying a
    fixed priv->eeprom_slice_size (and rejecting a mismatched advertised len),
    but the source side is still unbounded: nothing verifies the frame is long
    enough to supply that many bytes.
    
    A malicious USB device can send a short frame whose advertised len matches
    priv->eeprom_slice_size while the payload is truncated. The equality check
    passes and memcpy() reads past the end of the skb, leaking adjacent heap:
    
      BUG: KASAN: slab-out-of-bounds in p54_rx (drivers/net/wireless/intersil/p54/txrx.c:507)
      Read of size 1016 at addr ffff88800f077114 by task swapper/0/0
      Call Trace:
       <IRQ>
       ...
       __asan_memcpy (mm/kasan/shadow.c:105)
       p54_rx (drivers/net/wireless/intersil/p54/txrx.c:507)
       p54u_rx_cb (drivers/net/wireless/intersil/p54/p54usb.c:163)
       __usb_hcd_giveback_urb (drivers/usb/core/hcd.c:1657)
       dummy_timer (drivers/usb/gadget/udc/dummy_hcd.c:2005)
       ...
       </IRQ>
    
      The buggy address belongs to the object at ffff88800f0770c0
       which belongs to the cache skbuff_small_head of size 704
      The buggy address is located 84 bytes inside of
       allocated 704-byte region [ffff88800f0770c0, ffff88800f077380)
    
    Check that the slice fits in the skb before copying.
    
    Fixes: 7cb770729ba8 ("p54: move eeprom code into common library")
    Reported-by: Weiming Shi <bestswngs@gmail.com>
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Xiang Mei <xmei5@asu.edu>
    Acked-by: Christian Lamparter <chunkeey@gmail.com>
    Link: https://patch.msgid.link/20260628000510.4152481-1-xmei5@asu.edu
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: wilc1000: validate assoc response length before subtracting header [+ + +]
Author: Huihui Huang <hhhuang@smu.edu.sg>
Date:   Tue Jul 14 17:17:58 2026 +0800

    wifi: wilc1000: validate assoc response length before subtracting header
    
    commit 4c4c97b60a5e978121d9ee8cb0ab3916e5d6a8de upstream.
    
    wilc_parse_assoc_resp_info() computes the trailing IE length as
    
            ies_len = buffer_len - sizeof(*res);
    
    without first checking that buffer_len is at least sizeof(struct
    wilc_assoc_resp) (6 bytes). buffer_len is the length reported for a
    received association response (host_int_parse_assoc_resp_info() passes
    hif_drv->assoc_resp / assoc_resp_info_len straight in) and must be
    validated before the driver accesses the fixed header.
    
    For a frame shorter than the 6-byte fixed header, the subtraction wraps.
    For a four-byte response the result is truncated to a u16 ies_len of
    65534, so kmemdup() then attempts to copy 65534 bytes starting at
    buffer + sizeof(*res), beyond the valid association-response data
    (CWE-125). A response shorter than four bytes can also cause an
    out-of-bounds read of res->status_code at offsets 2 and 3.
    
    Reject frames too short to hold the fixed header before touching the
    header or computing ies_len. Also set the connection status to a failure
    on this path: the caller falls through to a
    "conn_info->status == WLAN_STATUS_SUCCESS" check after the parser
    returns, so leaving the status untouched could let a malformed short
    response be treated as a successful association.
    
    Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Huihui Huang <hhhuang@smu.edu.sg>
    Link: https://patch.msgid.link/20260714091811.3596126-1-hhhuang@smu.edu.sg
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
x86/boot/compressed: Disable jump tables [+ + +]
Author: Nathan Chancellor <nathan@kernel.org>
Date:   Wed Jul 22 17:09:43 2026 -0700

    x86/boot/compressed: Disable jump tables
    
    commit 4a9ec5ec9555ad62dc5b81a37ac946025c2ea002 upstream.
    
    After a recent upstream LLVM change to start generating jump and lookup
    tables in switch statements in more instances [1], linking the
    compressed x86 boot image when CONFIG_KERNEL_ZSTD is enabled fails with:
    
      ld.lld: error: Unexpected run-time relocations (.rela) detected!
    
    Dumping the relocations in misc.o, which is the only file influenced by
    CONFIG_KERNEL_ZSTD in the decompressor, shows dynamic relocations to
    some string constants, which correspond to the string literals in the
    switch statement in handle_zstd_error():
    
      Relocation section '.rela.data.rel.ro' at offset 0x277b0 contains 31 entries:
          Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
      0000000000000000  0000006600000001 R_X86_64_64            0000000000000000 .rodata.str1.1 + 73a
      0000000000000008  0000006600000001 R_X86_64_64            0000000000000000 .rodata.str1.1 + 78e
      0000000000000010  0000006600000001 R_X86_64_64            0000000000000000 .rodata.str1.1 + 78e
      0000000000000018  0000006600000001 R_X86_64_64            0000000000000000 .rodata.str1.1 + 78e
      ...
    
    This optimization is problematic for the decompressor environment, as it
    is built as -fPIE without any explicit absolute references (as described
    at the top of misc.c) while not applying any dynamic relocations, hence
    the linker assertion. To opt out of this optimization, which is of
    little value in this special early boot code, and to mirror the other
    x86 startup code in arch/x86/boot/startup, disable jump tables in the
    decompressor.
    
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Ard Biesheuvel <ardb@kernel.org>
    Cc: Bill Wendling <morbo@google.com>
    Cc: Justin Stitt <justinstitt@google.com>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: stable@vger.kernel.org
    Link: https://github.com/llvm/llvm-project/commit/fa02a6ed66b1700c996b49c96c6bc0eb014c9518 [1]
    Link: https://patch.msgid.link/20260722-x86-boot-compressed-disable-jt-clang-v2-1-7373d38482fb@kernel.org
    Closes: https://github.com/ClangBuiltLinux/linux/issues/2165
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xdp: reject clones that overrun skb_shared_info tailroom [+ + +]
Author: Zhiling Zou <zhilinz@nebusec.ai>
Date:   Mon Aug 3 20:15:32 2026 +0800

    xdp: reject clones that overrun skb_shared_info tailroom
    
    commit e48e8edbef2eb824201495daa5234560f632b23c upstream.
    
    xdpf_clone() clones broadcast copies into a single page and sets
    frame_sz to PAGE_SIZE. __xdp_build_skb_from_frame() later treats that
    page like a normal XDP frame and expects the usual skb_shared_info
    tailroom at the end of the buffer.
    
    The current check only rejects frames whose linear xdp_frame header,
    headroom, and packet data exceed PAGE_SIZE. A source frame backed by a
    larger allocation can still satisfy that check while extending into the
    clone's required shared-info area. When such a clone is converted back
    into an skb, build_skb_around() places skb_shared_info over live packet
    bytes and later writes can corrupt XDP return metadata.
    
    Reject clones unless their linear area fits inside
    SKB_WITH_OVERHEAD(PAGE_SIZE), matching the tailroom requirement already
    enforced by the XDP-to-skb conversion path.
    
    Fixes: e624d4ed4aa8 ("xdp: Extend xdp_redirect_map with broadcast support")
    Cc: stable@vger.kernel.org
    Reported-by: Vega <vega@nebusec.ai>
    Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
    Link: https://patch.msgid.link/6b2afef5d1738763c6965e8e466eb16e43e4f956.1785757386.git.zhilinz@nebusec.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xfrm: policy: preallocate inexact bins before xfrm_hash_rebuild reinsert [+ + +]
Author: Xiang Mei (Microsoft) <xmei5@asu.edu>
Date:   Fri Jul 3 05:19:32 2026 +0000

    xfrm: policy: preallocate inexact bins before xfrm_hash_rebuild reinsert
    
    [ Upstream commit f38f8cce2f7e79775b3db7e8a5eacda04ac908e4 ]
    
    xfrm_hash_rebuild()'s first loop preallocates the bins/chains the reinsert
    loop needs, so the reinsert (after hlist_del_rcu()) cannot allocate or
    fail. But its guard is inverted: it skips policies with prefixlen <
    threshold and preallocates for the rest.
    
    prefixlen < threshold is exactly when policy_hash_bysel() returns NULL and
    the reinsert takes the allocating xfrm_policy_inexact_insert() path. So the
    loop preallocates for the exact policies (which never allocate) and skips
    the inexact ones, whose bin/node is then allocated GFP_ATOMIC during
    reinsert. On failure the error path only WARN_ONCE()s and continues,
    leaving a poisoned bydst node; the next rebuild's hlist_del_rcu()
    dereferences LIST_POISON2 and takes a GPF. Reachable under memory pressure,
    deterministic via failslab.
    
    Invert the guard so preallocation covers exactly the reinserted policies;
    the reinsert then allocates nothing and cannot fail.
    
    Crash:
      Oops: general protection fault, probably for non-canonical address
      0xfbd59c0000000024: 0000 [#1] SMP KASAN NOPTI
      KASAN: maybe wild-memory-access in range [0xdead...]
      ...
      Workqueue: events xfrm_hash_rebuild
      RIP: 0010:xfrm_hash_rebuild+0x5b3/0x1190
      RAX: dead000000000122   (LIST_POISON2 + offset)
      ...
      Call Trace:
       hlist_del_rcu (include/linux/rculist.h:599)
       xfrm_hash_rebuild (net/xfrm/xfrm_policy.c:1365)
       process_one_work (kernel/workqueue.c:3322)
       worker_thread (kernel/workqueue.c:3486)
       kthread (kernel/kthread.c:436)
       ret_from_fork (arch/x86/kernel/process.c:158)
       ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
       ...
      Kernel panic - not syncing: Fatal exception in interrupt
    
    Fixes: 24969facd704 ("xfrm: policy: store inexact policies in an rhashtable")
    Reported-by: AutonomousCodeSecurity@microsoft.com
    Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
    Reviewed-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>