In the Linux kernel, the following vulnerability has been resolved:
dma-mapping: benchmark: fix node id validation
While validating node ids in mapbenchmarkioctl(), nodepossible() may be provided with invalid argument outside of [0,MAXNUMNODES-1] range leading to:
BUG: KASAN: wild-memory-access in mapbenchmarkioctl (kernel/dma/mapbenchmark.c:214) Read of size 8 at addr 1fffffff8ccb6398 by task dmamapbenchma/971 CPU: 7 PID: 971 Comm: dmamapbenchma Not tainted 6.9.0-rc6 #37 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Call Trace: <TASK> dumpstacklvl (lib/dumpstack.c:117) kasanreport (mm/kasan/report.c:603) kasancheckrange (mm/kasan/generic.c:189) variabletestbit (arch/x86/include/asm/bitops.h:227) [inline] archtestbit (arch/x86/include/asm/bitops.h:239) [inline] _testbit at (include/asm-generic/bitops/instrumented-non-atomic.h:142) [inline] nodestate (include/linux/nodemask.h:423) [inline] mapbenchmarkioctl (kernel/dma/mapbenchmark.c:214) fullproxyunlockedioctl (fs/debugfs/file.c:333) _x64sysioctl (fs/ioctl.c:890) dosyscall64 (arch/x86/entry/common.c:83) entrySYSCALL64afterhwframe (arch/x86/entry/entry_64.S:130)
Compare node ids with sane bounds first. NUMANONODE is considered a special valid case meaning that benchmarking kthreads won't be bound to a cpuset of a given node.
Found by Linux Verification Center (linuxtesting.org).
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@34a816d8735f3924b74be8e5bf766ade1f3bd10b",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"function": "map_benchmark_ioctl",
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-0e1ea9c4",
"digest": {
"length": 1737.0,
"function_hash": "79556738866077410944080780321894059773"
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@63e7e05a48a35308aeddd7ecccb68363a5988e87",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-14eaad51",
"digest": {
"line_hashes": [
"129570101237707610696058379317494042330",
"48765128055592011730750298421470592367",
"48520029356131672458365747832870579944",
"36897135069234622755361516435722620758"
],
"threshold": 0.9
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@35d31c8bd4722b107f5a2f5ddddce839de04b936",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-1a473e41",
"digest": {
"line_hashes": [
"129570101237707610696058379317494042330",
"48765128055592011730750298421470592367",
"48520029356131672458365747832870579944",
"36897135069234622755361516435722620758"
],
"threshold": 0.9
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1ff05e723f7ca30644b8ec3fb093f16312e408ad",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-1fd76ab8",
"digest": {
"line_hashes": [
"129570101237707610696058379317494042330",
"48765128055592011730750298421470592367",
"48520029356131672458365747832870579944",
"36897135069234622755361516435722620758"
],
"threshold": 0.9
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1ff05e723f7ca30644b8ec3fb093f16312e408ad",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"function": "map_benchmark_ioctl",
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-3790599c",
"digest": {
"length": 1761.0,
"function_hash": "291798067511512032851323737525151811094"
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c57874265a3c5206d7aece3793bb2fc9abcd7570",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"function": "map_benchmark_ioctl",
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-506a924c",
"digest": {
"length": 1737.0,
"function_hash": "79556738866077410944080780321894059773"
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@34a816d8735f3924b74be8e5bf766ade1f3bd10b",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-63ccf6d5",
"digest": {
"line_hashes": [
"129570101237707610696058379317494042330",
"48765128055592011730750298421470592367",
"48520029356131672458365747832870579944",
"36897135069234622755361516435722620758"
],
"threshold": 0.9
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@35d31c8bd4722b107f5a2f5ddddce839de04b936",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"function": "map_benchmark_ioctl",
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-a6aa625b",
"digest": {
"length": 1737.0,
"function_hash": "79556738866077410944080780321894059773"
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c57874265a3c5206d7aece3793bb2fc9abcd7570",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-c899c5c6",
"digest": {
"line_hashes": [
"129570101237707610696058379317494042330",
"48765128055592011730750298421470592367",
"48520029356131672458365747832870579944",
"36897135069234622755361516435722620758"
],
"threshold": 0.9
},
"deprecated": false
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@63e7e05a48a35308aeddd7ecccb68363a5988e87",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"function": "map_benchmark_ioctl",
"file": "kernel/dma/map_benchmark.c"
},
"id": "CVE-2024-34777-dd4ca363",
"digest": {
"length": 1737.0,
"function_hash": "79556738866077410944080780321894059773"
},
"deprecated": false
}
]