{"id":"CVE-2026-97587","aliases":["CVE-2026-97587"],"related":[],"kind":"vulnerability","state":"published","title":"perf: RISC-V: store available counter mask as bitmap","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: RISC-V: store available counter mask as bitmap\n\nThe available-counter mask was a single unsigned long, but iteration\nuses RISCV_MAX_COUNTERS, which is 64. On RV32 that reads past the object.\nFilling with an unsigned-long bit at index 32 and above is also wrong.\n\nUse DECLARE_BITMAP and set_bit/bitmap helpers. Walk each bitmap word\ninto CFG_MATCH when checking events, when allocating an index, and when\nstopping all counters. Set the counter base to i times BITS_PER_LONG.\nShare the CFG_MATCH ecall through a small helper so the 32-bit argument\nsplit is not duplicated. On qemu-system-riscv32 the probe bitmap has bits\nabove XLEN set, so the first word alone is not enough.\n\n[pjw@kernel.org: updated to apply; fixed checkpatch.pl issues]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: RISC-V: store available counter mask as bitmap\n\nThe available-counter mask was a single unsigned long, but iteration\nuses RISCV_MAX_COUNTERS, which is 64. On RV32 that reads past the object.\nFilling with an unsigned-long bit at index 32 and above is also wrong.\n\nUse DECLARE_BITMAP and set_bit/bitmap helpers. Walk each bitmap word\ninto CFG_MATCH when checking events, when allocating an index, and when\nstopping all counters. Set the counter base to i times BITS_PER_LONG.\nShare the CFG_MATCH ecall through a small helper so the 32-bit argument\nsplit is not duplicated. On qemu-system-riscv32 the probe bitmap has bits\nabove XLEN set, so the first word alone is not enough.\n\n[pjw@kernel.org: updated to apply; fixed checkpatch.pl issues]","source":"cvelist"}],"published":"2026-09-25T10:22:06.177Z","modified":"2026-10-30T13:21:08.840Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"e9991434596f5373dfd75857b445eb92a9253c56","fixed":"433249a4de52ecda40ffa9c466cec1312e62826f","status":"affected"},{"type":"git","introduced":"e9991434596f5373dfd75857b445eb92a9253c56","fixed":"5a1b6379eed5b13eac0228b605b0bed988e547e9","status":"affected"},{"type":"git","introduced":"e9991434596f5373dfd75857b445eb92a9253c56","fixed":"143668c424772979a45118dc9cc9c2c13a35f41d","status":"affected"},{"type":"git","introduced":"e9991434596f5373dfd75857b445eb92a9253c56","fixed":"9bec7beaed074bcae4181fde9ff9dfbe4e7b0957","status":"affected"},{"type":"git","introduced":"e9991434596f5373dfd75857b445eb92a9253c56","fixed":"e5481db31f4654e9a1254d5d467d9b1ff2f8b1cb","status":"affected"},{"type":"git","introduced":"e9991434596f5373dfd75857b445eb92a9253c56","fixed":"6809da6e9c08ccc9a09cb0a48c61471679274aaa","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.18","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.111","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.53","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.2.7","lastAffected":"7.2.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.3","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/433249a4de52ecda40ffa9c466cec1312e62826f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5a1b6379eed5b13eac0228b605b0bed988e547e9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/143668c424772979a45118dc9cc9c2c13a35f41d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9bec7beaed074bcae4181fde9ff9dfbe4e7b0957","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e5481db31f4654e9a1254d5d467d9b1ff2f8b1cb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6809da6e9c08ccc9a09cb0a48c61471679274aaa","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-97587","url":"https://www.cve.org/CVERecord?id=CVE-2026-97587","licence":"CVE Terms of Use","modified":"2026-10-30T12:37:30.665Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-97587","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97587","licence":"Public domain","modified":"2026-10-30T13:21:08.840Z"}],"updatedAt":"2026-11-25T22:59:40.965Z","epss":{"score":0.00206,"percentile":0.11267,"date":"2026-12-02T12:00:21.000Z"}}