In the Linux kernel, the following vulnerability has been resolved:
libceph: prevent potential out-of-bounds reads in handleauthdone()
Perform an explicit bounds check on payloadlen to avoid a possible out-of-bounds access in the callout.
[ idryomov: changelog ]
In the Linux kernel, the following vulnerability has been resolved:
libceph: replace overzealous BUGON in osdmapapplyincremental()
If the osdmap is (maliciously) corrupted such that the incremental osdmap epoch is different from what is expected, there is no need to BUG. Instead, just declare the incremental osdmap to be invalid.
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: Fix race condition in hidpsessionthread
There is a potential race condition in hidpsessionthread that may lead to use-after-free. For instance, the timer is active while hidpdeltimer is called in hidpsessionthread(). After hidpsessionput, then 'session' will be freed, causing kernel panic when hidpidletimeout is running.
The solution is to use deltimersync instead of deltimer.
Here is the call trace:
? hidpsessionprobe+0x780/0x780 calltimerfn+0x2d/0x1e0 runtimers.part.0+0x569/0x940 hidpsessionprobe+0x780/0x780 calltimerfn+0x1e0/0x1e0 ktimeget+0x5c/0xf0 lapicnextdeadline+0x2c/0x40 clockeventsprogramevent+0x205/0x320 runtimersoftirq+0xa9/0x1b0 dosoftirq+0x1b9/0x641 irqexitrcu+0xdc/0x190 irqexitrcu+0xe/0x20 sysvecapictimerinterrupt+0xa1/0xc0
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: L2CAP: Fix potential user-after-free
This fixes all instances of which requires to allocate a buffer calling allocskb which may release the chan lock and reacquire later which makes it possible that the chan is disconnected in the meantime.
In the Linux kernel, the following vulnerability has been resolved:
nvme-pci: fix mempool alloc size
Convert the max size to bytes to match the units of the divisor that calculates the worst-case number of PRP entries.
The result is used to determine how many PRP Lists are required. The code was previously rounding this to 1 list, but we can require 2 in the worst case. In that scenario, the driver would corrupt memory beyond the size provided by the mempool.
While unlikely to occur (you'd need a 4MB in exactly 127 phys segments on a queue that doesn't support SGLs), this memory corruption has been observed by kfence.
In the Linux kernel, the following vulnerability has been resolved:
hfs: Fix OOB Write in hfsasc2mac
Syzbot reported a OOB Write bug:
loop0: detected capacity change from 0 to 64 ================================================================== BUG: KASAN: slab-out-of-bounds in hfsasc2mac+0x467/0x9a0 fs/hfs/trans.c:133 Write of size 1 at addr ffff88801848314e by task syz-executor391/3632
Call Trace: <TASK> dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0x1b1/0x28e lib/dumpstack.c:106 printaddressdescription+0x74/0x340 mm/kasan/report.c:284 printreport+0x107/0x1f0 mm/kasan/report.c:395 kasanreport+0xcd/0x100 mm/kasan/report.c:495 hfsasc2mac+0x467/0x9a0 fs/hfs/trans.c:133 hfscatbuildkey+0x92/0x170 fs/hfs/catalog.c:28 hfslookup+0x1ab/0x2c0 fs/hfs/dir.c:31 lookupopen fs/namei.c:3391 [inline] openlastlookups fs/namei.c:3481 [inline] pathopenat+0x10e6/0x2df0 fs/namei.c:3710 dofilpopen+0x264/0x4f0 fs/namei.c:3740
If in->len is much larger than HFSNAMELEN(31) which is the maximum length of an HFS filename, a OOB write could occur in hfsasc2mac(). In that case, when the dst reaches the boundary, the srclen is still greater than 0, which causes a OOB write. Fix this by adding a check on dstlen in while() before writing to dst address.
In the Linux kernel, the following vulnerability has been resolved:
fsi: occ: Prevent use after free
Use getdevice and putdevice in the open and close functions to make sure the device doesn't get freed while a file descriptor is open. Also, lock around the freeing of the device buffer and check the buffer before using it in the submit function.
In the Linux kernel, the following vulnerability has been resolved:
binfmtmisc: fix shift-out-of-bounds in checkspecialflags
UBSAN reported a shift-out-of-bounds warning:
left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: <TASK> dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0x8d/0xcf lib/dumpstack.c:106 ubsanepilogue+0xa/0x44 lib/ubsan.c:151 ubsanhandleshiftoutofbounds+0x1e7/0x208 lib/ubsan.c:322 checkspecialflags fs/binfmtmisc.c:241 [inline] createentry fs/binfmtmisc.c:456 [inline] bmregisterwrite+0x9d3/0xa20 fs/binfmtmisc.c:654 vfswrite+0x11e/0x580 fs/readwrite.c:582 ksyswrite+0xcf/0x120 fs/readwrite.c:637 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x34/0x80 arch/x86/entry/common.c:80 entrySYSCALL64afterhwframe+0x63/0xcd RIP: 0033:0x4194e1
Since the type of Node's flags is unsigned long, we should define these macros with same type too.
In the Linux kernel, the following vulnerability has been resolved:
erofs: validate the extent length for uncompressed pclusters
syzkaller reported a KASAN use-after-free: https://syzkaller.appspot.com/bug?extid=2ae90e873e97f1faf6f2
The referenced fuzzed image actually has two issues: - mpa == 0 as a non-inlined pcluster; - The logical length is longer than its physical length.
The first issue has already been addressed. This patch addresses the second issue by checking the extent length validity.
ALSA: usb-audio: Prevent excessive number of frames
f2fs: fix ISCHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes
In the Linux kernel, the following vulnerability has been resolved:
iommu/sva: invalidate stale IOTLB entries for kernel address space
Introduce a new IOMMU interface to flush IOTLB paging cache entries for the CPU kernel address space. This interface is invoked from the x86 architecture code that manages combined user and kernel page tables, specifically before any kernel page table page is freed and reused.
This addresses the main issue with vfree() which is a common occurrence and can be triggered by unprivileged users. While this resolves the primary problem, it doesn't address some extremely rare case related to memory unplug of memory that was present as reserved memory at boot, which cannot be triggered by unprivileged users. The discussion can be found at the link below.
Enable SVA on x86 architecture since the IOMMU can now receive notification to flush the paging cache before freeing the CPU kernel page table pages.
functionfs: fix the open/removal races
In the Linux kernel, the following vulnerability has been resolved:
accel/ivpu: Fix page fault in ivpubounbindallbosfromcontext()
Don't add BO to the vdev->bolist in ivpugemcreateobject(). When failure happens inside drmgemshmemcreate(), the BO is not fully created and ivpugembofree() callback will not be called causing a deleted BO to be left on the list.
In the Linux kernel, the following vulnerability has been resolved:
scsi: qla2xxx: Clear cmds after chip reset
Commit aefed3e5548f ("scsi: qla2xxx: target: Fix offline port handling and host reset handling") caused two problems:
1. Commands sent to FW, after chip reset got stuck and never freed as FW is not going to respond to them anymore.
2. BUGON(cmd->sgmapped) in qltfreecmd(). Commit 26f9ce53817a ("scsi: qla2xxx: Fix missed DMA unmap for aborted commands") attempted to fix this, but introduced another bug under different circumstances when two different CPUs were racing to call qltunmapsg() at the same time: BUGON(!validdmadirection(dir)) in dmaunmapsgattrs().
So revert "scsi: qla2xxx: Fix missed DMA unmap for aborted commands" and partially revert "scsi: qla2xxx: target: Fix offline port handling and host reset handling" at qla2x00abortallcmds.
In the Linux kernel, the following vulnerability has been resolved:
libceph: replace BUGON with bounds check for map->maxosd
OSD indexes come from untrusted network packets. Boundary checks are added to validate these against map->maxosd.
[ idryomov: drop BUGON in cephgetprimaryaffinity(), minor cosmetic edits ]
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to detect potential corrupted nid in freenidlist
As reported, on-disk footer.ino and footer.nid is the same and out-of-range, let's add sanity check on f2fsallocnid() to detect any potential corruption in freenidlist.
In the Linux kernel, the following vulnerability has been resolved:
wifi: ath12k: Fix MSDU buffer types handling in RX error path
Currently, packets received on the REO exception ring from unassociated peers are of MSDU buffer type, while the driver expects link descriptor type packets. These packets are not parsed further due to a return check on packet type in ath12khaldescreoparseerr(), but the associated skb is not freed. This may lead to kernel crashes and buffer leaks.
Hence to fix, update the RX error handler to explicitly drop MSDU buffer type packets received on the REO exception ring. This prevents further processing of invalid packets and ensures stability in the RX error handling path.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPLSILICONZ-1
amd/amdkfd: enhance kfd process check in switch partition
In the Linux kernel, the following vulnerability has been resolved:
drm/xe: Fix oops in xegemfault when running corehotunplug test.
I saw an oops in xegemfault when running the xe-fast-feedback testlist against the realtime kernel without debug options enabled.
The panic happens after corehotunplug unbind-rebind finishes. Presumably what happens is that a process mmaps, unlocks because of the FAULTFLAGRETRYNOWAIT logic, has no process memory left, causing ttmbovmdummypage() to return VMFAULTNOPAGE, since there was nothing left to populate, and then oopses in "memtypeisvram(tbo->resource->memtype)" because tbo->resource is NULL.
It's convoluted, but fits the data and explains the oops after the test exits.
In the Linux kernel, the following vulnerability has been resolved:
RDMA/efa: Fix wrong resources deallocation order
When trying to destroy QP or CQ, we first decrease the refcount and potentially free memory regions allocated for the object and then request the device to destroy the object. If the device fails, the object isn't fully destroyed so the user/IB core can try to destroy the object again which will lead to underflow when trying to decrease an already zeroed refcount.
Deallocate resources in reverse order of allocating them to safely free them.
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: fix underflow in chain reference counter
Set element addition error path decrements reference counter on chains twice: once on element release and again via nftdatarelease().
Then, d6b478666ffa ("netfilter: nftables: fix underflow in object reference counter") incorrectly fixed this by removing the stateful object reference count decrement.
Restore the stateful object decrement as in b91d90368837 ("netfilter: nftables: fix leaking object reference count") and let nftdatarelease() decrement the chain reference counter, so this is done only once.
In the Linux kernel, the following vulnerability has been resolved:
RDMA/siw: Fix potential NULL pointer dereference in header processing
If siwgethdr() returns -EINVAL before setrxfpducontext(), qp->rxfpdu can be NULL. The error path in siwtcprxdata() dereferences qp->rxfpdu->moreddpsegs without checking, which may lead to a NULL pointer deref. Only check moreddpsegs when rxfpdu is present.
KASAN splat: [ 101.384271] KASAN: null-ptr-deref in range [0x00000000000000c0-0x00000000000000c7] [ 101.385869] RIP: 0010:siwtcprxdata+0x13ad/0x1e50
In the Linux kernel, the following vulnerability has been resolved:
nfsd: provide locking for v4endgrace
Writing to v4endgrace can race with server shutdown and result in memory being accessed after it was freed - reclaimstrhashtbl in particularly.
We cannot hold nfsdmutex across the nfsd4endgrace() call as that is held while clienttrackingop->init() is called and that can wait for an upcall to nfsdcltrack which can write to v4endgrace, resulting in a deadlock.
nfsd4endgrace() is also called by the landromat work queue and this doesn't require locking as server shutdown will stop the work and wait for it before freeing anything that nfsd4endgrace() might access.
However, we must be sure that writing to v4endgrace doesn't restart the work item after shutdown has already waited for it. For this we add a new flag protected with nn->clientlock. It is set only while it is safe to make client tracking calls, and v4endgrace only schedules work while the flag is set with the spinlock held.
So this patch adds a nfsdnet field "clienttrackingactive" which is set as described. Another field "graceendforced", is set when v4endgrace is written. After this is set, and providing clienttrackingactive is set, the laundromat is scheduled. This "graceendforced" field bypasses other checks for whether the grace period has finished.
This resolves a race which can result in use-after-free.
ALSA: aloop: Fix racy access at PCM trigger
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix out-of-bounds access in sysfs attribute read/write
Some f2fs sysfs attributes suffer from out-of-bounds memory access and incorrect handling of integer values whose size is not 4 bytes.
For example: vm:~# echo 65537 > /sys/fs/f2fs/vde/carveout vm:~# cat /sys/fs/f2fs/vde/carveout 65537 vm:~# echo 4294967297 > /sys/fs/f2fs/vde/atgcagethreshold vm:~# cat /sys/fs/f2fs/vde/atgcagethreshold 1
carveout maps to {struct f2fssbinfo}->carveout, which is a 8-bit integer. However, the sysfs interface allows setting it to a value larger than 255, resulting in an out-of-range update.
atgcagethreshold maps to {struct atgcmanagement}->agethreshold, which is a 64-bit integer, but its sysfs interface cannot correctly set values larger than UINTMAX.
The root causes are: 1. sbistore() treats all default values as unsigned int, which prevents updating integers larger than 4 bytes and causes out-of-bounds writes for integers smaller than 4 bytes.
2. f2fssbishow() also assumes all default values are unsigned int, leading to out-of-bounds reads and incorrect access to integers larger than 4 bytes.
This patch introduces {struct f2fsattr}->size to record the actual size of the integer associated with each sysfs attribute. With this information, sysfs read and write operations can correctly access and update values according to their real data size, avoiding memory corruption and truncation.
In the Linux kernel, the following vulnerability has been resolved:
RDMA/umad: Reject negative datalen in ibumadwrite
ibumadwrite computes datalen from user-controlled count and the MAD header sizes. With a mismatched user MAD header size and RMPP header length, datalen can become negative and reach ibcreatesendmad(). This can make the padding calculation exceed the segment size and trigger an out-of-bounds memset in allocsendrmpplist().
Add an explicit check to reject negative datalen before creating the send buffer.
KASAN splat: [ 211.363464] BUG: KASAN: slab-out-of-bounds in ibcreatesendmad+0xa01/0x11b0 [ 211.364077] Write of size 220 at addr ffff88800c3fa1f8 by task spraythread/102 [ 211.365867] ibcreatesendmad+0xa01/0x11b0 [ 211.365887] ibumadwrite+0x853/0x1c80
In the Linux kernel, the following vulnerability has been resolved:
crypto: seqiv - Do not use req->iv after cryptoaeadencrypt
As soon as cryptoaeadencrypt is called, the underlying request may be freed by an asynchronous completion. Thus dereferencing req->iv after it returns is invalid.
Instead of checking req->iv against info, create a new variable unalignedinfo and use it for that purpose instead.
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: mmppdma: Fix race condition in mmppdmaresidue()
Add proper locking in mmppdmaresidue() to prevent use-after-free when accessing descriptor list and descriptor contents.
The race occurs when multiple threads call txstatus() while the tasklet on another CPU is freeing completed descriptors:
CPU 0 CPU 1 ----- ----- mmppdmatxstatus() mmppdmaresidue() -> NO LOCK held listforeachentry(sw, ..) DMA interrupt dmadotasklet() -> spinlock(&desclock) listmove(sw->node, ...) spinunlock(&desclock) | dmapoolfree(sw) <- FREED! -> access sw->desc <- UAF!
This issue can be reproduced when running dmatest on the same channel with multiple threads (threadsperchan > 1).
Fix by protecting the chainrunning list iteration and descriptor access with the chan->desclock spinlock.
drm/vmwgfx: Validate command header size against SVGACMDMAXDATASIZE