All of lore.kernel.org
 help / color / mirror / Atom feed
From: Holger Kiehl <Holger.Kiehl@dwd.de>
To: Kees Cook <keescook@chromium.org>
Cc: Kashyap Desai <kashyap.desai@broadcom.com>,
	Sumit Saxena <sumit.saxena@broadcom.com>,
	Shivasharan S <shivasharan.srikanteshwara@broadcom.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] scsi: megaraid_sas: Add flexible array member for SGLs
Date: Fri, 6 Jan 2023 11:49:11 +0000 (GMT)	[thread overview]
Message-ID: <7cc1efed-1241-112d-2a12-6abeea323284@diagnostix.dwd.de> (raw)
In-Reply-To: <20230106053153.never.999-kees@kernel.org>

On Thu, 5 Jan 2023, Kees Cook wrote:

> struct MPI2_RAID_SCSI_IO_REQUEST ends with a single SGL, but expects to
> copy multiple. Add a flexible array member so the compiler can reason
> about the size of the memcpy(). This will avoid the run-time false
> positive warning:
>
>  memcpy: detected field-spanning write (size 128) of single field "&r1_cmd->io_request->SGL" at drivers/scsi/megaraid/megaraid_sas_fusion.c:3326 (size 16)
>
> This change results in no binary output differences.
>
> Reported-by: Holger Kiehl <Holger.Kiehl@dwd.de>
> Link: https://lore.kernel.org/all/88de8faa-56c4-693d-2d3-67152ee72057@diagnostix.dwd.de/
> Cc: Kashyap Desai <kashyap.desai@broadcom.com>
> Cc: Sumit Saxena <sumit.saxena@broadcom.com>
> Cc: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
> Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Cc: megaraidlinux.pdl@broadcom.com
> Cc: linux-scsi@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> Holger, are you able to test this change? I expect it should do the
> trick, but I don't have the hardware.
>
Yes, that does work. I no longer see 'memcpy: detected field-spanning
write (size 128)'. Tested this on 6.1.4-rc1. Did not see any other
regression.

Regards,
Holger

  reply	other threads:[~2023-01-06 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06  5:32 [PATCH] scsi: megaraid_sas: Add flexible array member for SGLs Kees Cook
2023-01-06 11:49 ` Holger Kiehl [this message]
2023-01-18 23:23 ` Martin K. Petersen
2023-01-27  3:22 ` 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=7cc1efed-1241-112d-2a12-6abeea323284@diagnostix.dwd.de \
    --to=holger.kiehl@dwd.de \
    --cc=jejb@linux.ibm.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --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 \
    /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.