public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Jinqian Yang <yangjinqian1@huawei.com>,
	Zenghui Yu <zenghui.yu@linux.dev>, Will Deacon <will@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	catalin.marinas@arm.com, james.morse@arm.com,
	dianders@chromium.org, shechenglong@xfusion.com,
	skolothumtho@nvidia.com
Subject: [PATCH AUTOSEL 6.19-5.10] arm64: Add support for TSV110 Spectre-BHB mitigation
Date: Wed, 11 Feb 2026 07:30:12 -0500	[thread overview]
Message-ID: <20260211123112.1330287-2-sashal@kernel.org> (raw)
In-Reply-To: <20260211123112.1330287-1-sashal@kernel.org>

From: Jinqian Yang <yangjinqian1@huawei.com>

[ Upstream commit e3baa5d4b361276efeb87b20d8beced451a7dbd5 ]

The TSV110 processor is vulnerable to the Spectre-BHB (Branch History
Buffer) attack, which can be exploited to leak information through
branch prediction side channels. This commit adds the MIDR of TSV110
to the list for software mitigation.

Signed-off-by: Jinqian Yang <yangjinqian1@huawei.com>
Reviewed-by: Zenghui Yu <zenghui.yu@linux.dev>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

I now have all the information needed for a thorough analysis. Here is
my complete assessment.

---

## Comprehensive Analysis: arm64: Add support for TSV110 Spectre-BHB
mitigation

### 1. COMMIT MESSAGE ANALYSIS

The commit explicitly states that the HiSilicon TSV110 processor is
vulnerable to Spectre-BHB (Branch History Buffer) attacks. It adds the
TSV110 MIDR to the software mitigation loop list with k=32 iterations.
This is a **security vulnerability fix** — Spectre-BHB is a well-known
speculative execution side-channel attack (related to CVE-2022-23960).

The commit follows the exact same pattern as `e18c09b204e81` ("arm64:
Add support for HIP09 Spectre-BHB mitigation") by the same author
(Jinqian Yang from Huawei), reviewed by Zenghui Yu and signed off by
Will Deacon (the arm64 maintainer). The authorship chain is highly
credible.

### 2. CODE CHANGE ANALYSIS

The change is a **single line addition**:

```c
MIDR_ALL_VERSIONS(MIDR_HISI_TSV110),
```

added to the `spectre_bhb_k32_list` array inside
`spectre_bhb_loop_affected()` in `arch/arm64/kernel/proton-pack.c`.

**What this does in detail:**

Without this patch, the TSV110 CPU goes through this logic:

1. `is_spectre_bhb_affected()` is called (line 972-992):
   - `supports_csv2p3()` → false (TSV110 doesn't support CSV2P3)
   - `is_spectre_bhb_safe()` → false (TSV110 is NOT in
     `spectre_bhb_safe_list` at lines 840-851)
   - Returns **true** — TSV110 IS considered BHB-affected
   - BUT `spectre_bhb_loop_affected()` returns **k=0** (TSV110 is not in
     any k-list)

2. `spectre_bhb_enable_mitigation()` is called (line 1024-1090):
   - `is_spectre_bhb_affected()` returns true → doesn't bail out
   - TSV110 is in `spectre_v2_safe_list` (line 157), so v2 state is
     UNAFFECTED, not VULNERABLE → continues past line 1033
   - `supports_ecbhb()` → likely false
   - `supports_clearbhb()` → likely false
   - **Line 1051: `spectre_bhb_loop_affected()` returns 0 (falsy) → loop
     mitigation NOT applied**
   - Falls through to `has_spectre_bhb_fw_mitigation()` → depends on
     firmware
   - If firmware doesn't support ARCH_WORKAROUND_3: **state remains
     `SPECTRE_VULNERABLE`**

**Result without patch:** TSV110 is recognized as BHB-vulnerable but
receives NO software mitigation (k=0 means the loop mitigation can't
activate). The system reports `Vulnerable` in
`/sys/devices/system/cpu/vulnerabilities/spectre_v2`.

**With this patch:** `spectre_bhb_loop_affected()` returns k=32, the
loop mitigation at line 1051 activates, `EL1_VECTOR_BHB_LOOP` vectors
are installed, and the system reports `Mitigated`.

### 3. SECURITY IMPACT

- **Spectre-BHB (CVE-2022-23960)** is a serious speculative execution
  vulnerability that allows information leakage through branch
  prediction side channels
- The TSV110 (Taishan v110) is the CPU core used in **HiSilicon Kunpeng
  920** server SoCs, which are widely deployed in data centers,
  especially in China
- Without this fix, these servers are **left unmitigated** against a
  known speculative execution attack
- The vulnerability is exploitable from userspace to leak kernel memory

### 4. DEPENDENCY ANALYSIS

The commit depends on the refactored code structure from commit
`e403e8538359d` ("arm64: errata: Assume that unknown CPUs _are_
vulnerable to Spectre BHB"), which:
- Has `Cc: stable@vger.kernel.org` and `Fixes: 558c303c9734`
- Is explicitly tagged for stable backporting
- Was followed by `0c9fc6e652cd5` (KRYO safe list), `a5951389e58d2`
  (newer ARM cores), and `fee4d171451c1` (missing sentinels fix) — all
  tagged for stable

The `MIDR_HISI_TSV110` macro was introduced in v5.1-rc2 (commit
`efd00c722ca85`, March 2019) and is present in **all active stable
trees** (5.4+, 5.10+, 5.15+, 6.1+, 6.6+, 6.12+).

The only dependency is that the `spectre_bhb_loop_affected()` function
needs to be in its refactored form (from `e403e8538359d`), which is
already bound for stable. If that dependency is present, this one-liner
applies cleanly.

### 5. SCOPE AND RISK ASSESSMENT

- **Size:** 1 line addition — the absolute minimum change possible
- **Risk:** Essentially zero. Adding a MIDR to an existing static array
  cannot break any other CPU. The MIDR matching is exact — only TSV110
  cores will match
- **Files touched:** 1 file (`arch/arm64/kernel/proton-pack.c`)
- **Pattern:** Identical to `e18c09b204e81` (HIP09 BHB, same author) and
  `a5951389e58d2` (newer ARM cores) — both already in the stable
  pipeline

### 6. USER IMPACT

- **Affected users:** Anyone running Linux on HiSilicon Kunpeng 920
  servers (Taishan v110 cores)
- **Severity:** High — speculative execution vulnerabilities allow
  kernel memory leaks from unprivileged userspace
- **Real-world deployment:** Kunpeng 920 is deployed in production data
  centers and cloud environments
- **Without fix:** Systems report `Vulnerable` for Spectre-v2/BHB and
  have no software mitigation

### 7. STABILITY INDICATORS

- **Reviewed-by:** Zenghui Yu (active arm64 reviewer)
- **Signed-off-by:** Will Deacon (arm64 co-maintainer)
- **Same pattern as HIP09 commit** that was already accepted
- The TSV110 MIDR has been in the kernel since 2019 — extremely well-
  known hardware
- The k=32 value is consistent with other ARMv8.2 era cores in the same
  list (A78, X1, Neoverse V1)

### 8. CLASSIFICATION

This commit is categorized as a **hardware-specific security mitigation
addition** — analogous to adding a device ID to an existing driver. The
Spectre-BHB mitigation framework already exists; this simply adds one
more CPU to the list of CPUs that need it. This falls squarely into the
"hardware quirks/workarounds for broken devices" exception category for
stable trees.

### Summary

This is a one-line security fix that adds the HiSilicon TSV110 (Kunpeng
920) processor to the Spectre-BHB software mitigation list with k=32.
Without it, TSV110 systems are left vulnerable to a known speculative
execution attack (CVE-2022-23960). The change is trivially correct
(adding one MIDR entry to a static array), has zero risk of regression
for any other CPU, follows an established pattern (identical to HIP09),
and was reviewed by the arm64 maintainer. It depends on the
`e403e8538359d` refactoring already tagged for stable. The affected
hardware (Kunpeng 920) is deployed in real production environments.

**YES**

 arch/arm64/kernel/proton-pack.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
index 80a580e019c50..b3801f532b10b 100644
--- a/arch/arm64/kernel/proton-pack.c
+++ b/arch/arm64/kernel/proton-pack.c
@@ -887,6 +887,7 @@ static u8 spectre_bhb_loop_affected(void)
 		MIDR_ALL_VERSIONS(MIDR_CORTEX_X2),
 		MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
 		MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
+		MIDR_ALL_VERSIONS(MIDR_HISI_TSV110),
 		{},
 	};
 	static const struct midr_range spectre_bhb_k24_list[] = {
-- 
2.51.0


  reply	other threads:[~2026-02-11 12:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 12:30 [PATCH AUTOSEL 6.19-5.10] s390/perf: Disable register readout on sampling events Sasha Levin
2026-02-11 12:30 ` Sasha Levin [this message]
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] xenbus: Use .freeze/.thaw to handle xenbus devices Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] s390/purgatory: Add -Wno-default-const-init-unsafe to KBUILD_CFLAGS Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.18] s390/boot: " Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.1] perf/arm-cmn: Support CMN-600AE Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.18] ntfs: ->d_compare() must not block Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.12] ACPI: x86: s2idle: Invoke Microsoft _DSM Function 9 (Turn On Display) Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.12] block: decouple secure erase size limit from discard size limit Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] sparc: don't reference obsolete termio struct for TC* constants Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] EFI/CPER: don't go past the ARM processor CPER record buffer Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19] ACPI: scan: Use async schedule function in acpi_scan_clear_dep_fn() Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.6] cpufreq: dt-platdev: Block the driver from probing on more QC platforms Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] EFI/CPER: don't dump the entire memory region Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.12] ACPI: battery: fix incorrect charging status when current is zero Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.18] rust: cpufreq: always inline functions using build_assert with arguments Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.18] blk-mq-sched: unify elevators checking for async requests Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] x86/xen/pvh: Enable PAE mode for 32-bit guest only when CONFIG_X86_PAE is set Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.12] APEI/GHES: ARM processor Error: don't go past allocated memory Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.18] md raid: fix hang when stopping arrays with metadata through dm-raid Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] tools/power cpupower: Reset errno before strtoull() Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] sparc: Synchronize user stack on fork and clone Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] blk-mq-debugfs: add missing debugfs_mutex in blk_mq_debugfs_register_hctxs() Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] rnbd-srv: Zero the rsp buffer before using it Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.12] alpha: fix user-space corruption during memory compaction Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] ACPICA: Abort AML bytecode execution when executing AML_FATAL_OP Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19] arm64: mte: Set TCMA1 whenever MTE is present in the kernel Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.18] tools/cpupower: Fix inverted APERF capability check Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.15] ACPI: processor: Fix NULL-pointer dereference in acpi_processor_errata_piix4() Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.12] ACPI: resource: Add JWIPC JVC9100 to irq1_level_low_skip_override[] Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.6] perf/cxlpmu: Replace IRQF_ONESHOT with IRQF_NO_THREAD Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.6] md-cluster: fix NULL pointer dereference in process_metadata_update Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-5.10] APEI/GHES: ensure that won't go past CPER allocated record Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.12] powercap: intel_rapl: Add PL4 support for Ice Lake Sasha Levin
2026-02-11 12:30 ` [PATCH AUTOSEL 6.19-6.18] io_uring/timeout: annotate data race in io_flush_timeouts() Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260211123112.1330287-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=dianders@chromium.org \
    --cc=james.morse@arm.com \
    --cc=patches@lists.linux.dev \
    --cc=shechenglong@xfusion.com \
    --cc=skolothumtho@nvidia.com \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=yangjinqian1@huawei.com \
    --cc=zenghui.yu@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox