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]
Date:   Mon, 9 Dec 2019 16:32:09 +0000
From:   Hanna Hawa <hhhawa@...zon.com>
To:     <axboe@...nel.dk>, <hdegoede@...hat.com>
CC:     <linux-ide@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <dwmw@...zon.co.uk>, <benh@...zon.com>, <ronenk@...zon.com>,
        <talel@...zon.com>, <jonnyc@...zon.com>, <hanochu@...zon.com>,
        <barakw@...zon.com>, <hhhawa@...zon.com>
Subject: [PATCH 2/2] ata: ahci: Add shutdown handler

An issue found while doing kexec on Annapurna Labs SoC: an AXI read
error occur due to an access from the interrupt handler of AHCI to the
AHCI controller.
This patch make sure that the interrupts are disabled for the controller
while doing kexec.

The shutdown handler is called during system shutdown to disable host
controller DMA and interrupts in order to avoid potentially corrupting
or otherwise interfering with a new kernel being started with kexec.

Signed-off-by: Hanna Hawa <hhhawa@...zon.com>
---
 drivers/ata/ahci.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 05c2b32dcc4d..34ddc259343a 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -80,6 +80,7 @@ enum board_ids {
 
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 static void ahci_remove_one(struct pci_dev *dev);
+static void ahci_shutdown(struct pci_dev *dev);
 static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
 				 unsigned long deadline);
 static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
@@ -593,6 +594,7 @@ static struct pci_driver ahci_pci_driver = {
 	.id_table		= ahci_pci_tbl,
 	.probe			= ahci_init_one,
 	.remove			= ahci_remove_one,
+	.shutdown		= ahci_shutdown,
 	.driver = {
 		.pm		= &ahci_pci_pm_ops,
 	},
@@ -1870,6 +1872,13 @@ static void ahci_remove_one(struct pci_dev *pdev)
 	ata_pci_remove_one(pdev);
 }
 
+static void ahci_shutdown(struct pci_dev *pdev)
+{
+	struct ata_host *host = pci_get_drvdata(pdev);
+
+	ahci_common_shutdown(host);
+}
+
 module_pci_driver(ahci_pci_driver);
 
 MODULE_AUTHOR("Jeff Garzik");
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ