ALAS2KERNEL-5.4-2022-023

Related Vulnerabilities: CVE-2021-4197   CVE-2022-0001   CVE-2022-0002   CVE-2022-0435   CVE-2022-0847  

Amazon Linux has been made aware of a potential Branch Target Injection (BTI) issue (sometimes referred to as Spectre variant 2). This is a known cross-domain transient execution attack where a third party may seek to cause a disclosure gadget to be speculatively executed after an indirect branch prediction. Generally, actors who attempt transient execution attacks do not have access to the data on the hosts they attempt to access (e.g. where privilege-level isolation is in place). For such attacks to succeed, actors need to be able to run code on the (virtual) machine hosting the data in which they are interested. To mitigate this issue, Amazon Linux recommends that customers disable unprivileged eBPF. This configuration, having the unprivileged eBPF disabled, is the current default for most Linux distributions and as of this advisory, is also the default for all Amazon Linux kernels. Specific mitigations for various CPUs are listed below. Intel CPUs: For Intel CPUs, this applies to all instance types that have CPUs with eIBRS support. They are: *6i* (all sizes), c5d.metal, c5.metal, g4dn.metal, i3en.metal, m5*.metal, r5*.metal Vectors outside of unprivileged eBPF are not currently known, and Intel recommends disabling unprivileged BPF, as mentioned above. However, optionally enabling "spectre_v2=eibrs,lfence" on Linux kernel command line on the instance types mentioned above, would provide additional protection. AMD CPUs:As part of the investigation triggered by this issue, AMD now recommends using a different software mitigation inside the Linux kernel, which the Amazon Linux kernel is enabling by default. This means that the Linux kernel will use the generic retpoline software mitigation, instead of the specialized AMD one, on AMD instances (*5a*). This is done by default, and no administrator action is needed. ARM CPUs:The Amazon Linux kernel now enables, by default, a software mitigation for this issue, on all ARM-based EC2 instance types. An unprivileged write to the file handler flaw in the Linux kernel's control groups and namespaces subsystem was found in the way users have access to some less privileged process that are controlled by cgroups and have higher privileged parent process. It is actually both for cgroup2 and cgroup1 versions of control groups. A local user could use this flaw to crash the system or escalate their privileges on the system. (CVE-2021-4197) Non-transparent sharing of branch predictor selectors between contexts in some Intel(R) Processors may allow an authorized user to potentially enable information disclosure. (CVE-2022-0001) Non-transparent sharing of branch predictor within a context in some Intel(r) Processors may allow an authorized user to potentially enable information disclosure via local access. (CVE-2022-0002) A stack overflow flaw was found in the Linux kernel's TIPC protocol functionality in the way a user sends a packet with malicious content where the number of domain member nodes is higher than the 64 allowed. This flaw allows a remote user to crash the system or possibly escalate their privileges if they have access to the TIPC network. (CVE-2022-0435) A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe and push_pipe functions in the Linux kernel and could thus contain stale values. An unprivileged local user could use this flaw to write to pages in the page cache backed by read only files and as such escalate their privileges on the system. (CVE-2022-0847)

ALAS2KERNEL-5.4-2022-023


Amazon Linux 2 Security Advisory: ALASKERNEL-5.4-2022-023
Advisory Release Date: 2022-03-07 23:47 Pacific
Advisory Updated Date: 2022-03-08 19:26 Pacific
Severity: Important

Issue Overview:

Amazon Linux has been made aware of a potential Branch Target Injection (BTI) issue (sometimes referred to as Spectre variant 2). This is a known cross-domain transient execution attack where a third party may seek to cause a disclosure gadget to be speculatively executed after an indirect branch prediction. Generally, actors who attempt transient execution attacks do not have access to the data on the hosts they attempt to access (e.g. where privilege-level isolation is in place). For such attacks to succeed, actors need to be able to run code on the (virtual) machine hosting the data in which they are interested.

To mitigate this issue, Amazon Linux recommends that customers disable unprivileged eBPF. This configuration, having the unprivileged eBPF disabled, is the current default for most Linux distributions and as of this advisory, is also the default for all Amazon Linux kernels.

Specific mitigations for various CPUs are listed below.

Intel CPUs:
For Intel CPUs, this applies to all instance types that have CPUs with eIBRS support. They are:
*6i* (all sizes), c5d.metal, c5.metal, g4dn.metal, i3en.metal, m5*.metal, r5*.metal

Vectors outside of unprivileged eBPF are not currently known, and Intel recommends disabling unprivileged BPF, as mentioned above. However, optionally enabling "spectre_v2=eibrs,lfence" on Linux kernel command line on the instance types mentioned above, would provide additional protection.

AMD CPUs:
As part of the investigation triggered by this issue, AMD now recommends using a different software mitigation inside the Linux kernel, which the Amazon Linux kernel is enabling by default. This means that the Linux kernel will use the generic retpoline software mitigation, instead of the specialized AMD one, on AMD instances (*5a*). This is done by default, and no administrator action is needed.

ARM CPUs:
The Amazon Linux kernel now enables, by default, a software mitigation for this issue, on all ARM-based EC2 instance types.


An unprivileged write to the file handler flaw in the Linux kernel's control groups and namespaces subsystem was found in the way users have access to some less privileged process that are controlled by cgroups and have higher privileged parent process. It is actually both for cgroup2 and cgroup1 versions of control groups. A local user could use this flaw to crash the system or escalate their privileges on the system. (CVE-2021-4197)

Non-transparent sharing of branch predictor selectors between contexts in some Intel(R) Processors may allow an authorized user to potentially enable information disclosure. (CVE-2022-0001)

Non-transparent sharing of branch predictor within a context in some Intel(r) Processors may allow an authorized user to potentially enable information disclosure via local access. (CVE-2022-0002)

A stack overflow flaw was found in the Linux kernel's TIPC protocol functionality in the way a user sends a packet with malicious content where the number of domain member nodes is higher than the 64 allowed. This flaw allows a remote user to crash the system or possibly escalate their privileges if they have access to the TIPC network. (CVE-2022-0435)

A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe and push_pipe functions in the Linux kernel and could thus contain stale values. An unprivileged local user could use this flaw to write to pages in the page cache backed by read only files and as such escalate their privileges on the system. (CVE-2022-0847)


Affected Packages:

kernel


Issue Correction:
Run yum update kernel to update your system.

New Packages:
aarch64:
    kernel-5.4.181-99.354.amzn2.aarch64
    kernel-headers-5.4.181-99.354.amzn2.aarch64
    kernel-debuginfo-common-aarch64-5.4.181-99.354.amzn2.aarch64
    perf-5.4.181-99.354.amzn2.aarch64
    perf-debuginfo-5.4.181-99.354.amzn2.aarch64
    python-perf-5.4.181-99.354.amzn2.aarch64
    python-perf-debuginfo-5.4.181-99.354.amzn2.aarch64
    kernel-tools-5.4.181-99.354.amzn2.aarch64
    kernel-tools-devel-5.4.181-99.354.amzn2.aarch64
    kernel-tools-debuginfo-5.4.181-99.354.amzn2.aarch64
    bpftool-5.4.181-99.354.amzn2.aarch64
    bpftool-debuginfo-5.4.181-99.354.amzn2.aarch64
    kernel-devel-5.4.181-99.354.amzn2.aarch64
    kernel-debuginfo-5.4.181-99.354.amzn2.aarch64

i686:
    kernel-headers-5.4.181-99.354.amzn2.i686

src:
    kernel-5.4.181-99.354.amzn2.src

x86_64:
    kernel-5.4.181-99.354.amzn2.x86_64
    kernel-headers-5.4.181-99.354.amzn2.x86_64
    kernel-debuginfo-common-x86_64-5.4.181-99.354.amzn2.x86_64
    perf-5.4.181-99.354.amzn2.x86_64
    perf-debuginfo-5.4.181-99.354.amzn2.x86_64
    python-perf-5.4.181-99.354.amzn2.x86_64
    python-perf-debuginfo-5.4.181-99.354.amzn2.x86_64
    kernel-tools-5.4.181-99.354.amzn2.x86_64
    kernel-tools-devel-5.4.181-99.354.amzn2.x86_64
    kernel-tools-debuginfo-5.4.181-99.354.amzn2.x86_64
    bpftool-5.4.181-99.354.amzn2.x86_64
    bpftool-debuginfo-5.4.181-99.354.amzn2.x86_64
    kernel-devel-5.4.181-99.354.amzn2.x86_64
    kernel-debuginfo-5.4.181-99.354.amzn2.x86_64