In the Linux kernel, the following vulnerability has been resolved:
drm/hyperv: validate VMBus packet size in receive callback
hypervreceivesub() reads msg->vidhdr.type and dispatches into one of four message-type branches without knowing how many bytes the host wrote into hv->recvbuf. The completion path then runs memcpy(hv->initbuf, msg, VMBUSMAXPACKETSIZE), so the consumer that wakes on waitforcompletiontimeout() can read up to 16 KiB of residue from a prior message as if it were the response payload.
Pass bytesrecvd into hypervreceivesub() and reject any packet that does not cover the pipe + synthvid header. A single switch on msg->vidhdr.type then computes the type-specific payload size: the three completion-driving types (SYNTHVIDVERSIONRESPONSE, SYNTHVIDRESOLUTIONRESPONSE, SYNTHVIDVRAMLOCATIONACK) fall through to a shared exit that requires that size before memcpy/complete, while SYNTHVIDFEATURECHANGE validates its own payload and returns before reading isdirtneeded. Unknown types are dropped.
SYNTHVIDRESOLUTIONRESPONSE is variable length: the host fills resolutioncount entries, not the full SYNTHVIDMAXRESOLUTIONCOUNT array. Validate the fixed prefix first so resolutioncount can be read, bound it against the array, then require only the count-sized array, so the shorter responses the host actually sends are accepted.
Only run the sub-handler when vmbusrecvpacket() returned success. The memcpy length is bytesrecvd, which is bounded by VMBUSMAXPACKETSIZE only on a successful receive; on -ENOBUFS vmbusrecvpacket() instead reports the required length, which can exceed hv->recvbuf, so copying bytesrecvd would read and write past the 16 KiB buffers. Gating on the success return keeps the copy bounded. The nonzero-return path is itself a malformed-message case and is now logged rather than silently skipped; channel recovery is not attempted.
Rejected packets are reported via drmerrratelimited() rather than silently dropped, matching the CoCo-hardened pattern in hvkvponchannelcallback().
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:
ethtool: tsconfig: fix missing ethnlopscomplete()
tsconfigpreparedata() calls ethnlopsbegin(), we need to call ethnlopscomplete() before returning the error.
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:
LoongArch: Report dying CPU to RCU in stopthiscpu()
This is a port of MIPS commit 9f3f3bdc6d9dac1 ("MIPS: smp: report dying CPU to RCU in stopthiscpu()"). smpsendstop() parks all secondary CPUs in stopthiscpu(). And the function marks the CPU offline for the scheduler via setcpuonline(false) but never informs RCU, so RCU keeps expecting a quiescent state from CPUs that are now spinning forever with interrupts disabled.
As long as nothing waits for an RCU grace period after smpsendstop() this is harmless, which is why it went unnoticed. However, since commit 91840be8f710370 ("irqwork: Fix use-after-free in irqworksingle() on PREEMPTRT"), irqworksync() calls synchronizercu() on architectures without an irqwork self-IPI, i.e. where archirqworkhasinterrupt() returns false. Any irqworksync() issued in the reboot/shutdown/halt path after smpsendstop() then blocks on a grace period that can never complete, hanging the reboot:
WARNING: CPU: 0 PID: 15 at kernel/irqwork.c:144 irqworkqueueon ... rcu: INFO: rcusched detected stalls on CPUs/tasks: rcu: Offline CPU 1 blocking current GP. rcu: Offline CPU 2 blocking current GP. rcu: Offline CPU 3 blocking current GP.
This issue needs some hacks to reproduce, and it was not noticed on LoongArch because archirqworkhasinterrupt() usually returns true.
Call rcutreereportcpudead() once interrupts are disabled, mirroring the generic CPU-hotplug offline path, so RCU stops waiting on the parked CPUs and grace periods can still complete. LoongArch shuts down all CPUs here without going through the CPU-hotplug mechanism, so this report is not otherwise issued.
In the Linux kernel, the following vulnerability has been resolved:
MIPS: smp: report dying CPU to RCU in stopthiscpu()
smpsendstop() parks all secondary CPUs in stopthiscpu(). The function marks the CPU offline for the scheduler via setcpuonline(false) but never informs RCU, so RCU keeps expecting a quiescent state from CPUs that are now spinning forever with interrupts disabled.
As long as nothing waits for an RCU grace period after smpsendstop() this is harmless, which is why it went unnoticed. Since commit 91840be8f710 ("irqwork: Fix use-after-free in irqworksingle() on PREEMPTRT") however, irqworksync() calls synchronizercu() on architectures without an irqwork self-IPI, i.e. where archirqworkhasinterrupt() returns false. That is the asm-generic default used by MIPS. Any irqworksync() issued in the reboot/shutdown path after smpsendstop() then blocks on a grace period that can never complete, hanging the reboot:
WARNING: CPU: 0 PID: 15 at kernel/irqwork.c:144 irqworkqueueon ... rcu: INFO: rcusched detected stalls on CPUs/tasks: rcu: Offline CPU 1 blocking current GP. rcu: Offline CPU 2 blocking current GP. rcu: Offline CPU 3 blocking current GP.
This issue was noticed on several Realtek MIPS switch SoCs (MIPS interAptiv) and came up during kernel bump downstream in OpenWrt from 6.18.33 to 6.18.34, after the backport of the patch to the 6.18 stable branch. The patch also has been backported all the way back to 6.1.
Call rcutreereportcpudead() once interrupts are disabled, mirroring the generic CPU-hotplug offline path, so RCU stops waiting on the parked CPUs and grace periods can still complete. MIPS shuts down all CPUs here without going through the CPU-hotplug mechanism, so this report is not otherwise issued. Reporting a dying CPU to RCU outside the regular hotplug offline path is not unprecedented: arm64 does the same in cpudieearly(). There it is an exception for a CPU that was coming online and is aborting bringup, rather than the default shutdown action as on MIPS.
In the Linux kernel, the following vulnerability has been resolved:
ASoC: codecs: simple-mux: Fix enum control bounds check
simplemuxcontrolput() rejects values greater than e->items, but enum control values are zero based. For the two-entry mux used by this driver, valid values are 0 and 1, so value 2 must be rejected as well.
Accepting e->items can store an invalid mux state, pass it to the GPIO setter, and pass it on to the DAPM mux update path where it is used as an index into the enum text array.
Use the same >= e->items check used by the ASoC enum helpers.
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: net2280: Fix double free in probe error path
usbinitializegadget() installs gadgetrelease() as the release callback for the embedded gadget device. The struct net2280 instance is therefore released through gadgetrelease() when the gadget device's last reference is dropped.
The probe error path calls net2280remove(), which tears down the partially initialized device and drops the gadget reference with usbputgadget(). Calling kfree(dev) afterwards can free the same object again.
Drop the explicit kfree() and let the gadget device release callback handle the final free. This issue was found by a static analysis tool I am developing.
gpio: rockchip: teardown bugs and resource leaks
In the Linux kernel, the following vulnerability has been resolved:
gpio: shared: fix deadlock on shared proxy's parent removal
Commit 710abda58055 ("gpio: shared: call gpiochip::ofxlate() if set") used the mutex embedded in struct gpiosharedentry to protect the offset field which now can be modified after assignment. The critical section however is too wide and introduced a potential deadlock on the removal of the shared GPIO proxy's parent.
Make the critical section shorter - only protect the offset when it's being read.
While at it: mention the fact that the entry lock is now also used to protect against concurrent access to the offset field in the structure's documentation.
In the Linux kernel, the following vulnerability has been resolved:
i2c: davinci: fix division by zero on missing clock-frequency
When the 'clock-frequency' property is missing from the device tree, the driver falls back to DAVINCII2CDEFAULTBUSFREQ. However, this macro was defined in kHz (100), whereas the device tree property is expected in Hz.
The probe function divided the fallback value by 1000, causing integer truncation that resulted in dev->busfreq = 0. This triggered a deterministic division-by-zero kernel panic when calculating clock dividers later in the probe sequence.
Fix this by redefining DAVINCII2CDEFAULTBUSFREQ in Hz (100000) to match the expected device tree property unit, allowing the existing division logic to work correctly for both cases.
In the Linux kernel, the following vulnerability has been resolved:
tty: serial: pchuart: add check for dmaalloccoherent()
Add a check for dmaalloccoherent() failure to prevent a potential NULL pointer dereference in dmahandlerx(). Properly release DMA channels and the PCI device reference using a goto ladder if the allocation fails.
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: uvc: hold opts->lock across XU walks in uvcfunctionbind
uvcfunctionbind() walks &opts->extensionunits twice without holding opts->lock:
- directly, for the iExtension string-descriptor fixup loop; - indirectly, four times via uvccopydescriptors() (once per speed), where the helper iterates uvc->desc.extensionunits (which aliases &opts->extensionunits) to size and emit XU descriptors.
The configfs side (uvcgextensionmake / uvcgextensiondrop, in drivers/usb/gadget/function/uvcconfigfs.c) takes opts->lock around its listaddtail / listdel operations. A privileged userspace process that holds the configfs subtree open and writes the gadget UDC name to bind the function while concurrently rmdir()'ing an extensions subdir can race uvcgextensiondrop() against the bind-time list walks and dereference a freed struct uvcgextension.
Hold opts->lock from the start of the XU string-descriptor fixup through the last uvccopydescriptors() call, releasing on the descriptor-error path via a new errorunlock label that drops the lock before falling through to the existing error label. This matches the locking discipline of the configfs callbacks and removes the only remaining unsynchronised reader of the XU list during bind.
Reachability: only privileged processes that can mount configfs and write to gadget UDC files can trigger the race, so this is a correctness fix rather than a security boundary.
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.
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:
ACPI: button: Fix ACPI GPE handler leak during removal
Commit a7e23ec17fee ("ACPI: button: Install notifier for system events as well") changed the ACPI notify handler type for ACPI buttons to ACPIALLNOTIFY, but it forgot to update acpibuttonremove() to reflect that change. This leads to leaking the notify handler past driver removal, which may cause a kernel crash to occur if ACPI notify on the given device is triggered after removing the driver, and causes a subsequent probe of the given device with the same driver to fail.
Address this by updating the acpiremovenotifyhandler() call in acpibuttonremove() as appropriate.
In the Linux kernel, the following vulnerability has been resolved:
xfrm: Check for underflow in xfrmstatemtu
Leo Lin reported OOB write issue in esp component:
xfrmstatemtu() returns u32 but performs its arithmetic in unsigned modulo-2^32 space using an attacker-influenced "headerlen + authsize + netadj" subtracted from a small "mtu" argument. A nobody user can install an IPv4 ESP tunnel SA with a large authentication key (XFRMAALGAUTHTRUNC, e.g. hmac(sha512), 64-byte key, 64-byte trunc), configure a small interface MTU (68 bytes), and set XFRMATFCPAD to a large value. When a single UDP datagram is then sent through the tunnel, xfrmstatemtu() underflows to a near-2^32 value, and espoutput() consumes it as a signed int via:
padto = min(x->tfcpad, xfrmstatemtu(x, mtucached)) esp.tfclen = padto - skb->len (assigned to int)
esp.tfclen ends up negative (e.g. -207). It is sign-extended to sizet when passed to memset() inside espoutputfilltrailer(), producing a ~16 EB write of zeroes at skbtailpointer(skb). KASAN logs it as "Write of size 18446744073709551537 at addr ffff888...".
Check for underflow and return 1. This causes the sendmsg attempt to fail with ENETUNREACH.
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 ]
In the Linux kernel, the following vulnerability has been resolved:
net/iucv: fix locking in .getsockopt
Mirror iucvsocksetsockopt() and wrap the whole switch in locksock()/releasesock(). The pre-existing SOMSGLIMIT-only lock becomes redundant and is removed.
Any AFIUCV HIPER user can potentially crash the kernel by racing recvmsg() with getsockopt(SOMSGSIZE): the SOMSGSIZE arm dereferences iucv->hsdev->mtu after iucvsockclose() (called from the racing recvmsg()) has set hsdev to NULL, producing a NULL pointer dereference oops.
In the Linux kernel, the following vulnerability has been resolved:
ethtool: rss: fix indirtable and hkey leak on getrxfh failure
In the Linux kernel, the following vulnerability has been resolved:
ethtool: module: call ethnlopscomplete() on module flash errors
When validate() fails we are skipping over ethnlopscomplete() even tho we already called ethnlopsbegin().
In the Linux kernel, the following vulnerability has been resolved:
ethtool: cmis: validate startcmdpayloadsize from module
The CMIS firmware update code reads startcmdpayloadsize from the module's FW Management Features CDB reply and uses it directly as the byte count for memcpy. The destination buffer is 112 bytes (ETHTOOLCMISCDBLPLMAXPLLENGTH - 8). So a malicious module (or corrupted response) can cause a OOB write later on in cmisfwupdatestartdownload().
Let's error out. If modules that expect longer LPL writes actually exist we should revisit.
struct cmiscdbstartfwdownloadpl's definition has to move, no change there.
In the Linux kernel, the following vulnerability has been resolved:
In the Linux kernel, the following vulnerability has been resolved:
bonding: refuse to enslave CAN devices
syzbot reported a kernel paging request crash in canrxunregister() inside net/can/afcan.c. The crash occurs because a virtual CAN device (vxcan) is being enslaved to a bonding master.
During the enslavement process, the bonding driver mutates and modifies the network device states to fit an Ethernet-like aggregation model. However, CAN devices operate on a completely different Layer 2 architecture, relying on the CAN mid-layer private data structure (canmlpriv) instead of standard Ethernet structures. Since bonding does not initialize or maintain these CAN structures, subsequent operations on the half-enslaved interface (such as closing associated sockets via isotprelease) lead to a null-pointer dereference when accessing the CAN receiver lists.
Bonding CAN interfaces is architecturally invalid as CAN lacks MAC addresses, ARP capabilities, and standard Ethernet link-layer mechanisms. While generic loopback devices are blocked globally in net/core/dev.c, virtual CAN devices bypass this check because they do not carry the IFFLOOPBACK flag, despite acting as local software-loopbacks.
Fix this by explicitly blocking network devices of type ARPHRDCAN from being enslaved at the very beginning of bondenslave(). This prevents illegal state mutations, eliminates the resulting KASAN crashes, and avoids potential memory leaks from incomplete socket cleanups.
As the CAN support has been added a long time after bonding the Fixes-tag points to the introduction of ARPHRDCAN that would have needed a specific handling in bondingmain.c.
In the Linux kernel, the following vulnerability has been resolved:
bridge: Fix sleep in atomic context in netlink path
Since the introduction of the netlink configuration path for bridge ports in commit 25c71c75ac87 ("bridge: bridge port parameters over netlink"), brsetport() was always called with the bridge lock held around it. Back then this decision made sense: The bridge lock protects the STP state of the bridge and its ports and at that time the function only processed three STP related netlink attributes (cost, priority and state).
Nowadays, brsetport() processes a lot more attributes and most of them do not need the bridge lock:
Bridge flags: Only require RTNL. Read locklessly by the data path. Annotations can be added in net-next.
FDB port flushing: Only requires the FDB lock.
Multicast attributes: Only require the multicast lock.
Group forward mask: Only requires RTNL. Read locklessly by the data path. Annotations can be added in net-next.
Backup port and NHID: Only require RTNL. Read locklessly by the data path.
This is a problem as the bridge calls devsetpromiscuity() when certain bridge port flags change and this function can sleep since the commit cited below, resulting in a splat such as [1].
Fix this by reducing the scope of the bridge lock and only take it when processing the three STP related attributes that require it. This is consistent with the multicast attributes where each attribute acquires the multicast lock instead of having one critical section for all relevant attributes.
[1] BUG: sleeping function called from invalid context at net/core/devaddrlists.c:1262 inatomic(): 1, irqsdisabled(): 0, nonblock: 0, pid: 356, name: bridge preemptcount: 201, expected: 0 RCU nest depth: 0, expected: 0 2 locks held by bridge/356: #0: ffffffff919473a0 (rtnlmutex){+.+.}-{4:4}, at: rtnetlinkrcvmsg (net/core/rtnetlink.c:80 net/core/rtnetlink.c:7002) #1: ffff888115072d58 (&br->lock){+...}-{3:3}, at: brsetlink (./include/linux/spinlock.h:348 net/bridge/brnetlink.c:1117) Preemption disabled at: 0x0 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 Call Trace: <TASK> dumpstacklvl (lib/dumpstack.c:94 lib/dumpstack.c:120) mightresched.cold (kernel/sched/core.c:9163) netifrxmoderun (net/core/devaddrlists.c:1262) netifrxmodesync (net/core/devaddrlists.c:1428) devsetpromiscuity (net/core/devapi.c:289) brmanagepromisc (net/bridge/brif.c:135 net/bridge/brif.c:172) brportflagschange (net/bridge/brif.c:242 net/bridge/brif.c:747) brsetport (net/bridge/brnetlink.c:1000) brsetlink (net/bridge/brnetlink.c:1118) rtnlbridgesetlink (net/core/rtnetlink.c:5572) rtnetlinkrcvmsg (net/core/rtnetlink.c:7005) netlinkrcvskb (net/netlink/afnetlink.c:2550) netlinkunicast (net/netlink/afnetlink.c:1318 net/netlink/afnetlink.c:1344) netlinksendmsg (net/netlink/afnetlink.c:1894) socksendmsg (net/socket.c:787 (discriminator 4) net/socket.c:802 (discriminator 4)) syssendmsg (net/socket.c:2698) syssendmsg (net/socket.c:2752) syssendmsg (net/socket.c:2784) dosyscall64 (arch/x86/entry/syscall64.c:63 arch/x86/entry/syscall64.c:94) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:121)
In the Linux kernel, the following vulnerability has been resolved:
bridge: Fix sleep in atomic context in sysfs path
Since the start of the git history, brportstore() always acquired the bridge lock. Back then this decision made sense: The bridge lock protects the STP state of the bridge and its ports and at that time the function was only used by two STP related attributes (cost and priority).
Nowadays, brportstore() processes a lot more attributes and most of them do not need the bridge lock:
Bridge flags: Only require RTNL. Read locklessly by the data path. Annotations can be added in net-next.
FDB port flushing: Only requires the FDB lock.
Multicast attributes: Only require the multicast lock.
Group forward mask: Only requires RTNL. Read locklessly by the data path. Annotations can be added in net-next.
Backup port: Only requires RTNL. Read locklessly by the data path.
This is a problem as the bridge calls devsetpromiscuity() when certain bridge port flags change and this function can sleep since the commit cited below, resulting in a splat such as [1].
Fix this by reducing the scope of the bridge lock and only take it when processing the two STP related attributes that require it. Remove the now stale comment from brswitchdevsetportflag(). The SWITCHDEVFDEFER flag can be removed in net-next.
[1] BUG: sleeping function called from invalid context at net/core/devaddrlists.c:1262 inatomic(): 1, irqsdisabled(): 0, nonblock: 0, pid: 372, name: bash preemptcount: 201, expected: 0 RCU nest depth: 0, expected: 0 5 locks held by bash/372: #0: ffff88810c51c3f0 (sbwriters#7){.+.+}-{0:0}, at: ksyswrite (fs/readwrite.c:740) #1: ffff888115ce9480 (&of->mutex){+.+.}-{4:4}, at: kernfsfopwriteiter (fs/kernfs/file.c:343) #2: ffff88810b9fd330 (kn->active#37){.+.+}-{0:0}, at: kernfsfopwriteiter (fs/kernfs/file.c:80 fs/kernfs/file.c:344) #3: ffffffffa59473a0 (rtnlmutex){+.+.}-{4:4}, at: brportstore (net/bridge/brsysfsif.c:326) #4: ffff8881099d2d58 (&br->lock){+...}-{3:3}, at: brportstore (./include/linux/spinlock.h:348 net/bridge/brsysfsif.c:345) Preemption disabled at: 0x0 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 Call Trace: <TASK> dumpstacklvl (lib/dumpstack.c:94 lib/dumpstack.c:120) mightresched.cold (kernel/sched/core.c:9163) netifrxmoderun (net/core/devaddrlists.c:1262) netifrxmodesync (net/core/devaddrlists.c:1428) devsetpromiscuity (net/core/devapi.c:289) brmanagepromisc (net/bridge/brif.c:135 net/bridge/brif.c:172) brportflagschange (net/bridge/brif.c:242 net/bridge/brif.c:747) storelearning (net/bridge/brsysfsif.c:79 net/bridge/brsysfsif.c:235) brportstore (net/bridge/brsysfsif.c:346) kernfsfopwriteiter (fs/kernfs/file.c:352) newsyncwrite (fs/readwrite.c:595) vfswrite (fs/readwrite.c:688) ksyswrite (fs/readwrite.c:740) dosyscall64 (arch/x86/entry/syscall64.c:63 arch/x86/entry/syscall64.c:94) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:121)
In the Linux kernel, the following vulnerability has been resolved:
ethtool: tsinfo: don't pass ERRPTR to genlmsgcancel on prepare failure
The goto err label leads to:
genlmsgcancel(skb, ehdr); return ret;
If ethnltsinfopreparedump() failed, it has not started a genlmsg. There's nothing to cancel, and passing an error pointer to genlmsgcancel() would cause a crash.
In the Linux kernel, the following vulnerability has been resolved:
ethtool: eeprom: add more safeties to EEPROM Netlink fallback
The Netlink fallback path for reading module EEPROM (fallbacksetparams()) validates that offset < eepromlen, but does not check that offset + length stays within eepromlen. The ioctl equivalent (ethtoolgetanyeeprom() in ioctl.c) has always enforced both bounds:
if (eeprom.offset + eeprom.len > totallen) return -EINVAL;
This could lead to surprises in both drivers and device FW. Add the missing offset + length validation to fallbacksetparams(), mirroring the ioctl.
Similarly - ethtool core in general, and ethtoolgetanyeeprom() in particular tries to zero-init all buffers passed to the drivers to avoid any extra work of zeroing things out. eepromfallback() uses a plain kmalloc(), change it to zalloc.
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.