OESA-2024-2571

Source
https://www.openeuler.org/en/security/security-bulletins/detail/?id=openEuler-SA-2024-2571
Import Source
https://repo.openeuler.org/security/data/osv/OESA-2024-2571.json
JSON Data
https://api.test.osv.dev/v1/vulns/OESA-2024-2571
Upstream
Published
2024-12-20T13:07:47Z
Modified
2025-08-12T05:37:50.701371Z
Summary
kernel security update
Details

The Linux Kernel, the operating system core itself.

Security Fix(es):

In the Linux kernel, the following vulnerability has been resolved:

dmaengine: idxd: Let probe fail when workqueue cannot be enabled

The workqueue is enabled when the appropriate driver is loaded and disabled when the driver is removed. When the driver is removed it assumes that the workqueue was enabled successfully and proceeds to free allocations made during workqueue enabling.

Failure during workqueue enabling does not prevent the driver from being loaded. This is because the error path within drvenablewq() returns success unless a second failure is encountered during the error path. By returning success it is possible to load the driver even if the workqueue cannot be enabled and allocations that do not exist are attempted to be freed during driver remove.

Some examples of problematic flows: (a)

idxddmaenginedrvprobe() -> drvenablewq() -> idxdwqrequestirq(): In above flow, if idxdwqrequestirq() fails then idxdwqunmapportal() is called on error exit path, but drvenablewq() returns 0 because idxdwqdisable() succeeds. The driver is thus loaded successfully.

idxddmaenginedrvremove()->drvdisablewq()->idxdwqunmapportal() Above flow on driver unload triggers the WARN in devmiounmap() because the device resource has already been removed during error path of drvenable_wq().

(b)

idxddmaenginedrvprobe() -> drvenablewq() -> idxdwqrequestirq(): In above flow, if idxdwqrequestirq() fails then idxdwqinitpercpuref() is never called to initialize the percpu counter, yet the driver loads successfully because drvenable_wq() returns 0.

idxddmaenginedrvremove()->idxdwqquiesce()->percpuref_kill(): Above flow on driver unload triggers a BUG when attempting to drop the initial ref of the uninitialized percpu ref: BUG: kernel NULL pointer dereference, address: 0000000000000010

Fix the drvenablewq() error path by returning the original error that indicates failure of workqueue enabling. This ensures that the probe fails when an error is encountered and the driver remove paths are only attempted when the workqueue was enabled successfully.(CVE-2022-48868)

In the Linux kernel, the following vulnerability has been resolved: xhci: Handle TD clearing for multiple streams case When multiple streams are in use, multiple TDs might be in flight when an endpoint is stopped. We need to issue a Set TR Dequeue Pointer for each, to ensure everything is reset properly and the caches cleared. Change the logic so that any N>1 TDs found active for different streams are deferred until after the first one is processed, calling xhciinvalidatecancelledtds() again from xhcihandlecmdsetdeq() to queue another command until we are done with all of them. Also change the error/"should never happen" paths to ensure we at least clear any affected TDs, even if we can't issue a command to clear the hardware cache, and complain loudly with an xhciwarn() if this ever happens. This problem case dates back to commit e9df17eb1408 ("USB: xhci: Correct assumptions about number of rings per endpoint.") early on in the XHCI driver's life, when stream support was first added. It was then identified but not fixed nor made into a warning in commit 674f8438c121 ("xhci: split handling halted endpoints into two steps"), which added a FIXME comment for the problem case (without materially changing the behavior as far as I can tell, though the new logic made the problem more obvious). Then later, in commit 94f339147fc3 ("xhci: Fix failure to give back some cached cancelled URBs."), it was acknowledged again. [Mathias: commit 94f339147fc3 ("xhci: Fix failure to give back some cached cancelled URBs.") was a targeted regression fix to the previously mentioned patch. Users reported issues with usb stuck after unmounting/disconnecting UAS devices. This rolled back the TD clearing of multiple streams to its original state.] Apparently the commit author was aware of the problem (yet still chose to submit it): It was still mentioned as a FIXME, an xhcidbg() was added to log the problem condition, and the remaining issue was mentioned in the commit description. The choice of making the log type xhcidbg() for what is, at this point, a completely unhandled and known broken condition is puzzling and unfortunate, as it guarantees that no actual users would see the log in production, thereby making it nigh undebuggable (indeed, even if you turn on DEBUG, the message doesn't really hint at there being a problem at all). It took me months of random xHC crashes to finally find a reliable repro and be able to do a deep dive debug session, which could all have been avoided had this unhandled, broken condition been actually reported with a warning, as it should have been as a bug intentionally left in unfixed (never mind that it shouldn't have been left in at all). > Another fix to solve clearing the caches of all stream rings with > cancelled TDs is needed, but not as urgent. 3 years after that statement and 14 years after the original bug was introduced, I think it's finally time to fix it. And maybe next time let's not leave bugs unfixed (that are actually worse than the original bug), and let's actually get people to review kernel commits please. Fixes xHC crashes and IOMMU faults with UAS devices when handling errors/faults. Easiest repro is to use hdparm to mark an early sector (e.g. 1024) on a disk as bad, then cat /dev/sdX > /dev/null in a loop. At least in the case of JMicron controllers, the read errors end up having to cancel two TDs (for two queued requests to different streams) and the one that didn't get cleared properly ends up faulting the xHC entirely when it tries to access DMA pages that have since been unmapped, referred to by the stale TDs. This normally happens quickly (after two or three loops). After this fix, I left the cat in a loop running overnight and experienced no xHC failures, with all read errors recovered properly. Repro'd and tested on an Apple M1 Mac Mini (dwc3 host). On systems without an IOMMU, this bug would instead silently corrupt freed memory, making this a ---truncated---(CVE-2024-40927)

In the Linux kernel, the following vulnerability has been resolved: ocfs2: pass u64 to ocfs2truncateinline maybe overflow Syzbot reported a kernel BUG in ocfs2truncateinline. There are two reasons for this: first, the parameter value passed is greater than ocfs2maxinlinedatawithxattr, second, the start and end parameters of ocfs2truncateinline are "unsigned int". So, we need to add a sanity check for bytestart and bytelen right before ocfs2truncateinline() in ocfs2removeinoderange(), if they are greater than ocfs2maxinlinedatawith_xattr return -EINVAL.(CVE-2024-50218)

In the Linux kernel, the following vulnerability has been resolved: x86/CPU/AMD: Clear virtualized VMLOAD/VMSAVE on Zen4 client A number of Zen4 client SoCs advertise the ability to use virtualized VMLOAD/VMSAVE, but using these instructions is reported to be a cause of a random host reboot. These instructions aren't intended to be advertised on Zen4 client so clear the capability.(CVE-2024-53114)

In the Linux kernel, the following vulnerability has been resolved: initramfs: avoid filename buffer overrun The initramfs filename field is defined in Documentation/driver-api/early-userspace/buffer-format.rst as: 37 cpiofile := ALGN(4) + cpioheader + filename + "\0" + ALGN(4) + data ... 55 ============= ================== ========================= 56 Field name Field size Meaning 57 ============= ================== ========================= ... 70 cnamesize 8 bytes Length of filename, including final \0 When extracting an initramfs cpio archive, the kernel's doname() path handler assumes a zero-terminated path at @collected, passing it directly to filpopen() / initmkdir() / initmknod(). If a specially crafted cpio entry carries a non-zero-terminated filename and is followed by uninitialized memory, then a file may be created with trailing characters that represent the uninitialized memory. The ability to create an initramfs entry would imply already having full control of the system, so the buffer overrun shouldn't be considered a security vulnerability. Append the output of the following bash script to an existing initramfs and observe any created /initramfstestfnameoverrunAA* path. E.g. ./reproducer.sh | gzip >> /myinitramfs It's easiest to observe non-zero uninitialized memory when the output is gzipped, as it'll overflow the heap allocated @outbuf in _gunzip(), rather than the initrdstart+initrdsize block. ---- reproducer.sh ---- nilchar="A" # change to "\0" to properly zero terminate / pad magic="070701" ino=1 mode=$(( 0100777 )) uid=0 gid=0 nlink=1 mtime=1 filesize=0 devmajor=0 devminor=1 rdevmajor=0 rdevminor=0 csum=0 fname="initramfstestfnameoverrun" namelen=$(( ${#fname} + 1 )) # plus one to account for terminator printf "%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%s" \ $magic $ino $mode $uid $gid $nlink $mtime $filesize \ $devmajor $devminor $rdevmajor $rdevminor $namelen $csum $fname termpadlen=$(( 1 + ((4 - ((110 + $namelen) & 3)) % 4) )) printf "%.s${nilchar}" $(seq 1 $termpadlen) ---- reproducer.sh ---- Symlink filename fields handled in dosymlink() won't overrun past the data segment, due to the explicit zero-termination of the symlink target. Fix filename buffer overrun by aborting the initramfs FSM if any cpio entry doesn't carry a zero-terminator at the expected (name_len - 1) offset.(CVE-2024-53142)

Database specific
{
    "severity": "High"
}
References

Affected packages

openEuler:22.03-LTS-SP4 / kernel

Package

Name
kernel
Purl
pkg:rpm/openEuler/kernel&distro=openEuler-22.03-LTS-SP4

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.0-242.0.0.141.oe2203sp4

Ecosystem specific

{
    "aarch64": [
        "bpftool-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "bpftool-debuginfo-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-debuginfo-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-debugsource-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-devel-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-headers-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-source-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-tools-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-tools-debuginfo-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "kernel-tools-devel-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "perf-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "perf-debuginfo-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "python3-perf-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm",
        "python3-perf-debuginfo-5.10.0-242.0.0.141.oe2203sp4.aarch64.rpm"
    ],
    "x86_64": [
        "bpftool-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "bpftool-debuginfo-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-debuginfo-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-debugsource-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-devel-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-headers-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-source-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-tools-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-tools-debuginfo-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "kernel-tools-devel-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "perf-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "perf-debuginfo-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "python3-perf-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm",
        "python3-perf-debuginfo-5.10.0-242.0.0.141.oe2203sp4.x86_64.rpm"
    ],
    "src": [
        "kernel-5.10.0-242.0.0.141.oe2203sp4.src.rpm"
    ]
}