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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5789025.lOV4Wx5bFT@kreacher>
Date:   Wed, 12 Jan 2022 19:26:32 +0100
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Linux ACPI <linux-acpi@...r.kernel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Steven Noonan <steven@...vesoftware.com>,
        Huang Rui <ray.huang@....com>
Subject: [PATCH v1 1/2] ACPI: CPPC: Fix up I/O port access in cpc_read()

From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

The code as currently implemented does not work on big endian systems,
so fix it up.

Fixes: a2c8f92bea5f ("ACPI: CPPC: Implement support for SystemIO registers")
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Suggested-by: Dan Carpenter <dan.carpenter@...cle.com>
Link: https://lore.kernel.org/linux-acpi/20220111092928.GA24968@kili/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
 drivers/acpi/cppc_acpi.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-pm/drivers/acpi/cppc_acpi.c
===================================================================
--- linux-pm.orig/drivers/acpi/cppc_acpi.c
+++ linux-pm/drivers/acpi/cppc_acpi.c
@@ -929,16 +929,18 @@ static int cpc_read(int cpu, struct cpc_
 
 	if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
 		u32 width = 8 << (reg->access_width - 1);
+		u32 val_u32;
 		acpi_status status;
 
 		status = acpi_os_read_port((acpi_io_address)reg->address,
-					   (u32 *)val, width);
+					   &val_u32, width);
 		if (ACPI_FAILURE(status)) {
 			pr_debug("Error: Failed to read SystemIO port %llx\n",
 				 reg->address);
 			return -EFAULT;
 		}
 
+		*val = val_u32;
 		return 0;
 	} else if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >= 0)
 		vaddr = GET_PCC_VADDR(reg->address, pcc_ss_id);



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ