CVE-2024-41059: hfsplus: fix uninit-value in copy_name
In the Linux kernel, the following vulnerability has been resolved:
hfsplus: fix uninit-value in copyname
[syzbot reported] BUG: KMSAN: uninit-value in sizedstrscpy+0xc4/0x160 sizedstrscpy+0xc4/0x160 copyname+0x2af/0x320 fs/hfsplus/xattr.c:411 hfspluslistxattr+0x11e9/0x1a50 fs/hfsplus/xattr.c:750 vfslistxattr fs/xattr.c:493 [inline] listxattr+0x1f3/0x6b0 fs/xattr.c:840 pathlistxattr fs/xattr.c:864 [inline] dosyslistxattr fs/xattr.c:876 [inline] sesyslistxattr fs/xattr.c:873 [inline] x64syslistxattr+0x16b/0x2f0 fs/xattr.c:873 x64syscall+0x2ba0/0x3b50 arch/x86/include/generated/asm/syscalls64.h:195 dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xcf/0x1e0 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+0x77/0x7f
Uninit was created at: slabpostallochook mm/slub.c:3877 [inline] slaballocnode mm/slub.c:3918 [inline] kmalloctrace+0x57b/0xbe0 mm/slub.c:4065 kmalloc include/linux/slab.h:628 [inline] hfspluslistxattr+0x4cc/0x1a50 fs/hfsplus/xattr.c:699 vfslistxattr fs/xattr.c:493 [inline] listxattr+0x1f3/0x6b0 fs/xattr.c:840 pathlistxattr fs/xattr.c:864 [inline] dosyslistxattr fs/xattr.c:876 [inline] sesyslistxattr fs/xattr.c:873 [inline] x64syslistxattr+0x16b/0x2f0 fs/xattr.c:873 x64syscall+0x2ba0/0x3b50 arch/x86/include/generated/asm/syscalls64.h:195 dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xcf/0x1e0 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+0x77/0x7f [Fix] When allocating memory to strbuf, initialize memory to 0.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1 - Configuration
In the hfsplus xattr code path where strbuf is allocated, initialize the allocated memory for strbuf to 0 (the fix states: "When allocating memory to strbuf, initialize memory to 0.").
Linux kernel (hfsplus/xattr.c) strbuf allocation initialization = 0
Event History
Frequently Asked Questions
What is the severity of CVE-2024-41059?
CVE-2024-41059 is classified as a medium severity vulnerability in the Linux kernel.
What versions of Linux kernel are affected by CVE-2024-41059?
CVE-2024-41059 affects Linux kernel versions from 4.20 to 6.1.101, as well as versions between 5.5 and 6.6.42.
How do I fix CVE-2024-41059?
To fix CVE-2024-41059, you should upgrade to a patched version of the Linux kernel such as 5.10.223-1, 5.10.226-1, or any recommended versions from the distribution.
What are the implications of CVE-2024-41059?
CVE-2024-41059 can result in undefined behavior due to uninitialized value access, which may lead to potential security risks.
Is there a known exploit for CVE-2024-41059?
As of now, there are no publicly available exploits specifically targeting CVE-2024-41059.