From mboxrd@z Thu Jan 1 00:00:00 1970 From: AL-KERNEL To: kernel-cve@kernelcve.org Subject: [CVE-2026-97587][MODERATE REGULAR] perf: RISC-V: store available counter mask as bitmap Date: Sat, 26 Sep 2026 15:50:19 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-AL-KERNEL-CVE: CVE-2026-97587 X-AL-KERNEL-Priority: MODERATE REGULAR X-AL-KERNEL-Severity: MODERATE REGULAR X-AL-KERNEL-Base-Severity: MODERATE X-AL-KERNEL-KPANIC: NO X-AL-KERNEL-ActionableScore: 1 X-AL-KERNEL-ActionableScore-Lower: unknown X-AL-KERNEL-Commit: 143668c424772979a45118dc9cc9c2c13a35f41d List-Id: CVE: CVE-2026-97587 Priority: MODERATE REGULAR AL-KERNEL base severity: MODERATE KPANIC flag: NO Patch: perf: RISC-V: store available counter mask as bitmap Commit: 143668c424772979a45118dc9cc9c2c13a35f41d Upstream patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=143668c424772979a45118dc9cc9c2c13a35f41d Original CVE announcement: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-97587 Analysis date: Sat, 26 Sep 2026 15:50:19 -0400 ActionableScore: 1 ActionableScore lower bound: unknown Actionable bucket: Ordinary Moderate Manual review required: NO Summary: No one-sentence report phrase was found. ====================================================================== ABOUT THIS REPORT ====================================================================== The original Linux kernel CVE announcement for CVE-2026-97587 is available here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-97587 The original announcement does not normally provide a security severity estimate, CVSS assessment, or enough information to determine whether the reported kernel bug represents a practically relevant security issue. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. It combines an autonomous classifier with LLM-assisted technical analysis and a separate ActionableScore mechanism. The purpose of this report is to prioritize Linux kernel CVEs before manual review, identify cases that require prompt investigation, and support automatic closure of issues that are unlikely to have meaningful security impact. Published priority for this report: MODERATE REGULAR Manual review required: NO A detailed explanation of the methodology and priority rules is included at the end of this message. ====================================================================== AL-KERNEL CLASSIFICATION RESULT ====================================================================== CVE-2026-97587 MODERATE https://www.kernelcve.org/list/?q=CVE-2026-97587 CHECK WITH IMPACT FROM ORIG NN LOW Maybe valid. Check manually. Hints by AL-KERNEL: The best (paranoid) CVSS is 'AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H';CWE-125;*CWE-787;CWE-131;Other CVSS 'AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H';BEST CVSS score: '7';DESCR 'The RISC-V SBI PMU stored a mask for up to 64 counters in one unsigned long. On RV32 the object contains only 32 bits, while bitmap iteration can read the following word and set_bit for counter indexes 32 and above can write beyond the object. This provides a concrete out of bounds read and bit setting write primitive in kernel memory, although control over the destination and written values is constrained by the object layout and SBI counter description. Affected systems require a 32 bit RISC-V kernel with SBI PMU counters represented above XLEN, a condition observed with qemu-system-riscv32. For the CVSS the PR:L value is used because a local user with access to perf_event_open may exercise affected PMU paths, while reliable control of the initial counter bitmap can additionally depend on SBI firmware or the hypervisor. The issue is not network reachable. Impact is at least kernel instability or denial of service and may include confidentiality or integrity impact from adjacent memory access. Privilege escalation is not demonstrated, but the concrete out of bounds write warrants manual review.';YES REQUIRES MANUAL CHECK; ,and ActionableScore result is Ordinary Moderate (with actual score 1) SKIP CVE-2026-97587 UNKNOWN SKIP The Fixes patch not applied yet, so unlikely that actual: url YES NO NO unknown MAYBE HARDWARE LINUS INCREASED_FROM_LOW_BASED_ON_REQUIREMANUALCHECK DECREASED_TO_MODERATEREG_BASED_ON_ACTIONABLESCORELESSTHAN4 - - checked ====================================================================== ACTIONABLESCORE ANALYSIS ====================================================================== ActionableScore=1 PrimitiveClass=CLASS_C RealUAF=NO HostAdminRequired=UNKNOWN NamespaceScopedPrivilege=UNKNOWN ImportantCandidate=NO ManualReview=RECOMMENDED AutoDowngradeAllowed=YES 1. ActionableScore * Raw conservative score: 1 * Conservative score: 1 * Raw paranoid score: 1 * Paranoid score: 1 * No floor or cap was applied. * Final recommended bucket: **Ordinary Moderate**:: 2. Signal breakdown * +1 Weak or indirect corruption candidate. On RV32, bitmap operations using `RISCV_MAX_COUNTERS` can read the word following the single-word `cmask`, and the resulting bits can affect counter enumeration and PMU decisions. * No strong or constrained overwrite point. The vulnerable code uses `*mask |= BIT(i)`, which performs an invalid or undefined oversized shift but does not itself address storage beyond `mask`. The new `set_bit()` operates only after `cmask` has been enlarged to a proper bitmap. * No confidentiality point. No path copying the adjacent bytes to userspace, a network peer, or another observable output is established. * No integrity point. Incorrect counter selection is possible, but modification of protected kernel state through an OOB destination is not demonstrated. * No reliable-crash point. The commit establishes an OOB read and incorrect mask handling, but it does not establish a panic, fatal fault, or host-wide DoS. * No local-unprivileged point. `perf_event_open()` may exercise later PMU paths, but the supplied context does not establish that an ordinary user controls the probe-time mask defect or the complete vulnerable sequence. * No firmware-mediated-input point. SBI supplies the PMU topology, but no meaningful attacker model controlling SBI while lacking stronger control over the affected kernel is established. * No memory-layout-invariant point was added separately because it would duplicate the same mask-width and OOB-read defect. * Controlled reclaim, arbitrary write, UAF, callback control, disclosure, privilege escalation, and remote reachability are not demonstrated. 3. Reachability analysis The defect is specific to a 32-bit RISC-V kernel using the SBI PMU with logical counter indexes above the 32-bit XLEN boundary. The commit confirms this configuration on `qemu-system-riscv32`. The global counter mask is populated during PMU device probing from SBI-provided counter information. Later PMU and perf operations can consume the malformed or undersized mask, but the supplied call sites do not establish that an ordinary local user can control the adjacent word or reliably produce a security-relevant result. A malicious guest is not shown to control the host-side SBI implementation. Conversely, a hypervisor or firmware operator able to define the SBI PMU topology generally has a stronger position than the guest being evaluated. There is no network, namespace, or remotely supplied packet path. No user-namespace capability relationship is involved. No special physical hardware is required because the condition exists under QEMU, but RV32 plus counters above XLEN remains a concrete architecture and PMU-topology prerequisite. This is not a race. 4. Primitive and severity interpretation The exact established primitive is a limited kernel OOB read caused by treating one 32-bit `unsigned long` as a 64-bit bitmap. There is also incorrect bit-mask construction for counter indexes at or above 32 due to `BIT(i)` operating outside the width of `unsigned long`. The supplied hint describes an OOB bit-setting write, but that interpretation is not supported by the vulnerable diff. Before the fix, `pmu_sbi_get_ctrinfo()` uses `*mask |= BIT(i)` rather than `set_bit(i, mask)`. It therefore writes back to the original word, although the shifted value is invalid or architecture-dependent. The patch introduces `set_bit()` only after allocating sufficient bitmap storage. This is not a UAF, lifetime violation, repeated release, ownership violation, authorization bypass, or controlled overwrite. The practical consequence supported by the patch is incorrect PMU state and possible invalid counter handling. A kernel crash is conceivable from downstream behavior but is not established. `PrimitiveClass=CLASS_C` is appropriate because the demonstrated defect is an invalid read and invalid-state problem without an independently useful corruption primitive. `ImportantCandidate=NO` follows from the absence of an OOB write, disclosure, strong DoS, or boundary bypass. `AutoDowngradeAllowed=YES` is appropriate because no unresolved Important-preserving primitive remains. 5. One-sentence report phrase On RV32, the RISC-V SBI PMU treated a single 32-bit unsigned long as a 64-bit counter bitmap, causing an out-of-bounds read and incorrect handling of counters above XLEN without establishing an out-of-bounds write or privilege-escalation primitive. 6. Manual review recommendation MANUAL CHECK RECOMMENDED Confirm the generated RV32 behavior of `BIT(i)` for indexes above 31, the placement and use of data adjacent to the global and per-PMU masks, and whether any downstream SBI result can turn the invalid read into a fatal or externally observable effect. 7. Call-site confidence Call-site confidence: high ====================================================================== UPSTREAM PATCH SUMMARY ====================================================================== Patch: perf: RISC-V: store available counter mask as bitmap Commit: 143668c424772979a45118dc9cc9c2c13a35f41d Upstream URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=143668c424772979a45118dc9cc9c2c13a35f41d Commit description: The available-counter mask was a single unsigned long, but iteration uses RISCV_MAX_COUNTERS, which is 64. On RV32 that reads past the object. Filling with an unsigned-long bit at index 32 and above is also wrong. Use DECLARE_BITMAP and set_bit/bitmap helpers. Walk each bitmap word into CFG_MATCH when checking events, when allocating an index, and when stopping all counters. Set the counter base to i times BITS_PER_LONG. Share the CFG_MATCH ecall through a small helper so the 32-bit argument split is not duplicated. On qemu-system-riscv32 the probe bitmap has bits above XLEN set, so the first word alone is not enough. Fixes: e999143 ("RISC-V: Add perf platform driver based on SBI PMU extension") Assisted-by: DeepSeek:deepseek-v3 Signed-off-by: Xixin Liu Link: https://patch.msgid.link/prpmask02cmap.v2.1786434000.git.liuxixin@kylinos.cn Cc: stable@kernel.org [pjw@kernel.org: updated to apply; fixed checkpatch.pl issues] Signed-off-by: Paul Walmsley Signed-off-by: Greg Kroah-Hartman Changed files: drivers/perf/riscv_pmu_legacy.c drivers/perf/riscv_pmu_sbi.c include/linux/perf/riscv_pmu.h Diff excerpt: Not included in this email. See the upstream URL for the full patch. Full patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=143668c424772979a45118dc9cc9c2c13a35f41d ====================================================================== DETAILED REPORT METHODOLOGY ====================================================================== The original Linux kernel CVE announcement for CVE-2026-97587 can be found here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-97587 The original CVE announcement normally does not include a security-level estimate. In particular, it may not contain a CVSS assessment, an impact level, or enough information to determine whether the reported bug is a practically relevant security issue. One purpose of this parallel CVE list is to provide that missing technical and prioritization information. The original goal of the AL-KERNEL project was to prioritize Linux kernel CVE analysis automatically before manual review. The system can also help identify non-security issues that may be suitable for automatic closure. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. The first analysis stage combines an autonomous classifier with additional LLM-based analysis. The autonomous classifier runs locally on a CPU and is based on a backpropagation neural network. Together, these mechanisms produce a technical vulnerability description, identify likely weakness types, estimate CVSS severity, and provide input for ActionableScore. Two CVSS estimates are retained because incomplete kernel vulnerability information often permits more than one defensible interpretation: Conservative CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H The Best / paranoid CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H The Best / paranoid CVSS score: 7 The conservative vector represents a lower-impact interpretation. The Best/paranoid vector intentionally represents a plausible upper-bound interpretation and should not automatically be treated as demonstrated real-world impact. CVSS may also need to be adjusted for a particular Linux deployment, because actual reachability, privileges, enabled kernel configuration, hardware, namespaces, exposed device nodes, and other environmental conditions can differ significantly between systems. A separate ActionableScore mechanism evaluates practical remediation urgency. Its analysis may include reachability, attack prerequisites, subsystem exposure, memory-corruption characteristics, denial-of-service reliability, and possible confidentiality, integrity, or privilege-escalation impact. Conservative ActionableScore: unknown Paranoid ActionableScore: 1 The final base severity is taken directly from the second tab-separated field of the AL-KERNEL classification result. ActionableScore does not replace or independently override that final AL-KERNEL decision, and if ActionableScore adjusted impact level of ALKERNEL, then you would see self-readable flags above like INCREASED_TO_HIGH_BASED_ON_ACTIONABLESCOREHIGHEREQTHAN7. For an AL-KERNEL result of MODERATE, this report uses the following additional presentation split: ActionableScore below 5 -> MODERATE REGULAR ActionableScore 5 or more -> MODERATE 7.0 The distinction between MODERATE REGULAR and MODERATE 7.0 makes it possible to identify Moderate issues that should receive manual analysis and fixes before lower-priority MODERATE REGULAR issues. In many cases, MODERATE REGULAR fixes may wait for a later rebase or routine update. There is one override in which MODERATE REGULAR becomes MODERATE 7.0 even when the ActionableScore is below 5. When the AL-KERNEL result contains the KPANIC flag, a MODERATE result is always presented as MODERATE 7.0. The KPANIC flag selected with few regexps without usage of AI at all, so it helps to detect cases when Kernel Crash happens and similar (to filter False-Negative results from the LLM usage). KPANIC indicates that a reliable kernel crash, kernel panic, or similarly serious kernel availability impact was identified by the classification workflow. AL-KERNEL base severity for this report: MODERATE KPANIC detected for this report: NO Published priority for this report (same as in Subject): MODERATE REGULAR These results are intended to support engineering triage. They are machine-generated estimates, and cases marked for manual review should be validated by a human security engineer before final disposition. For more info read docs linked from here: https://kernelcve.org/ (and you can submit you own patch there to generate such a report for non-existant CVE-id yet). Note that in many cases this AI tool selects higher severity, than real is (means you can expect Importants instead of Moderate 7.0 or Moderates 7.0 instead of regular Moderates). If you see such cases, please use reply email interface to add additional manual analyses info to this particular CVE. And please, please, let me know when you see Lows instead of Importants or Important instead of Low (because particular for such cases I need to tune this AI tool to make it better for this one and next similar). My contact email for such notifications is alexanjelausa@gmail.com (and both send reply to CVE record itself too and see "reply" button below for howto reply).