From: Phil Oester <kernel@linuxace.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Arnd Bergmann <arnd@arndb.de>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sumit Saxena <sumit.saxena@broadcom.com>,
Shivasharan S <shivasharan.srikanteshwara@broadcom.com>,
Anand Lodnoor <anand.lodnoor@broadcom.com>,
Vaibhav Gupta <vaibhavgupta40@gmail.com>,
Jason Yan <yanaijie@huawei.com>,
Damien Le Moal <damien.lemoal@wdc.com>,
megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: megaraid_sas: Fix MEGASAS_IOC_FIRMWARE regression
Date: Mon, 4 Jan 2021 17:52:43 -0800 [thread overview]
Message-ID: <20210105015243.GA80882@home.linuxace.com> (raw)
In-Reply-To: <20210104234137.438275-1-arnd@kernel.org>
On Tue, Jan 05, 2021 at 12:41:04AM +0100, Arnd Bergmann wrote:
> Phil Oester reported that a fix for a possible buffer overrun that I
> sent caused a regression that manifests in this output:
>
> Event Message: A PCI parity error was detected on a component at bus 0 device 5 function 0.
> Severity: Critical
> Message ID: PCI1308
>
> The original code tried to handle the sense data pointer differently
> when using 32-bit 64-bit DMA addressing, which would lead to a 32-bit
> dma_addr_t value of 0x11223344 to get stored
>
> 32-bit kernel: 44 33 22 11 ?? ?? ?? ??
> 64-bit LE kernel: 44 33 22 11 00 00 00 00
> 64-bit BE kernel: 00 00 00 00 44 33 22 11
>
> or a 64-bit dma_addr_t value of 0x1122334455667788 to get stored as
>
> 32-bit kernel: 88 77 66 55 ?? ?? ?? ??
> 64-bit kernel: 88 77 66 55 44 33 22 11
>
> In my patch, I tried to ensure that the same value is used on both
> 32-bit and 64-bit kernels, and picked what seemed to be the most sensible
> combination, storing 32-bit addresses in the first four bytes (as 32-bit
> kernels already did), and 64-bit addresses in eight consecutive bytes
> (as 64-bit kernels already did), but evidently this was incorrect.
>
> Always storing the dma_addr_t pointer as 64-bit little-endian,
> i.e. initializing the second four bytes to zero in case of 32-bit
> addressing, apparently solved the problem for Phil, and is consistent
> with what all 64-bit little-endian machines did before.
>
> I also checked in the history that in previous versions of the code,
> the pointer was always in the first four bytes without padding, and that
> previous attempts to fix 64-bit user space, big-endian architectures
> and 64-bit DMA were clearly flawed and seem to have introduced made
> this worse.
>
> Reported-by: Phil Oester <kernel@linuxace.com>
> Fixes: 381d34e376e3 ("scsi: megaraid_sas: Check user-provided offsets")
> Fixes: 107a60dd71b5 ("scsi: megaraid_sas: Add support for 64bit consistent DMA")
> Fixes: 94cd65ddf4d7 ("[SCSI] megaraid_sas: addded support for big endian architecture")
> Fixes: 7b2519afa1ab ("[SCSI] megaraid_sas: fix 64 bit sense pointer truncation")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This solves the issue on our Dell servers, thanks Arnd.
Phil
next prev parent reply other threads:[~2021-01-05 1:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 23:41 [PATCH] scsi: megaraid_sas: Fix MEGASAS_IOC_FIRMWARE regression Arnd Bergmann
2021-01-05 1:52 ` Phil Oester [this message]
2021-01-08 4:19 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210105015243.GA80882@home.linuxace.com \
--to=kernel@linuxace.com \
--cc=anand.lodnoor@broadcom.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=damien.lemoal@wdc.com \
--cc=jejb@linux.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=megaraidlinux.pdl@broadcom.com \
--cc=shivasharan.srikanteshwara@broadcom.com \
--cc=sumit.saxena@broadcom.com \
--cc=vaibhavgupta40@gmail.com \
--cc=yanaijie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.