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:
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.
Bluetooth: L2CAP: fix chan mode for LECONNREQ + EXTFLOWCTL pchan
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.
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.
btrfs: reject free space cache with more entries than pages
In the Linux kernel, the following vulnerability has been resolved:
KVM: nVMX: Hide shadow VMCS right after VMCLEAR
freenested() frees the shadow VMCS while vmcs01 still points to it. But because it is asynchronous with respect to loadedvmcsclear(), the vCPU might migrate before the pointer is cleared and loadedvmcsclear() 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.
In multiple locations, there is a possible use-after-free due to a race condition. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.
In the Linux kernel, the following vulnerability has been resolved:
netfilter: bridge: fix stale prevhdr pointer in brip6fragment()
brip6fragment() gets prevhdr, a pointer into the skb head, from ip6find1stfragopt(), then calls skbchecksumhelp(). For a cloned skb skbchecksumhelp() reallocates the head via pskbexpandhead(), leaving prevhdr dangling. It is later dereferenced in ip6fragnext(), causing a use-after-free write.
Save prevhdr's offset before skbchecksumhelp() and recompute it after, like commit ef0efcd3bd3f ("ipv6: Fix dangling pointer when ipv6 fragment").
BUG: KASAN: slab-use-after-free in ip6fragnext (net/ipv6/ip6output.c:857) Write of size 1 at addr ffff888013ff5016 by task exploit/141 Call Trace: ... kasanreport (mm/kasan/report.c:595) ip6fragnext (net/ipv6/ip6output.c:857) brip6fragment (net/ipv6/netfilter.c:212) nfctbridgepost (net/bridge/netfilter/nfconntrackbridge.c:407) nfhookslow (net/netfilter/core.c:619) brforwardfinish (net/bridge/brforward.c:66) brforward (net/bridge/brforward.c:115) maybedeliver (net/bridge/brforward.c:191) brflood (net/bridge/brforward.c:245) brhandleframefinish (net/bridge/brinput.c:229) brhandleframe (net/bridge/brinput.c:442) ... packetsendmsg (net/packet/afpacket.c:3114) ... dosyscall64 (arch/x86/entry/syscall64.c:94) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:121) Kernel panic - not syncing: Fatal exception in interrupt
In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: reject overflowing copy + len in bpfmsgpushdata()
When the scatterlist ring is full or nearly full, bpfmsgpushdata() enters a copy fallback path and computes copy + len for the page allocation size. Since len comes from BPF with arg3type = ARGANYTHING and both are u32, a crafted len can wrap the sum to a small value, causing an undersized allocation followed by an out-of-bounds memcpy.
BUG: unable to handle page fault for address: ffffed104089a402 Oops: Oops: 0000 [#1] SMP KASAN NOPTI Call Trace: asanmemcpy (mm/kasan/shadow.c:105) bpfmsgpushdata (net/core/filter.c:2852 net/core/filter.c:2788) bpfprog9ed8b5711920a7d7+0x2e/0x36 skpsockmsgverdict (net/core/skmsg.c:934) tcpbpfsendmsg (net/ipv4/tcpbpf.c:421 net/ipv4/tcpbpf.c:584) syssendto (net/socket.c:2206) dosyscall64 (arch/x86/entry/syscall64.c:94) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:130)
Add an overflow check before the allocation.
crypto: asymmetrickeys - fix OOB read in pefiledigestpecontents
In the Linux kernel, the following vulnerability has been resolved:
tipc: fix use-after-free of the discoverer in tipcdiscrcv()
bearerdisable() frees b->disc with tipcdiscdelete()'s plain kfree(), but tipcdiscrcv() still dereferences b->disc in RX softirq under rcureadlock() (tipcudprecv -> tipcrcv -> tipcdiscrcv).
L2 bearers are safe thanks to the synchronizenet() in tipcdisablel2media(), but the UDP bearer defers that call to the cleanupbearer() workqueue, so the discoverer is freed with no grace period:
BUG: KASAN: slab-use-after-free in tipcdiscrcv (net/tipc/discover.c:149) Read of size 8 at addr ffff88802348b728 by task poctipc/184 <IRQ> tipcdiscrcv (net/tipc/discover.c:149) tipcrcv (net/tipc/node.c:2126) tipcudprecv (net/tipc/udpmedia.c:391) udprcv (net/ipv4/udp.c:2643) iplocaldeliverfinish (net/ipv4/ipinput.c:241) </IRQ> Freed by task 181: kfree (mm/slub.c:6565) bearerdisable (net/tipc/bearer.c:418) tipcnlbearerdisable (net/tipc/bearer.c:1001)
The bearer is freed with kfreercu(); free the discoverer the same way. Add an rcuhead to struct tipcdiscoverer and free it and its skb from an RCU callback.
Because the RCU callback (tipcdiscfreercu) lives in module text, a callrcu() that is still pending when the tipc module is unloaded would invoke a freed function. Add an rcubarrier() to tipcexit() 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 GENLADMINPERM. Needs CONFIGTIPC and CONFIGTIPCMEDIAUDP.
In the Linux kernel, the following vulnerability has been resolved:
net/smc: fix UAF in smccdcrxhandler() by pinning the socket
smccdcrxhandler() looks up the connection by token under the link group's connslock, drops the lock, and then dereferences conn and the smcsock derived from it, ending in sockhold(&smc->sk) inside smccdcmsgrecv(). No reference is held across the lock release.
The only reference pinning the socket while the connection is discoverable in the link group is taken in smclgrregisterconn() (sockhold) and dropped in smclgrunregisterconn() (sockput), both under connslock. Once the handler drops connslock, a concurrent close() -> smcrelease() -> smcconnfree() -> smclgrunregisterconn() can drop that reference and free the smcsock, so the handler's later sockhold() runs on freed memory:
WARNING: lib/refcount.c:25 at refcountwarnsaturate Workqueue: rxewq dowork refcountwarnsaturate (lib/refcount.c:25) smccdcmsgrecv (net/smc/smccdc.c:430) smccdcrxhandler (net/smc/smccdc.c:502) smcwrrxtaskletfn (net/smc/smcwr.c:445) taskletactioncommon (kernel/softirq.c:938) handlesoftirqs (kernel/softirq.c:622) Kernel panic - not syncing: paniconwarn set
Only SMC-R is affected. The SMC-D receive tasklet is stopped by taskletkill(&conn->rxtsklet) in smcconnfree() before the connection is unregistered, so it cannot run concurrently with the free.
Take the socket reference while still holding connslock, so the registration reference can no longer be the last one, and drop it once the handler is done.
In the Linux kernel, the following vulnerability has been resolved:
crypto: qat - remove unused character device and IOCTLs
The QAT driver exposes a character device (qatadfctl) with IOCTLs for device configuration, start, stop, status query and enumeration. These IOCTLs are not part of any public uAPI header and have no known in-tree or out-of-tree users. Device lifecycle is already managed via sysfs.
The ioctl interface also increases the attack surface and is the subject of a number of bug reports.
Remove the character device, the IOCTL definitions, and the related data structures (adfdevstatusinfo, adfusercfgkeyval, adfusercfgsection, adfusercfgctldata). Drop the now-unused adfcfguser.h header and strip adfctldrv.c down to the minimal moduleinit/moduleexit hooks for workqueue, AER, and crypto/compression algorithm registration.
Clean up leftover dead code that was only reachable from the removed IOCTL paths: adfcfgdelall(), adfdevmgrverifyid(), adfdevmgrgetnumdev(), adfdevmgrgetdevbyid(), adfgetvfrealid() and the unused ADFCFG macros.
Additionally, drop the entry associated to QAT IOCTLs in ioctl-number.rst.
In the Linux kernel, the following vulnerability has been resolved:
ACPI: NFIT: core: Fix acpinfitinit() error cleanup
If acpinfitinit() fails after adding the acpidesc object to the acpidescs list, that object is never removed from that list because the acpinfitshutdown() devm action is not added for the NFIT device in that case. Next, the acpinfitinit() failure causes acpinfitprobe() to fail, the acpidesc object is freed, and a dangling pointer is left behind in the acpidescs. Any subsequent ACPI Machine Check Exception will trigger nfithandlemce() which iterates over acpidescs and so a use-after-free will occur.
Moreover, if acpinfitprobe() returns 0 after installing a notify handler for the NFIT device and without allocating the acpidesc object and setting the NFIT device's driver data pointer, the acpidesc object will be allocated by acpinfitupdatenotify() and acpinfitinit() will be called to initialize it. Regardless of whether or not acpinfitinit() fails in that case, the acpinfitshutdown() devm action is not added for the NFIT device and acpidesc is never removed from the acpidescs list. If the acpidesc object is freed subsequently on driver removal, any subsequent ACPI MCE will lead to a use-after-free like in the previous case.
To address the first issue mentioned above, make acpinfitprobe() call acpinfitshutdown() directly on acpinfitinit() failures and to address the other one, add a remove callback to the driver and make it call acpinfitshutdown(). Also, since it is now possible to pass NULL to acpinfitshutdown() or the acpidesc object passed to it may not have been initialized, add checks against NULL for acpidesc and its nvdimmbus field to that function and make acpinfitunregister() clear the latter after unregistering the NVDIMM bus.
In the Linux kernel, the following vulnerability has been resolved:
iio: event: Fix event FIFO reset race
iioeventgetfd() creates the event file descriptor with anoninodegetfd(), which allocates a new fd, creates the anonymous file and installs it in the process fd table before returning to the caller.
The IIO code resets the event FIFO after anoninodegetfd() has returned, but before IIOGETEVENTFDIOCTL has copied the fd number to userspace. But since fd tables are shared between threads, another thread can guess the newly allocated fd number and issue a read() on it as soon as the fd has been installed.
This means the kfifotouser() in iioeventchrdevread() can run in parallel with the kfiforesetout() in iioeventgetfd().
The kfifo documentation says that kfiforesetout() is only safe when it is called from the reader thread and there is only one concurrent reader. Otherwise it is dangerous and must be handled in the same way as kfiforeset().
If that happens, kfifotouser() can advance the FIFO out index based on state from before the reset, after the reset has already moved the out index to the current in index. That can leave the FIFO with an out index past the in index. A later read() can then see an underflowed FIFO length and copy more data than the event FIFO buffer contains. This can result in an out-of-bounds read and leak adjacent kernel memory to userspace.
Move the FIFO reset before anoninodegetfd(). At that point the event fd is marked busy, but the new fd has not been installed yet, so userspace cannot access it while the FIFO is reset.
In the Linux kernel, the following vulnerability has been resolved:
iio: gyro: bmg160: bail out when bandwidth/filter is not in table
bmg160getfilter() walks bmg160sampfreqtable[] looking for the entry matching the bwbits value read from the chip:
for (i = 0; i < ARRAYSIZE(bmg160sampfreqtable); ++i) { if (bmg160sampfreqtable[i].bwbits == bwbits) break; } val = bmg160sampfreqtable[i].filter;
If no entry matches, i ends up equal to the array size and the next line reads one slot past the end. bmg160setfilter() has the same shape, driven by 'val' instead of bwbits.
smatch flags both:
drivers/iio/gyro/bmg160core.c:204 bmg160getfilter() error: buffer overflow 'bmg160sampfreqtable' 7 <= 7 drivers/iio/gyro/bmg160core.c:222 bmg160setfilter() error: buffer overflow 'bmg160sampfreqtable' 7 <= 7
Return -EINVAL when no entry matches.
The setfilter() path is reachable from userspace via the sysfs inanglvelfilterlowpass3dbfrequency interface, so userspace can trivially trigger the out-of-bounds read with a value that is not in bmg160sampfreqtable[].filter.
In the Linux kernel, the following vulnerability has been resolved:
binder: fix UAF in binderthreadrelease()
When a thread exits, binderthreadrelease() walks its transaction stack to clear the t->from and t->toproc that correspond with the exiting thread. However, a process dying in parallel might attempt to kfree some of these transactions. And if one of them has no associated t->toproc, the t->toproc->innerlock will not be acquired.
This means that transaction accesses in binderthreadrelease() after t->toproc has been cleared might race with binderfreetransaction() and cause a use-after-free error as reported by KASAN:
================================================================== BUG: KASAN: slab-use-after-free in binderthreadrelease+0x5d0/0x798 Write of size 8 at addr ffff000016627500 by task X/715
CPU: 17 UID: 0 PID: 715 Comm: X Not tainted 7.1.0-rc5-00149-g8fde5d1d47f6 #30 PREEMPT Hardware name: linux,dummy-virt (DT) Call trace: binderthreadrelease+0x5d0/0x798 binderioctl+0x12c0/0x299c [...]
Allocated by task 717 on cpu 18 at 67.267803s: kasankmalloc+0xa0/0xbc kmalloccachenoprof+0x174/0x444 bindertransaction+0x554/0x8150 binderthreadwrite+0xa30/0x4354 binderioctl+0x20f0/0x299c [...]
Freed by task 202 on cpu 18 at 90.416221s: kasanslabfree+0x58/0x80 kfree+0x1a0/0x4a4 binderfreetransaction+0x150/0x294 bindersendfailedreply+0x398/0x6d8 binderreleasework+0x3e4/0x4ec binderdeferredfunc+0xbd8/0x104c [...] ==================================================================
In order to avoid this, make sure that binderfreetransaction() reads the t->toproc under the transaction lock. This will serialize the transaction release with the accesses in binderthreadrelease(). Plus, it matches the documented locking rules for @toproc.
In the Linux kernel, the following vulnerability has been resolved:
binder: fix UAF in binderfreetransaction()
In binderfreetransaction(), the t->toproc is read under the t->lock. However, once the t->lock is dropped, the toproc can die in parallel. This leads to a use-after-free error when we attempt to acquire its inner lock right afterwards:
================================================================== BUG: KASAN: slab-use-after-free in rawspinlock+0xe4/0x1a0 Write of size 4 at addr ffff00001125da70 by task B/672
CPU: 20 UID: 0 PID: 672 Comm: B Not tainted 7.1.0-rc6-00284-g8e65320d91cd #4 PREEMPT Hardware name: linux,dummy-virt (DT) Call trace: rawspinlock+0xe4/0x1a0 binderfreetransaction+0x8c/0x320 bindersendfailedreply+0x21c/0x2f8 binderthreadrelease+0x488/0x7e0 binderioctl+0x12c0/0x29a0 [...]
Allocated by task 675: kmalloccachenoprof+0x174/0x444 binderopen+0x118/0xb70 dodentryopen+0x374/0x1040 vfsopen+0x58/0x3bc [...]
Freed by task 212: kasanslabfree+0x58/0x80 kfree+0x1a0/0x4a4 binderprocdectmpref+0x32c/0x5e0 binderdeferredfunc+0xc48/0x104c processonework+0x53c/0xbc0 [...] ==================================================================
To prevent this, pin the target thread (t->tothread) to guarantee the target process remains alive. Undelivered transactions without a target thread are already safe, as the target process can only be the current context in those paths.
hwrng: virtio: clamp device-reported used.len at copydata()
6lowpan: fix NHC entry use-after-free on error path
In the Linux kernel, the following vulnerability has been resolved:
tipc: fix out-of-bounds read in broadcast Gap ACK blocks
A broadcast PROTOCOL/STATEMSG can carry a Gap ACK blocks record in its data area. tipcgetgapackblks() only verifies that the record's len field is self-consistent with its ugackcnt/bgackcnt counts (sz == structsize(p, gacks, ugackcnt + bgackcnt)); it does not check that the record actually fits in the message data area, msgdatasz().
The unicast caller tipclinkprotorcv() bounds it ("if (glen > dlen) break;"), but the broadcast caller tipcbcastsyncrcv() discards the returned size, so tipclinkadvancetransmq() copies the record off the receive skb with an attacker-controlled count:
thisga = kmemdup(ga, structsize(ga, gacks, ga->bgackcnt), GFPATOMIC);
A TIPC neighbour that negotiated TIPCGAPACKBLOCK triggers it with one ordinary broadcast STATEMSG (msgbcackinvalid() clear), sized so its data area is short, carrying a Gap ACK record with len = 0x400, bgackcnt = 0xff and ugackcnt = 0. len then equals structsize(p, gacks, 255), so the consistency check passes and ga is non-NULL; kmemdup() reads structsize(ga, gacks, 255) = 1024 bytes out of the much smaller skb:
BUG: KASAN: slab-out-of-bounds in kmemdupnoprof+0x48/0x60 Read of size 1024 at addr ffff0000c7030d38 by task poc864/69 Call trace: kmemdupnoprof+0x48/0x60 tipclinkadvancetransmq+0x86c/0xb80 tipclinkbcackrcv+0x19c/0x1e0 tipcbcastsyncrcv+0x1c4/0x2c4 tipcrcv+0x85c/0x1340 tipcl2rcvmsg+0xac/0x104 The buggy address belongs to the object at ffff0000c7030d00 which belongs to the cache skbuffsmallhead of size 704 The buggy address is located 56 bytes inside of allocated 704-byte region [ffff0000c7030d00, ffff0000c7030fc0)
The copied-out bytes are subsequently consumed as gap/ack values, but the read is already out of bounds at the kmemdup() regardless of how they are used.
The unicast STATE path drops such a message: "if (glen > dlen) break;" skips the rest of STATEMSG handling and the skb is freed. Make the broadcast path drop it too. tipcbcastsyncrcv() now bounds the record against msgdatasz() and, when it does not fit, reports it back through tipcnodebcsyncrcv() to tipcrcv() so the skb is discarded rather than processed. ga is not cleared on this path: ga == NULL already means "legacy peer without Selective ACK", a distinct legitimate state.
In the Linux kernel, the following vulnerability has been resolved:
staging: rtl8723bs: fix WEP length underflow and OOB read in OnAuth()
OnAuth() has two bugs in the shared-key authentication path.
When the Privacy bit is set, rtwwepdecrypt() is called without verifying that the frame is long enough to contain a valid WEP IV and ICV. Inside rtwwepdecrypt(), length is computed as:
length = len - WLANHDRA3LEN - ivlen
and then passed as (length - 4) to crc32le(). If len is less than WLANHDRA3LEN + ivlen + icvlen (32 bytes), length - 4 is negative and, after the implicit cast to sizet, causes crc32le() to read far beyond the frame buffer. Add a minimum length check before accessing the IV field and calling the decryption path.
When processing a seq=3 response, rtwgetie() stores the Challenge Text IE length in ielen, but the subsequent memcmp() always reads 128 bytes regardless of ielen. IEEE 802.11 mandates a challenge text of exactly 128 bytes; reject any IE whose length field differs, matching the check already applied to OnAuthClient().
In the Linux kernel, the following vulnerability has been resolved:
staging: rtl8723bs: fix OOB reads in IE loops in issueassocreq() and joincmdhdl()
Two IE parsing loops are missing the header bounds checks before they dereference pIE->length:
- issueassocreq() walks pmlmeinfo->network.ies to build the association request. If the stored IE data ends with only an elementid byte and no length byte, pIE->length is read one byte past the end of the buffer.
- joincmdhdl() walks pnetwork->ies during station join and has the same problem under the same conditions.
Both buffers are filled from AP beacon and probe-response frames, so a malicious AP that sends a truncated final IE can trigger the issue.
Apply the two-guard pattern established in updatebeaconinfo(): 1. Break if fewer than sizeof(pIE) bytes remain. 2. Break if the IE's declared data extends past the buffer end.
In the Linux kernel, the following vulnerability has been resolved:
crypto: qat - fix VF2PF work teardown race in adfdisablesriov()
The VF2PF interrupt handler queues PF-side response work that stores a raw pointer to per-VF state (struct adfaccelvfinfo). Currently, adfdisablesriov() destroys per-VF mutexes and frees vfinfo without stopping new VF2PF work or waiting for in-flight workers to complete. A concurrently scheduled or already queued worker can then dereference freed memory.
This manifests as a use-after-free when KASAN is enabled:
BUG: KASAN: null-ptr-deref in mutexlock+0x76/0xe0 Write of size 8 at addr 0000000000000260 by task kworker/24:2/... Workqueue: qatpf2vfrespwq adfiovsendresp [intelqat] Call Trace: kasanreport+0x119/0x140 mutexlock+0x76/0xe0 adfgen4pfvfsend+0xd4/0x1f0 [intelqat] adfrecvandhandlevf2pfmsg+0x290/0x360 [intelqat] adfiovsendresp+0x8c/0xe0 [intelqat] processonework+0x6ac/0xfd0 workerthread+0x4dd/0xd30 kthread+0x326/0x410 retfromfork+0x33b/0x670
Add a PF-local flag, vf2pfdisabled, that gates work queueing, worker processing, and interrupt re-enabling during teardown. Set this flag atomically with the hardware interrupt mask inside adfdisableallvf2pfinterrupts(). After masking, synchronize the AE cluster MSI-X interrupt and flush the PF response workqueue before tearing down per-VF locks and state so all in-flight work completes before vfinfo is destroyed.
Introduce adfenableallvf2pfinterrupts() to clear the flag and unmask all VF2PF interrupts under the same lock when SR-IOV is re-enabled. This ensures the software flag and hardware state transition atomically on both the enable and disable paths.
In the Linux kernel, the following vulnerability has been resolved:
ipv4: igmp: remove multicast group from hash table on device destruction
When a device is destroyed under RTNL, ipmcdestroydev() iterates through the multicast list and calls ipmaput() on each membership, scheduling them for RCU reclamation. However, they are not unlinked from the device's multicast hash table (mchash).
Since the device remains published in dev->ipptr until after ipmcdestroydev() completes, concurrent RCU readers traversing mchash can still locate and access the multicast group after its refcount is decremented. If the RCU callback runs and frees the group while a reader is accessing it, a use-after-free occurs.
Fix this by unlinking the multicast group from mchash using ipmchashremove() before scheduling it for reclamation.
BUG: KASAN: slab-use-after-free in ipcheckmcrcu+0x149/0x3f0 Read of size 4 at addr ffff888009bf1408 by task mausezahn/2276
Call Trace: <IRQ> dumpstacklvl+0x67/0x90 printreport+0x175/0x7c0 kasanreport+0x147/0x180 ipcheckmcrcu+0x149/0x3f0 udpv4earlydemux+0x36d/0x12d0 iprcvfinishcore+0xb8b/0x1390 iprcvfinish+0x54/0x120 NFHOOK+0x213/0x2b0 netifreceiveskb+0x126/0x340 processbacklog+0x4f2/0xf00 napipoll+0x92/0x2c0 netrxaction+0x583/0xc60 handlesoftirqs+0x236/0x7f0 dosoftirq+0x57/0x80 </IRQ>
Allocated by task 2239: kasansavetrack+0x3e/0x80 kasankmalloc+0x72/0x90 ipmcincgroup+0x31a/0xa40 ipmcjoingroup+0x334/0x3f0 doipsetsockopt+0x16fa/0x2010 ipsetsockopt+0x3f/0x90 dosocksetsockopt+0x1ad/0x300
Freed by task 0: kasansavetrack+0x3e/0x80 kasansavefreeinfo+0x40/0x50 kasanslabfree+0x3a/0x60 rcufreesheafprepare+0xd4/0x220 rcufreesheaf+0x36/0x190 rcucore+0x8d9/0x12f0 handlesoftirqs+0x236/0x7f0
In the Linux kernel, the following vulnerability has been resolved:
mfd: crosec: Delay devsetdrvdata() until probe success
If ecdeviceprobe() fails, crosecclassrelease releases memory for the crosecdev structure. However, because the drvdata was already set, sub-drivers like crosectypec can still retrieve the stale pointer via the platform device. This leads to a use-after-free when crosectypec attempts to access &typec->ec->ec->dev on a device that has already been released. Move devsetdrvdata() to ensure that the pointer is only made available once all initialization steps have succeeded.
sysfs: cannot create duplicate filename '/class/chromeos/crosec' Call trace: sysfsdocreatelinksd+0x94/0xdc sysfscreatelink+0x30/0x44 deviceaddclasssymlinks+0x90/0x13c deviceadd+0xf0/0x50c ecdeviceprobe+0x150/0x4f0 platformprobe+0xa0/0xe0 ... BUG: KASAN: invalid-access in memcpy+0x44/0x230 Write at addr f5ffff809e2d33ac by task kworker/u32:5/125 Pointer tag: [f5], memory tag: [fe] Tainted : [W]=WARN, [O]=OOTMODULE Hardware name: Google Navi unprovisioned 0x7FFFFFFF/sku0 board/sku3 Workqueue: eventsunbound deferredprobeworkfunc Call trace: memcpy+0x44/0x230 croseccheckfeatures+0x60/0xcc [crosecproto] crostypecprobe+0xe8/0x6e0 [crosectypec] platformprobe+0xa0/0xe0
In the Linux kernel, the following vulnerability has been resolved:
netfilter: ebtables: zero chainstack array
sashiko reports: looking at ebtables table translation, could a sparse cpupossiblemask lead to an uninitialized pointer free?
If cpupossiblemask is sparse (for example, CPU 0 and CPU 2 are possible, but CPU 1 is not), the allocation loop skips CPU 1. If vmallocnode() fails at CPU 2, the cleanup loop will blindly decrement and call vfree() on newinfo->chainstack[1].
Not a real-world bug, such allocation isn't expected to fail in the first place.