Commit e2e45e6
KVM: x86: use array_index_nospec with indices that come from guest
commit c87bd4d upstream.
min and dest_id are guest-controlled indices. Using array_index_nospec()
after the bounds checks clamps these values to mitigate speculative execution
side-channels.
Signed-off-by: Thijs Raymakers <thijs@raymakers.nl>
Cc: stable@vger.kernel.org
Cc: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes: 7150629 ("KVM: X86: Implement PV sched yield hypercall")
Fixes: bdf7ffc ("KVM: LAPIC: Fix pv ipis out-of-bounds access")
Fixes: 4180bf1 ("KVM: X86: Implement "send IPI" hypercall")
Link: https://lore.kernel.org/r/20250804064405.4802-1-thijs@raymakers.nl
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 67a05679621b7f721bdba37a5d18665d3aceb695)1 parent 2cc991d commit e2e45e6
2 files changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| 863 | + | |
| 864 | + | |
863 | 865 | | |
864 | 866 | | |
865 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9974 | 9974 | | |
9975 | 9975 | | |
9976 | 9976 | | |
9977 | | - | |
9978 | | - | |
| 9977 | + | |
| 9978 | + | |
| 9979 | + | |
| 9980 | + | |
| 9981 | + | |
9979 | 9982 | | |
9980 | 9983 | | |
9981 | 9984 | | |
| |||
0 commit comments