In the Linux kernel, the following vulnerability has been resolved:
In the Linux kernel, the following vulnerability has been resolved:
usb: typec: tcpm: bound altmodedesc[] per iteration in svdmconsumemodes()
svdmconsumemodes() checks pmdata->altmodes against the array size once before the loop over the count, but forgot to check the bound at every point in the loop.
In the well-behaved SVDM discovery flow this is harmless because each of at most SVIDDISCOVERYMAX SVIDs contributes at most MODEDISCOVERYMAX modes, exactly filling altmodedesc[ALTMODEDISCOVERYMAX]. But the CMDTRSPACK handler in tcpmpdsvdm() does not correlate an incoming ACK with any request the port actually sent. Once port->partner is set, an unsolicited Discover Modes ACK is consumed unconditionally. A broken or malicious port partner can therefore drive altmodes to ALTMODEDISCOVERYMAX - 1 via the normal flow, and then send one extra Discover Modes ACK with seven VDOs. Because the pre-loop check passes, the loop could then writes up to five entries past altmodedesc[]. For modedataprime the next field in struct tcpmport is the partneraltmode[] pointer array, which then receives partner-chosen SVID/VDO bytes.
Move the bound check inside the loop so the array can never be indexed past ALTMODEDISCOVERYMAX regardless of how many VDOs the partner supplies or how the function was reached.
drm/amdkfd: Fix buffer overflow in SDMA queue checkpoint/restore on GFX11
In the Linux kernel, the following vulnerability has been resolved:
staging: rtl8723bs: fix buffer over-read in rtwupdateprotection
rtwupdateprotection() is called with a pointer offset into the ies buffer but the full ielength is passed, causing a potential buffer over-read.
In the Linux kernel, the following vulnerability has been resolved:
xfrm: move policybydst RCU sync from per-netns .exit to .preexit
The struct pernetoperations docstring in include/net/netnamespace.h explicitly warns against blocking RCU primitives in .exit handlers:
Exit methods using blocking RCU primitives, such as synchronizercu(), should be implemented via exitbatch. [...] Please, avoid synchronizercu() at all, where it's possible.
Note that a combination of preexit() and exit() can be used, since a synchronizercu() is guaranteed between the calls.
xfrmpolicyfini() violates this: it calls synchronizercu() before freeing the policybydst hash tables (so no RCU reader is mid- traversal at free time), but runs from xfrmnetops.exit -- once per namespace -- so a cleanupnet() of N namespaces pays N full RCU grace periods serially.
Use the documented preexit/exit split. Move the policy flush (and the workqueue drains it depends on) into a new .preexit handler; xfrmpolicyfini() then runs in .exit and frees the hash tables after the synchronizercuexpedited() that cleanupnet() guarantees between the two phases. Providing O(1) RCU grace periods per batch instead of O(N).
Observed on Linux 6.18 with a workload doing unshare(CLONENEWNET) at ~13/sec sustained: cleanupnet() and the netnswq rescuer kthread both stuck in xfrmpolicyfini()'s synchronizercu(), >300k struct net accumulated in the cleanup queue, Percpu in /proc/meminfo climbed to 130+ GB on 256-CPU hosts, and memcg OOMs followed. setupnet and putnet counts were balanced, ruling out a refcount leak.
In the Linux kernel, the following vulnerability has been resolved:
drm/amdkfd: fix NULL pointer bug in svmrangesetattr
The processinfo could be NULL if user doesn't call kfdioctlacquirevm before calling kfdioctlsvm.
(cherry picked from commit 83a26c812e0529eb040d31a76f73e33e637243d4)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: fix dst corruption in same register operation
For lshift and rshift, the shift operations are performed in a loop over 32-bit words. The loop calculates the shifted value and write it to dst, and then immediately reads from src to calculate the carry for the next iteration. Because src and dst could point to the same memory location, the carry is incorrectly calculated using the newly modified dst value instead of the original src value.
Adding a temporary local variable to cache the original value before writing to dst and using it for the carry calculation solves the problem. In addition, partial overlap is rejected from control plane for all kind of operations including byteorder. This was tested with the following bytecode:
table testtable ip flags 0 use 1 handle 1 ip testtable testchain use 3 type filter hook input prio 0 policy accept packets 0 bytes 0 flags 1 ip testtable testchain 2 [ immediate reg 1 0x44332211 0x88776655 ] [ bitwise reg 1 = ( reg 1 << 0x08000000 ) ] [ cmp eq reg 1 0x66443322 0x00887766 ] [ counter pkts 0 bytes 0 ] ip testtable testchain 4 3 [ immediate reg 1 0x44332211 0x88776655 ] [ bitwise reg 1 = ( reg 1 << 0x08000000 ) ] [ cmp eq reg 1 0x55443322 0x00887766 ] [ counter pkts 21794 bytes 1917798 ]
gpio: mvebu: fix NULL pointer dereference in suspend/resume
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nfconntrack: destroy stale expectfn expectations on unregister
NAT helpers such as nfnath323 store a raw pointer to module text in exp->expectfn (e.g. ipnatq931expect). nfcthelperexpectfnunregister() only unlinks the callback descriptor and never walks the expectation table, so an expectation pending at module removal survives with a dangling exp->expectfn into freed module text.
When the expected connection arrives, initconntrack() invokes exp->expectfn(), now a stale pointer into the unloaded module. Reproduced on a KASAN build by loading the H.323 helpers, creating a Q.931 expectation, unloading nfnath323, then connecting to the expected port:
Oops: int3: 0000 [#1] SMP KASAN NOPTI RIP: 0010:0xffffffffa06102d1 initconntrack.isra.0 (net/netfilter/nfconntrackcore.c:1862) nfconntrackin (net/netfilter/nfconntrackcore.c:2049) ipv4conntracklocal (net/netfilter/nfconntrackproto.c:223) nfhookslow (net/netfilter/core.c:619) iplocalout (net/ipv4/ipoutput.c:120) tcptransmitskb (net/ipv4/tcpoutput.c:1715) tcpconnect (net/ipv4/tcpoutput.c:4374) tcpv4connect (net/ipv4/tcpipv4.c:345) sysconnect (net/socket.c:2167) Modules linked in: nfconntrackh323 [last unloaded: nfnath323]
Reaching the dangling state requires CAPSYSMODULE in the initial user namespace to remove a NAT helper that still has live expectations, so this is a robustness fix; leaving an expectation pointing at freed text is wrong regardless.
Add nfcthelperexpectfndestroy(), which walks the expectation table and drops every expectation whose ->expectfn matches the descriptor being torn down. Call it from each NAT helper's exit path after the existing RCU grace period, so no expectation outlives the code it points at and no extra synchronizercu() is introduced. With the fix, the same reproducer runs to completion without the Oops.
In the Linux kernel, the following vulnerability has been resolved:
usb: typec: tcpm: validate VDO count in Discover Identity ACK handlers
Properly validate the count passed from a device when calling svdmconsumeidentity() or svdmconsumeidentitysopprime() as the device-controlled value could index off of the static arrays, which could leak data.
In the Linux kernel, the following vulnerability has been resolved:
net/sched: fix packet loop on netem when duplicate is on
When netem duplicates a packet it re-enqueues the copy at the root qdisc. If another netem sits in the tree the copy can be duplicated again, recursing until the stack or memory is exhausted.
The original duplication guard temporarily zeroed q->duplicate around the re-enqueue, but that does not cover all cases because it is per-qdisc state shared across all concurrent enqueue paths and is not safe without additional locking.
Use the skb tcdepth field introduced in an earlier patch: - increment it on the duplicate before re-enqueue - skip duplication for any skb whose tcdepth is already non-zero.
This marks the packet itself rather than mutating qdisc state, therefore it is safe regardless of tree topology or concurrency.
In the Linux kernel, the following vulnerability has been resolved:
net: team: fix NULL pointer dereference in teamxmit during mode change
teamchangemode() clears team->ops with memset() before restoring safe dummy handlers via teamadjustops(). A concurrent teamxmit() running under RCU on another CPU can read team->ops.transmit during this window and call a NULL function pointer, crashing the kernel.
The race requires a mode change (CAPNETADMIN) concurrent with transmit on the team device.
BUG: kernel NULL pointer dereference, address: 0000000000000000 Oops: 0010 [#1] SMP KASAN NOPTI RIP: 0010:0x0 Call Trace: teamxmit (drivers/net/team/teamcore.c:1853) devhardstartxmit (net/core/dev.c:3904) devqueuexmit (net/core/dev.c:4871) packetsendmsg (net/packet/afpacket.c:3109) syssendto (net/socket.c:2265)
The original code assumed that no ports means no traffic, so mode changes could freely memset()/memcpy() the ops. AFPACKET with forced carrier breaks that assumption.
Prevent the race instead of making it safe: replace memset()/memcpy() with per-field updates that never touch transmit or receive. Those two handlers are managed solely by teamadjustops(), which already installs dummies when txenportcount == 0 (always true during mode change since no ports are present). WRITEONCE/READONCE prevent store/load tearing on the handler pointers.
synchronizenet() before exitop() drains in-flight readers that may still reference old mode state from before port removal switched the handlers to dummies.
gpio: rockchip: teardown bugs and resource leaks
In the Linux kernel, the following vulnerability has been resolved:
drm/v3d: Skip CSD when it has zeroed workgroups
A compute shader dispatch encodes its workgroup counts in the CFG0..CFG2 registers. Kicking off a dispatch with a zero count in any of the three dimensions is invalid. First, the hardware will process 0 as 65536, while the user-space driver exposes a maximum of 65535. Over that, a submission with a zeroed workgroup dimension should be a no-op.
These zeroed counts can reach the dispatch path through an indirect CSD job, whose workgroup counts are only known once the indirect buffer is read and may legitimately be zero, but such scenario should only result in a no-op.
Overwrite the indirect CSD job workgroup counts with the indirect BO ones, even if they are zeroed, and don't submit the job to the hardware when any of the workgroup counts is zero, so the job completes immediately instead of running the shader.
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/display: fix oops in suspend/shutdown without display
The xe driver keeps track of whether to probe display, and whether display hardware is there, using xe->info.probedisplay. It gets set to false if there's no display after inteldisplaydeviceprobe(). However, the display may also be disabled via fuses, detected at a later time in inteldisplaydeviceinforuntimeinit().
In this case, the xe driver does foreachintelcrtc() on uninitialized mode config in xedisplayflushcleanupwork(), leading to a NULL pointer dereference, and generally calls display code with display info cleared.
Check for inteldisplaydevicepresent() after inteldisplaydeviceinforuntimeinit(), and reset xe->info.probedisplay as necessary. Also do unsetdisplayfeatures() for completeness, although display runtime init has already done that. This will need to be unified across all cases later.
Move inteldisplaydeviceinforuntimeinit() call slightly earlier, similar to i915, to avoid a bunch of unnecessary setup for no display cases.
Note #1: The xe driver has no business doing low level display plumbing like foreachintelcrtc() to begin with. It all needs to happen in display code.
Note #2: The actual bug is present already in commit 44e694958b95 ("drm/xe/display: Implement display support"), but the oops was likely introduced later at commit ddf6492e0e50 ("drm/xe/display: Make display suspend/resume work on discrete").
(cherry picked from commit 7c3eb9f47533220888a67266448185fd0775d4da)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: revalidate bridge ports
ebtredirecttg() dereferences brportgetrcu() return without a NULL check, causing a kernel panic when the bridge port has been removed between the original hook invocation and an NFQUEUE reinject.
A mere NULL check isn't sufficient, however. As sashiko review points out userspace can not only remove the port from the bridge, it could also place the device in a different virtual device, e.g. macvlan.
If this happens, we must drop the packet, there is no way for us to reinject it into the bridge path.
Switch to upper API, we don't need the bridge port structure. Also, this fix keeps another bug intact:
Both nfnetlinklog and nfnetlinkqueue use CONFIGBRIDGENETFILTER too aggressive, which prevents certain logging features when queueing in bridge family: NETFILTERFAMILYBRIDGE can be enabled while the old CONFIGBRIDGENETFILTER cruft is off.
Fixes tag is a common ancestor, this was always broken.
In the Linux kernel, the following vulnerability has been resolved:
mm/memory-failure: fix hugetlblock AA deadlock in gethugepageforhwpoison
Two concurrent madvise(MADVHWPOISON) calls on the same hugetlb page can trigger a recursive spinlock self-deadlock (AA deadlock) on hugetlblock when racing with a concurrent unmap:
thread#0 thread#1 -------- -------- madvise(folio, MADVHWPOISON) -> poisons the folio successfully madvise(folio, MADVHWPOISON) unmap(folio) trymemoryfailurehugetlb gethugepageforhwpoison spinlockirq(&hugetlblock) <- held gethugepageforhwpoison hugetlbupdatehwpoison() -> MFHUGETLBFOLIOPREPOISONED goto out: folioput() refcount: 1 -> 0 freehugefolio() spinlockirqsave(&hugetlblock) -> AA DEADLOCK!
The out: path in gethugepageforhwpoison() calls folioput() to drop the GUP reference while the hugetlblock is still held by the hugetlb.c wrapper gethugepageforhwpoison(). If concurrent unmap has released the page table mapping reference, folioput() drops the folio refcount to zero, triggering freehugefolio() which attempts to re-acquire the non-recursive hugetlblock.
Fix this by moving hugetlblock acquisition from the hugetlb.c wrapper into gethugepageforhwpoison(). Place spinunlockirq() before the folioput() at the out: label so the folio is always released outside the lock.
[akpm@linux-foundation.org: fix race, rename label per Miaohe]
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftct: bail out on template ct in get eval
I noticed this issue while looking at a historic syzbot report [1].
A rule like the one below is enough to trigger the bug:
table ip t { chain pre { type filter hook prerouting priority raw; ct zone set 1 ct original saddr 1.2.3.4 accept } }
The first expression attaches a per-cpu template ct via nftctsetzoneeval() (nfcttmplalloc -> kzalloc, tuple is all zero, nfctl3num(ct) == 0). The next expression then calls nftctgeteval() on the same skb, treats the template as a real ct and hits the 16-byte memcpy path. With dreg at NFTREG3215 this overflows past struct nftregs on the kernel stack; with smaller dreg values it silently clobbers adjacent registers.
Reject template ct at the eval entry and in nftctgetfasteval(), mirroring the check nftctseteval() already has. Additionally, bound the address copy in NFTCTSRC / NFTCTDST by priv->len instead of by nfctl3num(ct): nfctgettuple() zeroes the tuple before pkttotuple() fills in only the protocol-relevant leading bytes, so the trailing bytes of tuple->{src,dst}.u3.all are well-defined zero. priv->len is validated at rule load, so the copy size is now bounded by the destination register rather than by an untrusted field on the conntrack.
[1]: https://syzkaller.appspot.com/bug?id=389cf09cb72926114fce90dc85a2c3231dcb647c
gpio: rockchip: fix generic IRQ chip leak on remove
hsr: Remove WARNONCE() in hsraddrisself().
In the Linux kernel, the following vulnerability has been resolved:
usb: typec: tcpm/tcpcimaxim: validate header NDO against RXBYTECNT
A broken/malicious port can transmit a CRC-valid frame whose header advertises up to seven data objects but whose body carries fewer than that. Check for this, and rightfully reject the message, instead of reading from uninitialized stack memory.
In the Linux kernel, the following vulnerability has been resolved:
net: mana: Add NULL guards in teardown path to prevent panic on attach failure
When queue allocation fails partway through, the error cleanup frees and NULLs apc->txqp and apc->rxqs. Multiple teardown paths such as manaremove(), manachangemtu() recovery, and internal error handling in manaallocqueues() can subsequently call into functions that dereference these pointers without NULL checks:
- manachnsetxdp() dereferences apc->rxqs[0], causing a NULL pointer dereference panic (CR2: 0000000000000000 at manachnsetxdp+0x26). - manadestroyvport() iterates apc->rxqs without a NULL check. - manafencerqs() iterates apc->rxqs without a NULL check. - manadeallocqueues() iterates apc->txqp without a NULL check.
Add NULL guards for apc->rxqs in manafencerqs(), manadestroyvport(), and before the manachnsetxdp() call. Add a NULL guard for apc->txqp in manadeallocqueues() to skip TX queue draining when TX queues were never allocated or already freed.
ethtool: rss: fix indirtable and hkey leak on getrxfh failure
In the Linux kernel, the following vulnerability has been resolved:
tty: serial: samsung: Remove redundant port lock acquisition in rx helpers
Sashiko identified a deadlock when the console flow is engaged [1].
When console flow control is enabled (UPFCONSFLOW), s3c24xxserialstoptx() calls s3c24xxserialrxenable() and s3c24xxserialstarttx() calls s3c24xxserialrxdisable().
The serial core framework invokes the .stoptx() and .starttx() callbacks with the port->lock spinlock already held. Furthermore, all internal driver paths that invoke stoptx (such as the DMA TX completion handler s3c24xxserialtxdmacomplete() or the PIO TX IRQ handler s3c24xxserialtxirq()) also acquire port->lock prior to calling it. (Note that s3c24xxserialstarttx() is only invoked by the serial core).
However, s3c24xxserialrxenable() and s3c24xxserialrxdisable() unconditionally attempt to acquire port->lock again using uartportlockirqsave(). Since spinlocks are not recursive, this causes a deadlock on the same CPU when console flow control is engaged.
Remove the redundant lock acquisition from both rx helper functions.
In the Linux kernel, the following vulnerability has been resolved:
netfilter: conntrack: tcp: do not force CLOSE on invalid-seq RST without direction check
An unintended behavior in the TCP conntrack state machine allows a connection to be forced into the CLOSE state using an RST packet with an invalid sequence number.
Specifically, after a SYN packet is observed, an RST with an invalid SEQ can transition the conntrack entry to TCPCONNTRACKCLOSE, regardless of whether the RST corresponds to the expected reply direction. The relevant code path assumes the RST is a response to an outgoing SYN, but does not validate packet direction or ensure that a matching SYN was actually sent in the opposite direction.
As a result, a crafted packet sequence consisting of a SYN followed by an invalid-sequence RST can prematurely terminate an active NAT entry. This makes connection teardown easier than intended.
So, tighten the state transition logic to ensure that RST-triggered CLOSE transitions only occur when the RST is a valid response to a previously observed SYN in the correct direction.
In the Linux kernel, the following vulnerability has been resolved:
iio: gyro: adis16260: fix division by zero in writeraw
Add a validation check for the sampling frequency value before using it as a divisor. A user writing zero to the samplingfrequency sysfs attribute triggers a division by zero in the kernel.
In the Linux kernel, the following vulnerability has been resolved:
Input: usbtouchscreen - clamp NEXIO datalen/xlen to URB buffer size
nexioreaddata() pulls datalen and xlen from a packed be16 header in the device's interrupt packet and then walks packet->data[0..xlen) and packet->data[xlen..datalen) comparing each byte against a threshold.
Both fields are 16-bit on the wire (max 65535). The existing adjustments shave at most 0x100 / 0x80 off, so the loop bound can still reach roughly 0xfeff. The URB transfer buffer for NEXIO is reptsize (1024) bytes from usballoccoherent(), with the first 7 occupied by the packed header — so packet->data[] has 1017 valid bytes. readdata() callbacks are not given urb->actuallength, and nothing else bounds the walk.
A device that lies about its length can get a ~64 KiB out-of-bounds read past the coherent DMA allocation. The first index whose byte exceeds NEXIOTHRESHOLD lands in beginx / beginy and from there into the reported touch coordinates, so adjacent kernel memory contents leak to userspace as ABSX / ABSY events. Far enough out, the read can also hit an unmapped page and fault.
Fix this all by clamping datalen to the buffer's data[] capacity and xlen to datalen.
In the Linux kernel, the following vulnerability has been resolved:
net/802/mrp: fix vector attribute parsing in mrppduparsevecattr
In mrppduparsevecattr(), vector attribute events are encoded three per byte and valen tracks the number of events left to process.
The parser decrements valen after processing the first and second events from each event byte, but not after processing the third one. When valen is exactly a multiple of three, the loop continues after the last valid event and consumes the next byte as a new event byte, applying a spurious event to the MRP applicant state.
Additionally, when valen is zero the parser unconditionally consumes attrlen bytes as FirstValue and advances the offset, even though per IEEE 802.1ak a VectorAttribute with only a LeaveAllEvent has valen of zero and no FirstValue or Vector fields. This corrupts the offset for subsequent PDU parsing.
Also, when valen exceeds three the loop crosses byte boundaries but the attribute value is not incremented between the last event of one byte and the first event of the next. This causes the first event of the next byte to use the same attribute value as the third event rather than the next consecutive value.
Decrement valen after processing the third event, skip FirstValue consumption when valen is zero, and increment the attribute value at the end of each loop iteration.
In the Linux kernel, the following vulnerability has been resolved:
HID: wacom: Fix OOB write in wacomhidsetdevicemode()
wacomhidsetdevicemode() currently assumes that the HIDDGINPUTMODE usage is always located in the first field (field[0]) of the feature report. However, a device can specify HIDDGINPUTMODE in a different field.
If HIDDGINPUTMODE is in a field other than the first one and the first field has a reportcount smaller than the usageindex of HIDDGINPUTMODE, this leads to an out-of-bounds write to r->field[0]->value.
Fix this by storing the field index of HIDDGINPUTMODE in 'struct hiddata' during feature mapping. In wacomhidsetdevicemode(), use this stored field index to access the correct field and add bounds checks to ensure both the field index and the value index are within valid ranges before writing.
In the Linux kernel, the following vulnerability has been resolved:
ip6: vti: Use ip6tnl.net in vti6siocdevprivate().
After patch 1/2 in this series, vti6update() unlinks and relinks the tunnel through t->net. vti6siocdevprivate() still uses devnet(dev) for the collision lookup. For a tunnel moved through IFLANETNSFD, devnet(dev) is the new netns, not t->net.
SIOCCHGTUNNEL on a migrated tunnel then runs:
net = devnet(dev) / migrated netns / t = vti6locate(net, &p1, false) / misses target in t->net / ... t = netdevpriv(dev) vti6update(t, &p1, false) / mutates t->net's hash /
A caller in the migrated netns picks params that match a tunnel in the creation netns. The lookup in devnet(dev) finds nothing. vti6update() prepends the migrated tunnel at the head of the creation netns hash bucket for those params. Later lookups in the creation netns resolve to the migrated device. xfrm receive delivers the matched packets through a device the caller controls.
Reachable from an unprivileged user namespace (unshare --user --map-root-user --net). Cross tenant scope on container hosts.
Switch the SIOCCHGTUNNEL path on a non fallback device to use t->net for the lookup. The lookup now matches the netns vti6update() operates on.
Also add nscapable(self->net->userns, CAPNETADMIN) before the lookup. The check at the top of the case is against devnet(dev)->userns, which after migration is the attacker's netns. A caller there can pick params absent from self->net, the lookup returns NULL, t becomes self, and vti6update() inserts the device into the creation netns hash. The new check requires CAPNETADMIN in the creation netns userns too.
SIOCADDTUNNEL and SIOCCHGTUNNEL on the fallback device keep devnet(dev), which equals initnet there.