lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240328102805.165070-1-korotkov.maxim.s@gmail.com>
Date: Thu, 28 Mar 2024 13:28:05 +0300
From: Maxim Korotkov <korotkov.maxim.s@...il.com>
To: Kenneth Chan <kenneth.t.chan@...il.com>
Cc: Maxim Korotkov <korotkov.maxim.s@...il.com>,
	Len Brown <len.brown@...el.com>,
	Henrique de Moraes Holschuh <hmh@....eng.br>,
	Harald Welte <laforge@...monks.org>,
	Matthew Garrett <mjg@...hat.com>,
	Ivan Kapranov <i.kapranov@...uritycode.ru>,
	lvc-project@...uxtesting.org,
	platform-driver-x86@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: 

Date: Thu, 28 Mar 2024 11:22:37 +0300
Subject: [PATCH] platform/x86: panasonic-laptop: fix NULL dereference

When initializing the pcc by calling acpi_driver_data(), the "device"
pointer was dereferenced without checking for NULL. This seems like
a logical mistake.

Added a pointer check to ensure that it is valid
before using it for pcc initialization.

Found by Security Code and Linux Verification Center(linuxtesting.org)

Fixes: 709ee531c153 ("panasonic-laptop: add Panasonic Let's Note laptop extras driver v0.94")

Signed-off-by: Maxim Korotkov <korotkov.maxim.s@...il.com>
---
 drivers/platform/x86/panasonic-laptop.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index cf845ee1c7b1..de29758b0384 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -1067,9 +1067,12 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
 
 static void acpi_pcc_hotkey_remove(struct acpi_device *device)
 {
-	struct pcc_acpi *pcc = acpi_driver_data(device);
+	struct pcc_acpi *pcc;
 
-	if (!device || !pcc)
+	if (!device)
+		return;
+	pcc = acpi_driver_data(device);
+	if (!pcc)
 		return;
 
 	i8042_remove_filter(panasonic_i8042_filter);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ