From: Greg Kroah-Hartman Date: Mon, 26 Jul 2021 06:54:20 +0000 (+0200) Subject: 5.13-stable patches X-Git-Tag: v4.4.277~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e093bd7a902b3fab6c395f3c73855efea58aa6e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.13-stable patches added patches: acpi-fix-null-pointer-dereference.patch --- diff --git a/queue-5.13/acpi-fix-null-pointer-dereference.patch b/queue-5.13/acpi-fix-null-pointer-dereference.patch new file mode 100644 index 00000000000..600990db405 --- /dev/null +++ b/queue-5.13/acpi-fix-null-pointer-dereference.patch @@ -0,0 +1,40 @@ +From fc68f42aa737dc15e7665a4101d4168aadb8e4c4 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Sat, 24 Jul 2021 15:25:54 -0700 +Subject: ACPI: fix NULL pointer dereference + +From: Linus Torvalds + +commit fc68f42aa737dc15e7665a4101d4168aadb8e4c4 upstream. + +Commit 71f642833284 ("ACPI: utils: Fix reference counting in +for_each_acpi_dev_match()") started doing "acpi_dev_put()" on a pointer +that was possibly NULL. That fails miserably, because that helper +inline function is not set up to handle that case. + +Just make acpi_dev_put() silently accept a NULL pointer, rather than +calling down to put_device() with an invalid offset off that NULL +pointer. + +Link: https://lore.kernel.org/lkml/a607c149-6bf6-0fd0-0e31-100378504da2@kernel.dk/ +Reported-and-tested-by: Jens Axboe +Tested-by: Daniel Scally +Cc: Andy Shevchenko +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + include/acpi/acpi_bus.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/include/acpi/acpi_bus.h ++++ b/include/acpi/acpi_bus.h +@@ -711,7 +711,8 @@ static inline struct acpi_device *acpi_d + + static inline void acpi_dev_put(struct acpi_device *adev) + { +- put_device(&adev->dev); ++ if (adev) ++ put_device(&adev->dev); + } + #else /* CONFIG_ACPI */ + diff --git a/queue-5.13/series b/queue-5.13/series index 69f47e03571..bf6d9e7b7ac 100644 --- a/queue-5.13/series +++ b/queue-5.13/series @@ -141,3 +141,4 @@ dpaa2-switch-seed-the-buffer-pool-after-allocating-t.patch cifs-only-write-64kb-at-a-time-when-fallocating-a-sm.patch cifs-fix-fallocate-when-trying-to-allocate-a-hole.patch proc-avoid-mixing-integer-types-in-mem_rw.patch +acpi-fix-null-pointer-dereference.patch