aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGravatar Mathias Krause <minipli@grsecurity.net> 2024-02-03 13:45:20 +0100
committerGravatar Sean Christopherson <seanjc@google.com> 2024-02-05 11:20:51 -0800
commit3376ca3f1a2075eaa23c5576c47d04d7e8a4adda (patch)
tree9a44e02b1355b363092533d8016261acbed0aec5 /tools
parentKVM: x86/pmu: Fix type length error when reading pmu->fixed_ctr_ctrl (diff)
downloadlinux-3376ca3f1a2075eaa23c5576c47d04d7e8a4adda.tar.gz
linux-3376ca3f1a2075eaa23c5576c47d04d7e8a4adda.tar.bz2
linux-3376ca3f1a2075eaa23c5576c47d04d7e8a4adda.zip
KVM: x86: Fix KVM_GET_MSRS stack info leak
Commit 6abe9c1386e5 ("KVM: X86: Move ignore_msrs handling upper the stack") changed the 'ignore_msrs' handling, including sanitizing return values to the caller. This was fine until commit 12bc2132b15e ("KVM: X86: Do the same ignore_msrs check for feature msrs") which allowed non-existing feature MSRs to be ignored, i.e. to not generate an error on the ioctl() level. It even tried to preserve the sanitization of the return value. However, the logic is flawed, as '*data' will be overwritten again with the uninitialized stack value of msr.data. Fix this by simplifying the logic and always initializing msr.data, vanishing the need for an additional error exit path. Fixes: 12bc2132b15e ("KVM: X86: Do the same ignore_msrs check for feature msrs") Signed-off-by: Mathias Krause <minipli@grsecurity.net> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Link: https://lore.kernel.org/r/20240203124522.592778-2-minipli@grsecurity.net Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions