CVE-2022-48727

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48727
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48727.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-48727
Downstream
Related
Published
2024-06-20T11:13:16Z
Modified
2025-10-21T08:19:49.740570Z
Summary
KVM: arm64: Avoid consuming a stale esr value when SError occur
Details

In the Linux kernel, the following vulnerability has been resolved:

KVM: arm64: Avoid consuming a stale esr value when SError occur

When any exception other than an IRQ occurs, the CPU updates the ESREL2 register with the exception syndrome. An SError may also become pending, and will be synchronised by KVM. KVM notes the exception type, and whether an SError was synchronised in exitcode.

When an exception other than an IRQ occurs, fixupguestexit() updates vcpu->arch.fault.esrel2 from the hardware register. When an SError was synchronised, the vcpu esr value is used to determine if the exception was due to an HVC. If so, ELREL2 is moved back one instruction. This is so that KVM can process the SError first, and re-execute the HVC if the guest survives the SError.

But if an IRQ synchronises an SError, the vcpu's esr value is stale. If the previous non-IRQ exception was an HVC, KVM will corrupt ELR_EL2, causing an unrelated guest instruction to be executed twice.

Check ARMEXCEPTIONCODE() before messing with ELR_EL2, IRQs don't update this register so don't need to check.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
defe21f49bc98b095300752aa1e19bb608f3e97d
Fixed
e1e852746997500f1873f60b954da5f02cc2dba3
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
defe21f49bc98b095300752aa1e19bb608f3e97d
Fixed
57e2986c3b25092691a6e3d6ee9168caf8978932
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
defe21f49bc98b095300752aa1e19bb608f3e97d
Fixed
1c71dbc8a179d99dd9bb7e7fc1888db613cf85de

Affected versions

v5.*

v5.10
v5.10-rc4
v5.10-rc5
v5.10-rc6
v5.10-rc7
v5.11
v5.11-rc1
v5.11-rc2
v5.11-rc3
v5.11-rc4
v5.11-rc5
v5.11-rc6
v5.11-rc7
v5.12
v5.12-rc1
v5.12-rc1-dontuse
v5.12-rc2
v5.12-rc3
v5.12-rc4
v5.12-rc5
v5.12-rc6
v5.12-rc7
v5.12-rc8
v5.13
v5.13-rc1
v5.13-rc2
v5.13-rc3
v5.13-rc4
v5.13-rc5
v5.13-rc6
v5.13-rc7
v5.14
v5.14-rc1
v5.14-rc2
v5.14-rc3
v5.14-rc4
v5.14-rc5
v5.14-rc6
v5.14-rc7
v5.15
v5.15-rc1
v5.15-rc2
v5.15-rc3
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.15.1
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.2
v5.15.20
v5.15.21
v5.15.3
v5.15.4
v5.15.5
v5.15.6
v5.15.7
v5.15.8
v5.15.9
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.16.1
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.17-rc1
v5.17-rc2

Database specific

vanir_signatures

[
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57e2986c3b25092691a6e3d6ee9168caf8978932",
        "id": "CVE-2022-48727-21da791c",
        "deprecated": false,
        "signature_version": "v1",
        "target": {
            "file": "arch/arm64/kvm/hyp/include/hyp/switch.h"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "178517620051367405637025952750716075222",
                "146447622455297190686654202591309492896",
                "170161980277978333226628767769071895371",
                "97038633887741875918182279415309899186"
            ]
        },
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57e2986c3b25092691a6e3d6ee9168caf8978932",
        "id": "CVE-2022-48727-724b491c",
        "deprecated": false,
        "signature_version": "v1",
        "target": {
            "function": "fixup_guest_exit",
            "file": "arch/arm64/kvm/hyp/include/hyp/switch.h"
        },
        "digest": {
            "length": 649.0,
            "function_hash": "118913232511642971519161931152511945647"
        },
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1c71dbc8a179d99dd9bb7e7fc1888db613cf85de",
        "id": "CVE-2022-48727-871f8862",
        "deprecated": false,
        "signature_version": "v1",
        "target": {
            "function": "fixup_guest_exit",
            "file": "arch/arm64/kvm/hyp/include/hyp/switch.h"
        },
        "digest": {
            "length": 649.0,
            "function_hash": "118913232511642971519161931152511945647"
        },
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e1e852746997500f1873f60b954da5f02cc2dba3",
        "id": "CVE-2022-48727-89680029",
        "deprecated": false,
        "signature_version": "v1",
        "target": {
            "file": "arch/arm64/kvm/hyp/include/hyp/switch.h"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "303522827444544549842320213965783333330",
                "146447622455297190686654202591309492896",
                "170161980277978333226628767769071895371",
                "97038633887741875918182279415309899186"
            ]
        },
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1c71dbc8a179d99dd9bb7e7fc1888db613cf85de",
        "id": "CVE-2022-48727-a379ad6e",
        "deprecated": false,
        "signature_version": "v1",
        "target": {
            "file": "arch/arm64/kvm/hyp/include/hyp/switch.h"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "178517620051367405637025952750716075222",
                "146447622455297190686654202591309492896",
                "170161980277978333226628767769071895371",
                "97038633887741875918182279415309899186"
            ]
        },
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e1e852746997500f1873f60b954da5f02cc2dba3",
        "id": "CVE-2022-48727-fcb9b838",
        "deprecated": false,
        "signature_version": "v1",
        "target": {
            "function": "fixup_guest_exit",
            "file": "arch/arm64/kvm/hyp/include/hyp/switch.h"
        },
        "digest": {
            "length": 1378.0,
            "function_hash": "220167127567593964523867573888580459471"
        },
        "signature_type": "Function"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.22
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.8