In the Linux kernel, the following vulnerability has been resolved:
dma-mapping: benchmark: handle NUMANONODE correctly
cpumaskofnode() can be called for NUMANONODE inside domapbenchmark() resulting in the following sanitizer report:
UBSAN: array-index-out-of-bounds in ./arch/x86/include/asm/topology.h:72:28 index -1 is out of range for type 'cpumask [64][1]' CPU: 1 PID: 990 Comm: dmamapbenchma Not tainted 6.9.0-rc6 #29 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Call Trace: <TASK> dumpstacklvl (lib/dumpstack.c:117) ubsanepilogue (lib/ubsan.c:232) _ubsanhandleoutofbounds (lib/ubsan.c:429) cpumaskofnode (arch/x86/include/asm/topology.h:72) [inline] domapbenchmark (kernel/dma/mapbenchmark.c:104) mapbenchmarkioctl (kernel/dma/mapbenchmark.c:246) fullproxyunlockedioctl (fs/debugfs/file.c:333) _x64sysioctl (fs/ioctl.c:890) dosyscall64 (arch/x86/entry/common.c:83) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:130)
Use cpumaskofnode() in place when binding a kernel thread to a cpuset of a particular node.
Note that the provided node id is checked inside mapbenchmarkioctl(). It's just a NUMANONODE case which is not handled properly later.
Found by Linux Verification Center (linuxtesting.org).
[
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"74737712272650162050347315299564892123",
"175043833614766209314367990928475068823",
"316275011625698999091467809943480629951",
"339103034836793539100256873225492352238",
"187118479432740114574572708610094750647",
"139770307021292261539958468529555949510",
"129016926495986060527759202418416572348",
"114978804504818435241463033548547820130"
]
},
"signature_type": "Line",
"id": "CVE-2024-39277-04ae9d62",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@50ee21bfc005e69f183d6b4b454e33f0c2571e1f",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"74737712272650162050347315299564892123",
"175043833614766209314367990928475068823",
"316275011625698999091467809943480629951",
"339103034836793539100256873225492352238",
"187118479432740114574572708610094750647",
"139770307021292261539958468529555949510",
"129016926495986060527759202418416572348",
"114978804504818435241463033548547820130"
]
},
"signature_type": "Line",
"id": "CVE-2024-39277-0d7682d8",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8e1ba9df9a35e8dc64f657a64e523c79ba01e464",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 1943.0,
"function_hash": "270439128427836173673433203584331835253"
},
"signature_type": "Function",
"id": "CVE-2024-39277-432870cc",
"target": {
"file": "kernel/dma/map_benchmark.c",
"function": "do_map_benchmark"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@50ee21bfc005e69f183d6b4b454e33f0c2571e1f",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"74737712272650162050347315299564892123",
"175043833614766209314367990928475068823",
"316275011625698999091467809943480629951",
"339103034836793539100256873225492352238",
"187118479432740114574572708610094750647",
"139770307021292261539958468529555949510",
"129016926495986060527759202418416572348",
"114978804504818435241463033548547820130"
]
},
"signature_type": "Line",
"id": "CVE-2024-39277-4d57a96a",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e64746e74f717961250a155e14c156616fcd981f",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 1929.0,
"function_hash": "104900128314700631181367839224513741287"
},
"signature_type": "Function",
"id": "CVE-2024-39277-69e36291",
"target": {
"file": "kernel/dma/map_benchmark.c",
"function": "do_map_benchmark"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b41b0018e8ca06e985e87220a618ec633988fd13",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 1943.0,
"function_hash": "270439128427836173673433203584331835253"
},
"signature_type": "Function",
"id": "CVE-2024-39277-a03318fb",
"target": {
"file": "kernel/dma/map_benchmark.c",
"function": "do_map_benchmark"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e64746e74f717961250a155e14c156616fcd981f",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 1929.0,
"function_hash": "104900128314700631181367839224513741287"
},
"signature_type": "Function",
"id": "CVE-2024-39277-cd5ecee9",
"target": {
"file": "kernel/dma/map_benchmark.c",
"function": "do_map_benchmark"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8e1ba9df9a35e8dc64f657a64e523c79ba01e464",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"74737712272650162050347315299564892123",
"175043833614766209314367990928475068823",
"316275011625698999091467809943480629951",
"339103034836793539100256873225492352238",
"187118479432740114574572708610094750647",
"139770307021292261539958468529555949510",
"129016926495986060527759202418416572348",
"114978804504818435241463033548547820130"
]
},
"signature_type": "Line",
"id": "CVE-2024-39277-dfd364af",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5a91116b003175302f2e6ad94b76fb9b5a141a41",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"74737712272650162050347315299564892123",
"175043833614766209314367990928475068823",
"316275011625698999091467809943480629951",
"339103034836793539100256873225492352238",
"187118479432740114574572708610094750647",
"139770307021292261539958468529555949510",
"129016926495986060527759202418416572348",
"114978804504818435241463033548547820130"
]
},
"signature_type": "Line",
"id": "CVE-2024-39277-e7fa19b1",
"target": {
"file": "kernel/dma/map_benchmark.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b41b0018e8ca06e985e87220a618ec633988fd13",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 1943.0,
"function_hash": "270439128427836173673433203584331835253"
},
"signature_type": "Function",
"id": "CVE-2024-39277-f9e089f5",
"target": {
"file": "kernel/dma/map_benchmark.c",
"function": "do_map_benchmark"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5a91116b003175302f2e6ad94b76fb9b5a141a41",
"deprecated": false
}
]