In the Linux kernel, the following vulnerability has been resolved:
exfat: use kvmallocarray/kvfree instead of kmallocarray/kfree
The call stack shown below is a scenario in the Linux 4.19 kernel. Allocating memory failed where exfat fs use kmalloc_array due to system memory fragmentation, while the u-disk was inserted without recognition. Devices such as u-disk using the exfat file system are pluggable and may be insert into the system at any time. However, long-term running systems cannot guarantee the continuity of physical memory. Therefore, it's necessary to address this issue.
Binder:26326: page allocation failure: order:4, mode:0x6040c0(GFPKERNEL|_GFPCOMP), nodemask=(null) Call trace: [242178.097582] dumpbacktrace+0x0/0x4 [242178.097589] dumpstack+0xf4/0x134 [242178.097598] warnalloc+0xd8/0x144 [242178.097603] _allocpagesnodemask+0x1364/0x1384 [242178.097608] kmallocorder+0x2c/0x510 [242178.097612] kmallocordertrace+0x40/0x16c [242178.097618] _kmalloc+0x360/0x408 [242178.097624] loadallocbitmap+0x160/0x284 [242178.097628] exfatfillsuper+0xa3c/0xe7c [242178.097635] mountbdev+0x2e8/0x3a0 [242178.097638] exfatfsmount+0x40/0x50 [242178.097643] mountfs+0x138/0x2e8 [242178.097649] vfskernmount+0x90/0x270 [242178.097655] domount+0x798/0x173c [242178.097659] ksysmount+0x114/0x1ac [242178.097665] _arm64sysmount+0x24/0x34 [242178.097671] el0svccommon+0xb8/0x1b8 [242178.097676] el0svchandler+0x74/0x90 [242178.097681] el0svc+0x8/0x340
By analyzing the exfat code,we found that continuous physical memory is not required here,so kvmalloc_array is used can solve this problem.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/54xxx/CVE-2023-54194.json",
"cna_assigner": "Linux"
}