In the Linux kernel, the following vulnerability has been resolved:
KVM: x86/mmu: Check write tracking in all address spaces
kvmgfniswritetracked() checks only the supplied memslot, but page tracking is per-address-space and shadow pages are shared across all address spaces. With SMM, a GFN can therefore be write-tracked in one address space and appear untracked through the other.
Check the supplied slot first, then the slot for the other address space. This ensures all callers honor write tracking regardless of the active address space. In particular, it prevents mmutrytounsyncpages() from marking an upper-level shadow page unsync and eventually triggering the BUG in ptelistremove().
[invert direction of the conditional. - Paolo]
In the Linux kernel, the following vulnerability has been resolved:
cgroup: Avoid iteration of dying tasks with zero refcount
The commit 260fbcb92bbea ("cgroup: Move dyingtasks cleanup from cgrouptaskrelease() to cgrouptaskfree()") extended the lifetime of tasks on the dyingtasks list. The iterators have provision to go through dyingtasks because of dying threadgroup leaders or explicit CSSTASKITERWITHDEAD, however, it was expected that such tasks can obtain a new reference (that is possible before cgrouptaskrelease()/puttaskstructrcuuser()). The tasks after cgrouptaskrelease() and before cgrouptaskfree() are subject to race when they may or may not have ->usage count > 0.
The race window is between csstaskiternext() invocations when csssetlock is released and we may arrive at a new ->taskpos. The iterator should not attempt to resurrect tasks whose ->usage count dropped to zero. (When that happens, puttaskstructrcucb() is already imminent and the returned taskstruct would could be used after free.)
As for the fix, we cannot simply check the signal->live count of a task on the dying list because that won't distinguish regular zombies waiting to be reaped from RCU remnant tasks that are going to be free'd. Therefore add an extra check to rule out ->usage==0 tasks from any iteration.
The repeat: loop in csstaskiteradvance() doesn't consider ->usage count, so add a new loop to csstaskiternext() to skip de-used tasks on the dyinglist.
Rough illustration of the possible race
R (reader of cgroup.procs) T (thread) L (group leader) --------------------------------- -------------------------------- -------------------------------- L exits, signal->live > 0 cgrouptaskdead(L) csssetskiptaskiters() // skips only cset->tasks listaddtail(&L->cglist, &cset->dyingtasks) csstaskiternext() take csssetlock csstaskiteradvance() leader && signal->live != 0 => it->taskpos = &L->cglist release csssetlock T exits --signal->live == 0 cgrouptaskdead(T) // csssetlock releasetask(T) cgrouptaskrelease(T) releasetask(L) // zapleader cgrouptaskrelease(L) puttaskstructrcuuser(L) ...RCU... puttaskstruct(L) L->usage = 0 / L still on dyingtasks / ...RCU... puttaskstruct(L) csstaskiternext() // another iteration take csssetlock it->taskpos = &L->cglist gettaskstruct(L) => addition on 0 drop csssetlock cgrouptaskfree(L) csssetskiptaskiters() // dying skip comes too late freetask(L) cgroupprocsshow() taskpidvnr(L)
In the Linux kernel, the following vulnerability has been resolved:
wifi: iwlwifi: mei: pass correct argument to function
The first argument to iwlmeiwritecyclicbuf() should be the cldev but the qhead pointer is passed instead. Fix it.
bpf: Mark bpfrefcount field as unique
In the Linux kernel, the following vulnerability has been resolved:
pppasync: drop the errored frame instead of resetting its headroom
pppreceivenonmpframe() prepends a two-byte direction tag before running the pass/active BPF filters:
(be16 )skbpush(skb, 2) = htons(PPPFILTERINBOUNDTAG);
Nothing on the receive path guarantees those two bytes of headroom. The frame-error path in pppasync's processinputpacket() resets a reused skb's headroom to zero while claiming to restore it to a freshly allocated state - but a fresh skb from devallocskb() carries NETSKBPAD:
err: if (skb) { / make skb appear as freshly allocated / skbtrim(skb, 0); skbreserve(skb, - skbheadroom(skb)); }
ap->rpkt still points at that skb, so the next frame is reassembled into it with no headroom at all. A peer that sends a bad-FCS frame followed by one beginning ff 03 then leaves a single byte of headroom by the time the filter tag is pushed, which lands one byte below skb->head:
skbuff: skbunderpanic: len:49 put:2 head:ffff888003c10000 data:ffff888003c0ffff tail:0x30 end:0x640 dev:<NULL> kernel BUG at net/core/skbuff.c:214! RIP: 0010:skbpanic+0x13e/0x230 Call Trace: skbpush+0xbd/0x100 pppreceivenonmpframe+0x48a/0x1d10 pppinput+0x4e9/0x2f80 pppasyncprocess+0x2a/0xe0 taskletactioncommon+0x20f/0x8a0 handlesoftirqs+0x18e/0x590 Kernel panic - not syncing: Fatal exception in interrupt
Zeroing the headroom violates the NETSKBPAD guarantee that devallocskb() gives the rest of the receive path. Besides the filter panic above, when CCP compression is enabled pppdecompressframe() hands skb->data - 2 to ->decompress()/->incomp(), which then reads out of bounds before skb->head for the same reason.
Rather than restore the headroom, drop the errored frame - as pppsynctty already does on its error path - and clear ap->rpkt so the next frame is reassembled into a fresh skb with proper headroom. This is simpler and fixes both the filter under-panic and the CCP out-of-bounds read.
The original V1 of this patch made room in pppreceivenonmpframe() with skbcowhead(); Eric pointed out that fixing the root cause in the transport is the right approach.
Found by fuzzing the PPP receive path with a mutating peer on a pty; it is an interesting (remote) DoS: root configures PPP, the peer supplies two crashing frames. The reproducer (repro-ppp-skb.c, unchanged from v1) panics in about a second, and returns cleanly with this applied.
In the Linux kernel, the following vulnerability has been resolved:
sctp: fix a TOCTOU race in SCTPCMDTIMERSTART
The SCTPCMDTIMERSTART handler checks timerpending() before calling timerreduce(). The timer can expire and detach between these operations, causing timerreduce() to rearm the timer without taking the association reference required for the newly armed timer.
The timer callback later unconditionally drops its association reference, which can leave the association reference count unbalanced and result in use-after-free during association teardown.
Use the return value of timerreduce() to determine whether the timer was actually armed. Take the association reference only when timerreduce() successfully starts a new timer, closing the race between checking the timer state and rearming it.
This issue was reported by Nico Yip (@cyeaa) working with TrendAI Zero Day Initiative.
In the Linux kernel, the following vulnerability has been resolved:
vxlan: mdb: Fix use-after-free in vxlanmdbremotesrcdel()
vxlanmdbisvalidsource(), which validates MDBEATTRSOURCE and every MDBEATTRSRCLIST member, accepts the all-zeros address.
A source list is only accepted on a (, G) entry, whose source is the all-zeros address, and for each member of the list an (S, G) entry is derived from it by substituting the source. Entries are keyed by a plain memcmp() of struct vxlanmdbentrykey, so if MDBEATTRSOURCE is present and holds the all-zeros address and the source list holds it as well, the derived (S, G) key is byte-identical to the (, G) key and resolves to the same entry. Omitting MDBEATTRSOURCE is not equivalent, as the key is then left with a zero address family.
vxlanmdbremotesrcdel() removes the forwarding entry of a source before freeing the source entry:
vxlanmdbremotesrcfwddel(vxlan, group, remote, &ent->addr); vxlanmdbremotesrcentrydel(ent);
With the keys aliased, the first call deletes the remote of the entry that owns 'ent' instead of a separate (S, G) entry, and frees 'ent'. The second call then runs on the freed entry, and its hlistdel() reads ->pprev and ->next out of it and writes through them.
Adding the (, G) entry with NLMFREPLACE and no source list marks the all-zeros source for deletion and reaches this from the sweep at the end of vxlanmdbremotesrcsreplace().
BUG: KASAN: slab-use-after-free in vxlanmdbadd+0x1cd/0xd70 Read of size 8 at addr ffff888102852500 by task poc/84 vxlanmdbadd+0x1cd/0xd70 vxlanmdbadd+0xc0/0x140 rtnlmdbadd+0x157/0x2a0 rtnetlinkrcvmsg+0x207/0x5a0 Allocated by task 84: kmalloccachenoprof+0x153/0x360 vxlanmdbremotesrcsadd+0x2eb/0x440 vxlanmdbadd+0x803/0xd70 Freed by task 84: kfree+0x14c/0x3b0 vxlanmdbremotedel+0x129/0x1a0 vxlanmdbdel+0x4f/0xe0 vxlanmdbremotesrcfwddel.isra.0+0x162/0x1b0 vxlanmdbadd+0x1c5/0xd70
The MDB operations are netns-scoped, so an unprivileged user can perform them in a new user and network namespace.
Reject the all-zeros address in vxlanmdbisvalidsource(), which covers both call sites. A (, G) entry is expressed by omitting the source, so nothing legitimate is refused.
Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
In the Linux kernel, the following vulnerability has been resolved:
sctp: fix soft lockup from unpadded ASCONF-ACK parameter iteration
sctpverifyasconf() walks ASCONF-ACK parameters with sctpwalkparams(), which advances by SCTPPAD4(length), while the consumer sctpgetasconfresponse() iterates the same parameters advancing by the raw length, without padding. A single odd-length parameter desynchronises the two walks and makes the consumer interpret attacker-controlled bytes at a misaligned offset.
When those bytes yield a length of zero, the while loop over asconfacklen makes no progress, spinning forever in softirq context, and the watchdog reports a soft lockup. All reads stay within the received skb, so the lockup is a pure remote denial of service. A remote peer can trigger it with a crafted ASCONF-ACK on an ADD-IP enabled association with an outstanding ASCONF (RFC 5061 section 4.1.2 requires the chunk to be authenticated, but the predefined empty key id 0 allows the peer to compute the same association HMAC from publicly exchanged parameters, so the gate does not help).
The SCTPPARAMERRCAUSE case of sctpverifyasconf() also performs no length check, letting a parameter without a complete error header reach the consumer, which reads errhdr.cause past the end of the parameter, an out-of-bounds read.
Reject SCTPPARAMERRCAUSE parameters shorter than sizeof(struct sctpaddipparam) + sizeof(struct sctperrhdr) at the verifier, and advance the consumer iterator with the same padding rule as the verifier to keep the two walks in lockstep. The verifier change guarantees a complete error header in every ERRCAUSE parameter the consumer can see, so the consumer's asconfacklen check is dropped and it returns errparam->cause directly. The consumer padding fix is still required because odd lengths remain valid for SCTPPARAMERRCAUSE per RFC 5061.
The issue was found by ZeroHive, a vulnerability hunting agent at Tencent Yunding Lab.
ALSA: pcm: Serialize PCM mmap with buffer reallocation to fix page UAF
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix listener task lifetime on netdev events
The listener thread exits when its listening socket is shutdown. The netdevice notifier shuts down the socket before calling kthreadstop(), so the taskstruct can be freed before kthreadstop() gets its reference.
Create the listener in a stopped state and hold an extra taskstruct reference until kthreadstopput() completes. Also stop and release listeners before freeing their interface records during TCP teardown.
Bluetooth: L2CAP: fix chan mode for LECONNREQ + EXTFLOWCTL pchan
Bluetooth: L2CAP: fix out-of-bounds write in l2capecredconnect
In the Linux kernel, the following vulnerability has been resolved:
net/sched: clsu32: fix duplicate handle when node ID pool is exhausted
gennewkid() falls back to returning max (htid | 0xFFF) when both idrallocu32() ranges are full, instead of reporting an error. u32change() trusts that value and inserts a new knode with a handle that is already live in the hash table, breaking handle uniqueness within the table's node ID space.
The handle was never reserved in ht->handleidr, so every later error path that does idrremove(&ht->handleidr, handle) removes the reservation of a different, live knode, which is then reused — one failed add compounds into further duplicates.
The 4095 limit is per (table, bucket) — ht->handleidr is per hash table and the range is derived from htid (bucketid), so a table with divisor 256 can legitimately hold 2564095 knodes.
The sibling helper gennewhtid() has the same silent in-band failure: it returns 0 when the tpc handle pool (1..0x7FF) is full, and u32init() publishes the root hash table with handle 0 without checking. Two root tables with handle 0 alias in u32lookupht(), allowing cross-tcfproto knode add/lookup/delete. Add the same exhaustion check that the divisor path already has.
Return an error so u32change() fails with ENOSPC/ENOMEM when the node ID space is exhausted, and so u32init() fails with -ENOMEM when the hash table ID space is exhausted. The extack message distinguishes pool exhaustion (-ENOSPC) from a transient allocation failure (-ENOMEM).
Conditions to recreate the bug: - CONFIGNETSCHED=y, CONFIGCLSU32=y (or =m with module loaded) - Create a clsact qdisc on a device, then add 4095 u32 filters with auto-generated handles to fill the node ID space for the root hash table (single bucket). The 4096th auto-handle filter add triggers the duplicate handle (fh 800::fff reused). Reachable at Level 2 (unshare -Urn, namespace-local CAPNETADMIN). - For gennewhtid: create 2047 u32 proto entries on the same block to fill the tpc handle pool, then create one more. The root table gets handle 0 and aliases with other handle-0 root tables.
In the Linux kernel, the following vulnerability has been resolved:
scsi: mpt3sas: Avoid out-of-bounds cpumaskofnode() call in baseassignreplyqueues()
devtonode() can return NUMANONODE (-1) on systems without NUMA topology information for the PCI device, such as single-socket boards that don't expose device-to-node affinity. Passing -1 directly into cpumaskofnode() indexes nodetocpumaskmap[-1], an out-of-bounds array read caught by UBSAN:
UBSAN: array-index-out-of-bounds in arch/x86/include/asm/topology.h:72:28 index -1 is out of range for type 'cpumask [1024]'
Fall back to cpuonlinemask when no NUMA node is available, rather than assuming devtonode() always returns a valid node index.
btrfs: fix transaction use-after-free in raid stripe insertion
bpf: backtracking shouldn't clear outer frame R1-R5 for callbacks
In the Linux kernel, the following vulnerability has been resolved:
tracing/probes: Fix use-after-free on field name/type of events with multiple probes
The fields of a probe-based dynamic event (kprobe, uprobe, eprobe and fprobe events) are created in traceprobedefineargfields() by handing the probearg name/type strings to tracedefinefield(), which only stores the pointers without copying. Those strings are owned by the traceprobe and are freed when that probe is removed.
An event can have several probes attached. The field list is defined only once, by the first probe that registers the event, but it is kept alive by any surviving sibling probe. Deleting just that first probe by symbol -
# primary A: fields are defined from A's args echo 'p:kprobes/ev vfsread a1=$arg1' > kprobeevents # append B: shares A's event call echo 'p:kprobes/ev vfswrite a1=$arg1' >> kprobeevents # delete only A (matched by symbol), B survives echo '-:kprobes/ev vfsread' >> kprobeevents
frees A's args (traceprobecleanup() -> traceprobefreeprobearg()), but traceprobeunlink() keeps the traceprobeevent because the probe list is not empty. The event call stays registered via B while its fields now reference freed memory. Any field lookup then reads it, e.g.
echo 'a1 == 1' > events/kprobes/ev/filter
BUG: KASAN: slab-use-after-free in strcmp+0xa7/0xb0 Call Trace: strcmp tracefindeventfield parsepred processpreds createfilter applyeventfilter eventfilterwrite
field->name references parg->name (kstrdup'd, freed with the probe) and, for array arguments, field->type references parg->fmt (kmalloc'd, freed with the probe) - the scalar type otherwise points at the static fmttype rodata, which is safe.
Have traceprobedefineargfields() duplicate the name and type strings and anchor the copies on the traceprobeevent, which embeds the event call and outlives every individual probe; traceprobeeventfree() releases them.
The reproducer above triggers reliably; the field lookup and the delete both run under eventmutex, so this is a dangling reference after removal rather than a race.
The issue was found by the autokbug dynamic kernel fuzzer at Tencent Yunding Lab.
bpf: reject BPFPSEUDOFUNC reference to the main program
In the Linux kernel, the following vulnerability has been resolved:
net: Remove conflicting altnames for dying netns in devchangenetnamespace().
syzbot reported the warning in cfg80211pernetexit(). [0]
The repro does the following:
1. create two device in root netns and non-root netns 2. assign the same altname for the two devices 3. remove the non-root netns
Since commit 7663d522099e ("net: check for altname conflicts when changing netdev's netns"), cfg80211switchnetns() and cfg802154switchnetns() fail if initnet has a device with the conflicting altname.
defaultdeviceexitnet() had the same issue and commit d09486a04f5d ("net: fix removing a namespace with conflicting altnames") fixed it.
cfg80211pernetexit() and cfg802154pernetexit() need the same fix.
Let's generalise the fix by removing conflicting altnames for dying netns in devchangenetnamespace().
[0]: cfg80211switchnetns(rdev, &initnet) WARNING: net/wireless/core.c:1871 at cfg80211pernetexit+0xd5/0x120 net/wireless/core.c:1871, CPU#1: kworker/u8:9/1160 Modules linked in: CPU: 1 UID: 0 PID: 1160 Comm: kworker/u8:9 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Workqueue: netns cleanupnet RIP: 0010:cfg80211pernetexit+0xd5/0x120 net/wireless/core.c:1871 Code: e8 03 42 80 3c 20 00 74 08 4c 89 f7 e8 b4 ef 0e f7 4d 8b 36 49 81 fe 20 10 4a 90 74 12 e8 03 3d 9f f6 eb 85 e8 fc 3c 9f f6 90 <0f> 0b 90 eb cc e8 f1 3c 9f f6 eb 05 e8 ea 3c 9f f6 5b 41 5c 41 5e RSP: 0018:ffffc900057a78f0 EFLAGS: 00010293 RAX: ffffffff8b287154 RBX: ffff88807ba72780 RCX: ffff8880213e8000 RDX: 0000000000000000 RSI: 00000000ffffffef RDI: 0000000000000000 RBP: 00000000ffffffef R08: ffffffff9024cc67 R09: 0000000000000000 R10: fffff52000af4eb0 R11: fffffbfff204998d R12: dffffc0000000000 R13: ffffffff904a1080 R14: ffff888144ed0008 R15: ffff888144ed0e20 FS: 0000000000000000(0000) GS:ffff888124de6000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005642de0a8a70 CR3: 000000007a40c000 CR4: 00000000003526f0 Call Trace: <TASK> opsexitlist net/core/netnamespace.c:200 [inline] opsundolist+0x43d/0x8d0 net/core/netnamespace.c:253 cleanupnet+0x572/0x810 net/core/netnamespace.c:706 processonework kernel/workqueue.c:3387 [inline] processscheduledworks+0xc3d/0x1630 kernel/workqueue.c:3470 workerthread+0xa47/0xfb0 kernel/workqueue.c:3551 kthread+0x38b/0x480 kernel/kthread.c:436 retfromfork+0x514/0xb70 arch/x86/kernel/process.c:158 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:245 </TASK>
In the Linux kernel, the following vulnerability has been resolved:
net/rds: acquire RDSINXMIT in rdstcpresetcallbacks()
rdstcpresetcallbacks() quiesces the transmit path by setting the path state to RDSCONNRESETTING and then waiting for RDSINXMIT to be sampled clear before swapping the underlying socket and calling rdssendpathreset().
Sampling the bit clear is not the same as owning it: rdssendxmit() can re-acquire RDSINXMIT right after the waitevent() returns. Its state recheck after taking the lock is a store-buffering pattern (the resetter writes the state and reads the bit, the sender writes the bit and reads the state) and acquireinxmit() is only an acquire operation, so on weakly ordered architectures both sides can miss each other's write and the transmit path then runs concurrently with rdssendpathreset() rewriting cpxmit state - which is exactly what the comment above rdssendpathreset() tells its callers to prevent.
Take the lock instead, hold it across the socket swap and rdssendpathreset(), and release it with a wake-up at the end. The lock-ordering constraint documented above the wait still holds: the lock is acquired before locksock(), so a sender inside tcpsendmsg() can never be waited on while we hold the socket lock.
Two details of the old code go away with the same change:
- tsock is now read only after the lock is acquired. The old code cached it before waiting; the teardown in rdsconnshutdown() releases that socket and clears tsock, so a pointer cached before the wait can be stale by the time the accept path resumes. Reading it under RDSINXMIT is what makes the exclusion complete once the teardown owns the same lock, which the next patch arranges; until then the teardown still only samples the bit, and the two paths remain as exposed to each other as they are today.
- The old !osock early path called rdssendpathreset() with no serialization at all. It now runs under the lock like the normal path. The conditional RDSCONNRESETTING transition of the previous patch happens before the socket check either way: a path found without a socket is either still connecting (its reconnect worker blocked on tconnpathlock) and legitimately goes RESETTING -> UP on the new socket, or it has been torn down meanwhile and is dropped.
The in-function comment describing the old wait-based quiesce is rewritten to describe the lock-based one, and the stale block comment above the function (which still described a return value and an incomplete list of tsock writers) is refreshed to name all four writers - the connect, accept, teardown and swap paths - and what serializes each of them.
In the Linux kernel, the following vulnerability has been resolved:
net/rds: acquire the fastpath locks in rdsconnshutdown()
rdsconnshutdown() quiesces the transmit and receive-refill paths by waiting for RDSINXMIT and RDSRECVREFILL to be sampled clear, and then runs the transport shutdown and rdsconnpathreset(). Sampling the bits clear is not the same as owning them: the moment after the waitevent() returns, rdssendxmit() can re-acquire RDSINXMIT (or rdsibrecvrefill() can re-acquire RDSRECVREFILL) and run concurrently with the teardown.
The sender does recheck the connection state after taking the lock, but that recheck is a classic store-buffering pattern: teardown writes the state and reads the bit while the sender writes the bit and reads the state. acquireinxmit() is only an acquire operation, so on weakly ordered architectures both sides can miss each other's write, and the transmit path then runs while the transport zeroes its rings (e.g. rdsibringinit()) and rdssendpathreset() rewrites the transmit state under it.
Oracle UEK fixed the same class of crashes - a 14-year tail of BUGON()s in rdsibsubsignaled(), unexpected op-codes and NULL dereferences in rdsibsendcqehandler() during failover testing - by making the teardown path acquire the fastpath bit locks instead of testing them ("rds: Make sure transmit path and connection tear-down does not run concurrently"). Ownership of a single word is decided by RMW atomicity, so no cross-variable ordering is needed.
Do the same here: take both locks before calling the transport shutdown, hold them across rdsconnpathreset(), and release them explicitly with a wake-up afterwards. Both are released with clearbitunlock(), so that the ring re-initialization done by the transport shutdown and the transmit state rewritten by rdssendpathreset() are ordered before either bit is seen clear by the next acquireinxmit() or acquirerefill().
The fastpath users of these bits - rdssendxmit() and rdsibrecvrefill() - are trylock style and back off while teardown owns the locks, so no new lock dependency is introduced for them. rdstcpresetcallbacks() is different: since the previous patch it acquires RDSINXMIT as well, and it blocks doing so, so its wait now spans the teardown instead of at most one send batch. That waiter runs from rdstcpacceptone() on the single-threaded krdsd workqueue and holds rdstcpacceptlock and tconnpathlock while it waits, so a duelling SYN accepted while its path is being torn down parks accept processing for the duration of the teardown - for TCP bounded by the (up to 5 s) drain loop in rdstcpconnpathshutdown(). An IB path's drain in rdsibconnpathshutdown() has no round cap, but no blocking waiter either: rdstcpresetcallbacks() is the only blocking acquirer of these bits and waits only on its own TCP path, and the fastpaths are trylock-and-back-off on both transports, so a long IB drain lengthens only that path's own quiesce. The window is narrow: the accept-side state check has to pass before the teardown moves the path to RDSCONNDISCONNECTING.
Because krdsd is a single global workqueue, everything else queued there - accept processing for other connections and network namespaces, and the flushworkqueue(rdswq) in rdstcplistenstop() during namespace teardown - waits behind the parked accept worker for that time. It cannot deadlock, although the waits do point at each other: the teardown blocks until the bit's holder releases it, and the holder may be that krdsd accept worker. The holder finishes without needing anything the teardown owns: the sync cancels rdstcpresetcallbacks() issues target cpsendw and cprecvw on the path's ordered cpwq, whose only execution slot is occupied by the blocked cpdownw itself, so they are pending at most and cancel without flushing - a reliance on cpwq being ordered that is now noted next to those cancels (on ---truncated---
In the Linux kernel, the following vulnerability has been resolved:
net/rds: don't let rdsconnshutdown() consume a concurrent drop
rdsconnshutdown() finishes by moving the path from RDSCONNDISCONNECTING to RDSCONNDOWN, and also accepts RDSCONNERROR as the starting state of that final transition, so that a FIN processed in softirq context during the teardown does not derail the shutdown into a noisy error path.
But consuming that RDSCONNERROR also consumes the shutdown pass that came with it: rdsconnpathdrop() sets RDSCONNERROR and then queues cpdownw, and a pass that starts on a path already in RDSCONNDOWN is a no-op. For the FIN case that is harmless - the socket the FIN arrived on is the very socket the teardown just released. It is not harmless for a dropper that attached something to the path first.
rdstcpacceptone() is such a dropper. Its path claim in rdstcpacceptonepath() transitions RDSCONNDOWN -> RDSCONNCONNECTING, and a concurrent drop - a FIN on a previous socket in softirq context, an administrative reset - can put the path into RDSCONNERROR between that claim and the state check that follows, which accepts RDSCONNERROR. The accept then installs the freshly accepted socket with rdstcpsetcallbacks() while the queued teardown - which sampled tc->tsock before this socket existed - is still running. rdsconnectpathcomplete() fails its transition to RDSCONNUP and drops the path again, queueing the pass that should reap the socket it just installed. If the in-flight shutdown's final transition consumes that drop's RDSCONNERROR, the queued pass finds the path in RDSCONNDOWN and does nothing. The installed socket is never torn down: it sits established with its callbacks armed and its rdstcpconnection on rdstcptclist, the peer sees a connection that nothing ever reads, and the path is wedged in RDSCONNDOWN until some later event drops it again. Reproduced with widened race windows as an ever-growing receive queue on a socket owned by a path stuck in RDSCONNDOWN, with the peer's send path wedged behind it.
Make the final transition only DISCONNECTING -> DOWN. If it fails because the path is in RDSCONNERROR, a drop raced the teardown: cancel the reconnect timer and clear RDSRECONNECTPENDING - the one piece of the skipped tail that must not be left behind - and return, letting the pass the drop queued finish the job: it tears down whatever attached to the path in the meantime, completes the transition to RDSCONNDOWN, and re-arms the reconnect from its own tail.
The timer quiesce in that branch matters because the racing drop does not always queue that pass: rdsconnpathdrop() returns without queueing when a destroy is pending - exactly the situation during a netns teardown or module unload, when a FIN on the dying socket is processed while rdsconnpathdestroy() flushes cpdownw. If the flushed pass is the one that takes this return, no later pass exists, and rdsconnpathdestroy() would find cpconnw still armed (WARNON) and then free a path whose reconnect timer can still fire. With the cancel in the branch, every exit of a shutdown pass leaves the timer quiesced no matter which pass completes the transition.
The FIN case keeps making progress, one pass later and still without noisy logging. Any other state keeps today's rdsconnpatherror() handling; no current cpstate writer can leave a DISCONNECTING path in anything but RDSCONNERROR (every other writer is a cmpxchg from a non-DISCONNECTING state), so that branch is defensive.
On kernels without the preceding patches the same hazard exists with the sample-based quiesce; the fix applies there equally.
In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject resilient lock operations in rbtree callbacks
bpfrbtreeadd() keeps parent and link pointers live across calls to the program-supplied comparison callback. The verifier therefore requires the root's lock to remain held throughout the callback.
The helper path enforces this rule for bpfspinlock() and bpfspinunlock(), but the resilient lock kfunc argument path does not. Since resilient locks may protect BPF rbtree roots, a callback can release the root lock and let another CPU remove and free the node referenced by the in-progress tree walk. The walk then resumes using freed pointers.
Reject resilient lock kfuncs in an rbtree comparison callback, matching the existing policy for the spin lock helpers. Resilient-lock-protected trees remain valid when their comparison callbacks leave lock state alone.
In the Linux kernel, the following vulnerability has been resolved:
nvme: remove stale namespaces by NSID range during scan
nvmescannslist() drops the stale namespaces in each gap in the reported NSID list one NSID at a time. Every iteration calls nvmefindgetns() to look the namespace up and removes it if it is present. The loop runs once per NSID in the gap rather than once per namespace actually present.
NSIDs are 32-bit, so a target with a sparse NSID space can make a single gap spin the loop billions of times with nothing to remove.
watchdog: BUG: soft lockup - CPU#4 stuck for 26s! Workqueue: nvme-wq nvmescanwork [nvmecore] RIP: 0010:srcureadunlock+0xb/0x20 Call Trace: nvmefindgetns+0x7d/0xb0 [nvmecore] nvmescannslist+0xe8/0x280 [nvmecore] nvmescanwork+0x18a/0x280 [nvmecore] processonework+0x197/0x380 workerthread+0x2fe/0x410 kthread+0xe0/0x100
Rename nvmeremoveinvalidnamespaces() to nvmeremovensidrange() and give it an open (start, end) NSID range. ctrl->namespaces is sorted by NSID, so the whole gap is dropped in a single walk that stops once end is reached. This bounds the work by the namespaces that are present instead of by the size of the gap.
In the Linux kernel, the following vulnerability has been resolved:
net: bcmasp: clear txcb->last before writing each descriptor
bcmaspxmit() only wrote txcb->last = true for the final fragment of an SKB; non-final fragments left the field untouched. If a descriptor slot was reused while it still held a stale true from a previous SKB (possible when txspbringfull() underreported fullness), bcmasptxreclaim() would see last == true mid-SKB and call devconsumeskbany() prematurely, freeing the skbuff while its remaining fragments were still in flight.
Unconditionally clear txcb->last before the conditional set so every descriptor slot starts from a known false state regardless of what a prior transmission left behind.
In the Linux kernel, the following vulnerability has been resolved:
net: bcmasp: fix txspbringfull() checking same slot cnt times
The loop initialised nextindex from intf->txspbindex on every iteration, so incrring() always produced the same result and only one slot was ever tested. Move the initialisation before the loop so each iteration advances nextindex and the function correctly checks that cnt consecutive descriptor slots are available before allowing a new transmission.
In the Linux kernel, the following vulnerability has been resolved:
mlxsw: spectrumptp: Fix napigroreceive() call from GC workqueue context
Currently mlxswsp1ptphtgccollect() is run from the PTP garbage-collection workqueue, rather than the NAPI poll context. For any unmatched PTP entries carrying an SKB, it calls mlxswsp1ptpunmatchedfinish() -> mlxswsp1ptppacketfinish(). For ingress packets, this calls mlxswsprxlistenernomarkfunc(). The end of that function is the following:
skb->protocol = ethtypetrans(skb, skb->dev); napigroreceive(mlxswskbcb(skb)->rxmdinfo.napi, skb);
The napi pointer is one that was placed in the SKB control block when the trapped packet was received in the NAPI context. Later, when the GC reaps the unmatched entry (up to MLXSWSP1PTPHTGCTIMEOUT later), the call to napigroreceive() mutates the NAPI instance's GRO list, which is unsafe if the poll is running concurrently on another CPU.
In mlxswsp1ptphtgccollect(), localbhdisable() is called to prevent softirq processing, but this only applies to the local CPU. Additionally, its comment is stale. It states that mlxswsp1ptpunmatchedfinish() invokes netifreceiveskb(). This has not been accurate since the referenced commit; this patch makes that comment accurate again. mlxswpcinapidevsinit() calls netifthreadedenable() on the NAPI RX netdevice without any conditions. The NAPI instance's poll, which may be running concurrent to the GC, is running as an independently-scheduled kthread which may be on a different CPU. The call to localbhdisable() does not guard against this.
If a tx-timestamp timeout produces an unmatched entry (which can be easily reproduced by running ptp4l and waiting for a port to reach the UNCALIBRATED/SLAVE state) while the owning NAPI thread is in the middle of a poll on another CPU, both sides mutate the GRO list concurrently, as shown below:
[39.846] port 1 (swp1): MASTER to UNCALIBRATED on RSSLAVE listadd corruption. next->prev should be prev (ffff8d620faf4138), but was ffff8d624150f700. (next=ffff8d620faf4138). kernel BUG at lib/listdebug.c:29! Oops: invalid opcode: 0000 [#1] SMP PTI CPU: 1 UID: 0 PID: 539 Comm: napi/mlxswrx-0 Not tainted 6.18.48 #1-NixOS PREEMPT(lazy) Hardware name: Mellanox Technologies Ltd. MSN2410/VMOD0001, BIOS 4.6.5 09/13/2018 RIP: 0010:listaddvalidorreport+0x79/0xb0 RSP: 0018:ffffcdf8c0f27c08 EFLAGS: 00010246 RAX: 0000000000000075 RBX: ffff8d624150fd00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8d6315d1e540 RBP: ffff8d620faf4070 R08: 0000000000000000 R09: 00000000ffffdfff R10: ffffffffa5c60fe0 R11: ffffcdf8c0f27ab8 R12: 0000000000000003 R13: 000000000000003d R14: 00000000000001bc R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8d636f63f000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000562689a60c24 CR3: 000000015f224004 CR4: 00000000001726f0 Call Trace: <TASK> groreceiveskb+0xee/0x230 mlxswsp1ptpgotpacket+0x61/0x140 [mlxswspectrum] mlxswcoreskbreceive+0xdf/0x1b0 [mlxswcore] mlxswpcinapipollcqrx+0x780/0x9d0 [mlxswpci] napipoll+0x31/0x1e0 napithreadedpollloop+0x16b/0x1c0 napithreadedpoll+0x71/0xa0 kthread+0xfb/0x260 retfromfork+0x22d/0x260 retfromforkasm+0x1a/0x30 </TASK> Kernel panic - not syncing: Fatal exception in interrupt
The machinery that leads to this kernel panic has not been changed between 6.18.48 and mainline.
This patch adds an ingress-delivery helper for the PTP packetfinish() path that calls netifreceiveskb() instead of napigroreceive(). netifreceiveskb(), unlike napigroreceive(), can be called from outside of the NAPI instance's poll context, which can occur at the call site for this path. RX stats accounting and the skb->dev assignment are still preserved; the only change is the delivery call itself.
This removes GR ---truncated---
In the Linux kernel, the following vulnerability has been resolved:
wifi: mac80211: fix filsdiscovery double free on alloc failure
ieee80211setfilsdiscovery() calls kfreercu() on the old template before allocating the replacement. If the kzalloc() then fails, it returns -ENOMEM while link->u.ap.filsdiscovery still points at the object already queued for freeing. A later update or AP teardown (ieee80211stopap()) re-queues that same rcuhead; the second free is caught by KASAN when the RCU sheaf is processed in softirq:
BUG: KASAN: double-free in rcufreesheaf (mm/slub.c:5850) Free of addr ffff88800c065280 by task swapper/0/0 ... rcufreesheafprepare (mm/slub.c:2634 mm/slub.c:2940) rcufreesheaf (mm/slub.c:5850) rcucore (kernel/rcu/tree.c:2617 kernel/rcu/tree.c:2869) handlesoftirqs (kernel/softirq.c:622) The buggy address belongs to the cache kmalloc-96 of size 96
Queue the old object for kfreercu() only after the new one is published, matching ieee80211setproberesp() and ieee80211sets1gshortbeacon().
In the Linux kernel, the following vulnerability has been resolved:
wifi: mac80211: fix unsolbcastproberesp double free on alloc failure
ieee80211setunsolbcastproberesp() calls kfreercu() on the old template before allocating the replacement. If the kzalloc() then fails, it returns -ENOMEM while link->u.ap.unsolbcastproberesp still points at the object already queued for freeing. A later update or AP teardown re-queues that same rcuhead; the second free is caught by KASAN when the RCU sheaf is processed in softirq:
BUG: KASAN: double-free in rcufreesheaf (mm/slub.c:5850) Free of addr ffff88800d06f300 by task exploit/145 ... rcufreesheafprepare (mm/slub.c:2634 mm/slub.c:2940) rcufreesheaf (mm/slub.c:5850) rcucore (kernel/rcu/tree.c:2617 kernel/rcu/tree.c:2869) handlesoftirqs (kernel/softirq.c:622) The buggy address belongs to the cache kmalloc-128 of size 128
Queue the old object for kfreercu() only after the new one is published, matching ieee80211setproberesp() and ieee80211sets1gshortbeacon().
btrfs: reject free space cache with more entries than pages