Subject: CVE-2021-46953: ACPI: GTDT: Don't corrupt interrupt mappings on watchdow probe failure

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

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

ACPI: GTDT: Don't corrupt interrupt mappings on watchdow probe failure

When failing the driver probe because of invalid firmware properties,
the GTDT driver unmaps the interrupt that it mapped earlier.

However, it never checks whether the mapping of the interrupt actially
succeeded. Even more, should the firmware report an illegal interrupt
number that overlaps with the GIC SGI range, this can result in an
IPI being unmapped, and subsequent fireworks (as reported by Dann
Frazier).

Rework the driver to have a slightly saner behaviour and actually
check whether the interrupt has been mapped before unmapping things.

The Linux kernel CVE team has assigned CVE-2021-46953 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 4.12 with commit ca9ae5ec4ef0 and fixed in 4.14.233 with commit c3385a9122f8
	Issue introduced in 4.12 with commit ca9ae5ec4ef0 and fixed in 4.19.191 with commit 7b2162db1498
	Issue introduced in 4.12 with commit ca9ae5ec4ef0 and fixed in 5.4.118 with commit 504632a3577a
	Issue introduced in 4.12 with commit ca9ae5ec4ef0 and fixed in 5.10.36 with commit e0f2d86481ea
	Issue introduced in 4.12 with commit ca9ae5ec4ef0 and fixed in 5.11.20 with commit 42e69521ee1f
	Issue introduced in 4.12 with commit ca9ae5ec4ef0 and fixed in 5.12.3 with commit 596e079c362a
	Issue introduced in 4.12 with commit ca9ae5ec4ef0 and fixed in 5.13 with commit 1ecd5b129252

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2021-46953
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	drivers/acpi/arm64/gtdt.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/c3385a9122f8db15b453e07bfc88117fce7f3724
	https://git.kernel.org/stable/c/7b2162db1498c71962a4bb2f776fa4e76d4d305b
	https://git.kernel.org/stable/c/504632a3577a049dd9bb7aabae5b4476f9c586b4
	https://git.kernel.org/stable/c/e0f2d86481eaa83df33b0793f75212919db7a19d
	https://git.kernel.org/stable/c/42e69521ee1fa5abf21f478d147d06bbfe6bf6a8
	https://git.kernel.org/stable/c/596e079c362ac17ed02aa1b99fdc444d62072a01
	https://git.kernel.org/stable/c/1ecd5b129252249b9bc03d7645a7bda512747277