From: Jason Gunthorpe <jgg@nvidia.com>
To: Kees Cook <keescook@chromium.org>
Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
Leon Romanovsky <leon@kernel.org>,
cgel.zte@gmail.com, "Gustavo A. R. Silva" <gustavoars@kernel.org>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] IB/hfi1: Replace 1-element array with singleton
Date: Fri, 18 Nov 2022 19:56:50 -0400 [thread overview]
Message-ID: <Y3gbwroyCqH2nSlz@nvidia.com> (raw)
In-Reply-To: <20221118215847.never.416-kees@kernel.org>
On Fri, Nov 18, 2022 at 01:58:51PM -0800, Kees Cook wrote:
> Zero-length arrays are deprecated[1] and are being replaced with
> flexible array members in support of the ongoing efforts to tighten the
> FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing
> with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3.
>
> Replace zero-length array with flexible-array member "lvs" in struct
> opa_port_data_counters_msg and struct opa_port_error_counters64_msg.
>
> Additionally, the "port" member of several structs is defined as a
> single-element, but is only ever accessed at index 0. Replace it with a
> singleton so that flexible array usage is sane.
>
> This results in no differences in binary output.
>
> [1] https://github.com/KSPP/linux/issues/78
>
> Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Leon Romanovsky <leon@kernel.org>
> Cc: cgel.zte@gmail.com
> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> Cc: linux-rdma@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> drivers/infiniband/hw/hfi1/mad.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
Applied to for-next, thanks
Jason
prev parent reply other threads:[~2022-11-19 0:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 21:58 [PATCH] IB/hfi1: Replace 1-element array with singleton Kees Cook
2022-11-18 23:56 ` Jason Gunthorpe [this message]
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=Y3gbwroyCqH2nSlz@nvidia.com \
--to=jgg@nvidia.com \
--cc=cgel.zte@gmail.com \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=leon@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox