Skip to content

Commit a0cadb0

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.8.y' into v6.8+
2 parents 4bcd566 + b95f206 commit a0cadb0

342 files changed

Lines changed: 3575 additions & 1727 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/admin-guide/hw-vuln/spectre.rst

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ associated with the source address of the indirect branch. Specifically,
138138
the BHB might be shared across privilege levels even in the presence of
139139
Enhanced IBRS.
140140

141-
Currently the only known real-world BHB attack vector is via
142-
unprivileged eBPF. Therefore, it's highly recommended to not enable
143-
unprivileged eBPF, especially when eIBRS is used (without retpolines).
144-
For a full mitigation against BHB attacks, it's recommended to use
145-
retpolines (or eIBRS combined with retpolines).
141+
Previously the only known real-world BHB attack vector was via unprivileged
142+
eBPF. Further research has found attacks that don't require unprivileged eBPF.
143+
For a full mitigation against BHB attacks it is recommended to set BHI_DIS_S or
144+
use the BHB clearing sequence.
146145

147146
Attack scenarios
148147
----------------
@@ -430,6 +429,23 @@ The possible values in this file are:
430429
'PBRSB-eIBRS: Not affected' CPU is not affected by PBRSB
431430
=========================== =======================================================
432431

432+
- Branch History Injection (BHI) protection status:
433+
434+
.. list-table::
435+
436+
* - BHI: Not affected
437+
- System is not affected
438+
* - BHI: Retpoline
439+
- System is protected by retpoline
440+
* - BHI: BHI_DIS_S
441+
- System is protected by BHI_DIS_S
442+
* - BHI: SW loop; KVM SW loop
443+
- System is protected by software clearing sequence
444+
* - BHI: Syscall hardening
445+
- Syscalls are hardened against BHI
446+
* - BHI: Syscall hardening; KVM: SW loop
447+
- System is protected from userspace attacks by syscall hardening; KVM is protected by software clearing sequence
448+
433449
Full mitigation might require a microcode update from the CPU
434450
vendor. When the necessary microcode is not available, the kernel will
435451
report vulnerability.
@@ -484,7 +500,11 @@ Spectre variant 2
484500

485501
Systems which support enhanced IBRS (eIBRS) enable IBRS protection once at
486502
boot, by setting the IBRS bit, and they're automatically protected against
487-
Spectre v2 variant attacks.
503+
some Spectre v2 variant attacks. The BHB can still influence the choice of
504+
indirect branch predictor entry, and although branch predictor entries are
505+
isolated between modes when eIBRS is enabled, the BHB itself is not isolated
506+
between modes. Systems which support BHI_DIS_S will set it to protect against
507+
BHI attacks.
488508

489509
On Intel's enhanced IBRS systems, this includes cross-thread branch target
490510
injections on SMT systems (STIBP). In other words, Intel eIBRS enables
@@ -638,6 +658,22 @@ kernel command line.
638658
spectre_v2=off. Spectre variant 1 mitigations
639659
cannot be disabled.
640660

661+
spectre_bhi=
662+
663+
[X86] Control mitigation of Branch History Injection
664+
(BHI) vulnerability. Syscalls are hardened against BHI
665+
regardless of this setting. This setting affects the deployment
666+
of the HW BHI control and the SW BHB clearing sequence.
667+
668+
on
669+
unconditionally enable.
670+
off
671+
unconditionally disable.
672+
auto
673+
enable if hardware mitigation
674+
control(BHI_DIS_S) is available, otherwise
675+
enable alternate mitigation in KVM.
676+
641677
For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt
642678

643679
Mitigation selection guide

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6043,6 +6043,18 @@
60436043
sonypi.*= [HW] Sony Programmable I/O Control Device driver
60446044
See Documentation/admin-guide/laptops/sonypi.rst
60456045

6046+
spectre_bhi= [X86] Control mitigation of Branch History Injection
6047+
(BHI) vulnerability. Syscalls are hardened against BHI
6048+
reglardless of this setting. This setting affects the
6049+
deployment of the HW BHI control and the SW BHB
6050+
clearing sequence.
6051+
6052+
on - unconditionally enable.
6053+
off - unconditionally disable.
6054+
auto - (default) enable hardware mitigation
6055+
(BHI_DIS_S) if available, otherwise enable
6056+
alternate mitigation in KVM.
6057+
60466058
spectre_v2= [X86] Control mitigation of Spectre variant 2
60476059
(indirect branch speculation) vulnerability.
60486060
The default operation protects the kernel from

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 8
4-
SUBLEVEL = 4
4+
SUBLEVEL = 5
55
EXTRAVERSION =
66
NAME = Hurr durr I'ma ninja sloth
77

arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,8 @@ ap_spi_fp: &spi10 {
943943
vddrf-supply = <&pp1300_l2c>;
944944
vddch0-supply = <&pp3300_l10c>;
945945
max-speed = <3200000>;
946+
947+
qcom,local-bd-address-broken;
946948
};
947949
};
948950

arch/arm64/kernel/ptrace.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,6 @@ static void sve_init_header_from_task(struct user_sve_header *header,
729729
{
730730
unsigned int vq;
731731
bool active;
732-
bool fpsimd_only;
733732
enum vec_type task_type;
734733

735734
memset(header, 0, sizeof(*header));
@@ -745,20 +744,18 @@ static void sve_init_header_from_task(struct user_sve_header *header,
745744
case ARM64_VEC_SVE:
746745
if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT))
747746
header->flags |= SVE_PT_VL_INHERIT;
748-
fpsimd_only = !test_tsk_thread_flag(target, TIF_SVE);
749747
break;
750748
case ARM64_VEC_SME:
751749
if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT))
752750
header->flags |= SVE_PT_VL_INHERIT;
753-
fpsimd_only = false;
754751
break;
755752
default:
756753
WARN_ON_ONCE(1);
757754
return;
758755
}
759756

760757
if (active) {
761-
if (fpsimd_only) {
758+
if (target->thread.fp_type == FP_STATE_FPSIMD) {
762759
header->flags |= SVE_PT_REGS_FPSIMD;
763760
} else {
764761
header->flags |= SVE_PT_REGS_SVE;

arch/arm64/kvm/hyp/nvhe/tlb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu,
154154
/* Switch to requested VMID */
155155
__tlb_switch_to_guest(mmu, &cxt, false);
156156

157-
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, 0);
157+
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride,
158+
TLBI_TTL_UNKNOWN);
158159

159160
dsb(ish);
160161
__tlbi(vmalle1is);

arch/arm64/kvm/hyp/pgtable.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -829,12 +829,15 @@ static bool stage2_try_break_pte(const struct kvm_pgtable_visit_ctx *ctx,
829829
* Perform the appropriate TLB invalidation based on the
830830
* evicted pte value (if any).
831831
*/
832-
if (kvm_pte_table(ctx->old, ctx->level))
833-
kvm_tlb_flush_vmid_range(mmu, ctx->addr,
834-
kvm_granule_size(ctx->level));
835-
else if (kvm_pte_valid(ctx->old))
832+
if (kvm_pte_table(ctx->old, ctx->level)) {
833+
u64 size = kvm_granule_size(ctx->level);
834+
u64 addr = ALIGN_DOWN(ctx->addr, size);
835+
836+
kvm_tlb_flush_vmid_range(mmu, addr, size);
837+
} else if (kvm_pte_valid(ctx->old)) {
836838
kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, mmu,
837839
ctx->addr, ctx->level);
840+
}
838841
}
839842

840843
if (stage2_pte_is_counted(ctx->old))

arch/arm64/kvm/hyp/vhe/tlb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu,
171171
/* Switch to requested VMID */
172172
__tlb_switch_to_guest(mmu, &cxt);
173173

174-
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, 0);
174+
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride,
175+
TLBI_TTL_UNKNOWN);
175176

176177
dsb(ish);
177178
__tlbi(vmalle1is);

arch/arm64/kvm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
16311631
fault_ipa = kvm_vcpu_get_fault_ipa(vcpu);
16321632
is_iabt = kvm_vcpu_trap_is_iabt(vcpu);
16331633

1634-
if (esr_fsc_is_permission_fault(esr)) {
1634+
if (esr_fsc_is_translation_fault(esr)) {
16351635
/* Beyond sanitised PARange (which is the IPA limit) */
16361636
if (fault_ipa >= BIT_ULL(get_kvm_ipa_limit())) {
16371637
kvm_inject_size_fault(vcpu);

arch/arm64/net/bpf_jit_comp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
876876
emit(A64_UXTH(is64, dst, dst), ctx);
877877
break;
878878
case 32:
879-
emit(A64_REV32(is64, dst, dst), ctx);
879+
emit(A64_REV32(0, dst, dst), ctx);
880880
/* upper 32 bits already cleared */
881881
break;
882882
case 64:
@@ -1189,7 +1189,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
11891189
} else {
11901190
emit_a64_mov_i(1, tmp, off, ctx);
11911191
if (sign_extend)
1192-
emit(A64_LDRSW(dst, src_adj, off_adj), ctx);
1192+
emit(A64_LDRSW(dst, src, tmp), ctx);
11931193
else
11941194
emit(A64_LDR32(dst, src, tmp), ctx);
11951195
}

0 commit comments

Comments
 (0)