All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libata: fix DMA to stack in reading devslp_timing parameters
@ 2013-03-29 11:54 David Woodhouse
  2013-04-01  9:51 ` Huang, Shane
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Woodhouse @ 2013-03-29 11:54 UTC (permalink / raw)
  To: Shane Huang; +Cc: Jeff Garzik, linux-ide

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

Commit 803739d25c2343da6d2f95eebdcbc08bf67097d4 ("[libata] replace
sata_settings with devslp_timing"), which was also Cc: stable, used a
stack buffer to receive data from ata_read_log_page(), which triggers
the following warning:
 ahci 0000:00:1f.2: DMA-API: device driver maps memory fromstack [addr=ffff880140469948]

Fix this by using ap->sector_buf instead of a stack buffer.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org

---
I'm somewhat ignorant, but it looks like this is kind of thing is what
ap->sector_buf is *for*, right? And in ata_dev_configure() nobody else
is likely to be using it?

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 497adea..b1160ee 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device *dev)
 		 * from SATA Settings page of Identify Device Data Log.
 		 */
 		if (ata_id_has_devslp(dev->id)) {
-			u8 sata_setting[ATA_SECT_SIZE];
+			u8 *sata_setting = ap->sector_buf;
 			int i, j;
 
 			dev->flags |= ATA_DFLAG_DEVSLP;

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-03 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29 11:54 [PATCH] libata: fix DMA to stack in reading devslp_timing parameters David Woodhouse
2013-04-01  9:51 ` Huang, Shane
2013-04-03 17:02 ` David Woodhouse
2013-04-03 23:46 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.