{"schema_version":"1.7.2","id":"OESA-2024-2571","modified":"2024-12-20T13:07:47Z","published":"2024-12-20T13:07:47Z","upstream":["CVE-2022-48868","CVE-2024-40927","CVE-2024-50218","CVE-2024-53114","CVE-2024-53142"],"summary":"kernel security update","details":"The Linux Kernel, the operating system core itself.\r\n\r\nSecurity Fix(es):\r\n\r\nIn the Linux kernel, the following vulnerability has been resolved:\r\n\r\ndmaengine: idxd: Let probe fail when workqueue cannot be enabled\r\n\r\nThe workqueue is enabled when the appropriate driver is loaded and\ndisabled when the driver is removed. When the driver is removed it\nassumes that the workqueue was enabled successfully and proceeds to\nfree allocations made during workqueue enabling.\r\n\r\nFailure during workqueue enabling does not prevent the driver from\nbeing loaded. This is because the error path within drv_enable_wq()\nreturns success unless a second failure is encountered\nduring the error path. By returning success it is possible to load\nthe driver even if the workqueue cannot be enabled and\nallocations that do not exist are attempted to be freed during\ndriver remove.\r\n\r\nSome examples of problematic flows:\n(a)\r\n\r\n idxd_dmaengine_drv_probe() -\u0026gt; drv_enable_wq() -\u0026gt; idxd_wq_request_irq():\n In above flow, if idxd_wq_request_irq() fails then\n idxd_wq_unmap_portal() is called on error exit path, but\n drv_enable_wq() returns 0 because idxd_wq_disable() succeeds. The\n driver is thus loaded successfully.\r\n\r\n idxd_dmaengine_drv_remove()-\u0026gt;drv_disable_wq()-\u0026gt;idxd_wq_unmap_portal()\n Above flow on driver unload triggers the WARN in devm_iounmap() because\n the device resource has already been removed during error path of\n drv_enable_wq().\r\n\r\n(b)\r\n\r\n idxd_dmaengine_drv_probe() -\u0026gt; drv_enable_wq() -\u0026gt; idxd_wq_request_irq():\n In above flow, if idxd_wq_request_irq() fails then\n idxd_wq_init_percpu_ref() is never called to initialize the percpu\n counter, yet the driver loads successfully because drv_enable_wq()\n returns 0.\r\n\r\n idxd_dmaengine_drv_remove()-\u0026gt;__idxd_wq_quiesce()-\u0026gt;percpu_ref_kill():\n Above flow on driver unload triggers a BUG when attempting to drop the\n initial ref of the uninitialized percpu ref:\n BUG: kernel NULL pointer dereference, address: 0000000000000010\r\n\r\nFix the drv_enable_wq() error path by returning the original error that\nindicates failure of workqueue enabling. This ensures that the probe\nfails when an error is encountered and the driver remove paths are only\nattempted when the workqueue was enabled successfully.(CVE-2022-48868)\r\n\r\nIn 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\u0026gt;1 TDs found active for different streams are deferred until after the first one is processed, calling xhci_invalidate_cancelled_tds() again from xhci_handle_cmd_set_deq() to queue another command until we are done with all of them. Also change the error/\u0026quot;should never happen\u0026quot; paths to ensure we at least clear any affected TDs, even if we can\u0026apos;t issue a command to clear the hardware cache, and complain loudly with an xhci_warn() if this ever happens.  This problem case dates back to commit e9df17eb1408 (\u0026quot;USB: xhci: Correct assumptions about number of rings per endpoint.\u0026quot;) early on in the XHCI driver\u0026apos;s life, when stream support was first added. It was then identified but not fixed nor made into a warning in commit 674f8438c121 (\u0026quot;xhci: split handling halted endpoints into two steps\u0026quot;), 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 (\u0026quot;xhci: Fix failure to give back some cached cancelled URBs.\u0026quot;), it was acknowledged again.  [Mathias: commit 94f339147fc3 (\u0026quot;xhci: Fix failure to give back some cached cancelled URBs.\u0026quot;) 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 xhci_dbg() was added to log the problem condition, and the remaining issue was mentioned in the commit description. The choice of making the log type xhci_dbg() 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\u0026apos;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\u0026apos;t have been left in at all).  \u0026gt; Another fix to solve clearing the caches of all stream rings with \u0026gt; 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\u0026apos;s finally time to fix it. And maybe next time let\u0026apos;s not leave bugs unfixed (that are actually worse than the original bug), and let\u0026apos;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 \u0026gt; /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\u0026apos;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\u0026apos;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)\r\n\r\nIn the Linux kernel, the following vulnerability has been resolved:  ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow  Syzbot reported a kernel BUG in ocfs2_truncate_inline.  There are two reasons for this: first, the parameter value passed is greater than ocfs2_max_inline_data_with_xattr, second, the start and end parameters of ocfs2_truncate_inline are \u0026quot;unsigned int\u0026quot;.  So, we need to add a sanity check for byte_start and byte_len right before ocfs2_truncate_inline() in ocfs2_remove_inode_range(), if they are greater than ocfs2_max_inline_data_with_xattr return -EINVAL.(CVE-2024-50218)\r\n\r\nIn 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\u0026apos;t intended to be advertised on Zen4 client so clear the capability.(CVE-2024-53114)\r\n\r\nIn 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 cpio_file := ALGN(4) + cpio_header + filename + \u0026quot;\\0\u0026quot; + ALGN(4) + data ...  55 ============= ================== =========================  56 Field name    Field size         Meaning  57 ============= ================== ========================= ...  70 c_namesize    8 bytes            Length of filename, including final \\0  When extracting an initramfs cpio archive, the kernel\u0026apos;s do_name() path handler assumes a zero-terminated path at @collected, passing it directly to filp_open() / init_mkdir() / init_mknod().  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\u0026apos;t be considered a security vulnerability.  Append the output of the following bash script to an existing initramfs and observe any created /initramfs_test_fname_overrunAA* path. E.g.   ./reproducer.sh | gzip \u0026gt;\u0026gt; /myinitramfs  It\u0026apos;s easiest to observe non-zero uninitialized memory when the output is gzipped, as it\u0026apos;ll overflow the heap allocated @out_buf in __gunzip(), rather than the initrd_start+initrd_size block.  ---- reproducer.sh ---- nilchar=\u0026quot;A\u0026quot; # change to \u0026quot;\\0\u0026quot; to properly zero terminate / pad magic=\u0026quot;070701\u0026quot; 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=\u0026quot;initramfs_test_fname_overrun\u0026quot; namelen=$(( ${#fname} + 1 )) # plus one to account for terminator  printf \u0026quot;%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%s\u0026quot; \\  $magic $ino $mode $uid $gid $nlink $mtime $filesize \\  $devmajor $devminor $rdevmajor $rdevminor $namelen $csum $fname  termpadlen=$(( 1 + ((4 - ((110 + $namelen) \u0026amp; 3)) % 4) )) printf \u0026quot;%.s${nilchar}\u0026quot; $(seq 1 $termpadlen) ---- reproducer.sh ----  Symlink filename fields handled in do_symlink() won\u0026apos;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\u0026apos;t carry a zero-terminator at the expected (name_len - 1) offset.(CVE-2024-53142)","affected":[{"package":{"ecosystem":"openEuler:22.03-LTS-SP4","name":"kernel","purl":"pkg:rpm/openEuler/kernel\u0026distro=openEuler-22.03-LTS-SP4"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"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"],"src":["kernel-5.10.0-242.0.0.141.oe2203sp4.src.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"]}}],"references":[{"type":"ADVISORY","url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2024-2571"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-48868"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40927"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-50218"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-53114"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-53142"}],"database_specific":{"severity":"High"}}