From: Jeffrey E Altman <jaltman@auristor.com>
To: "Gustavo A. R. Silva (gustavoars@kernel.org)"
<gustavoars@kernel.org>, David Howells <dhowells@redhat.com>,
Marc Dionne <marc.dionne@auristor.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: linux-afs@lists.infradead.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] rxrpc: Replace fake flex-array with flexible-array member
Date: Fri, 21 Apr 2023 09:00:48 -0400 [thread overview]
Message-ID: <5f69be9f-0008-0253-0fe2-e982fd718146@auristor.com> (raw)
In-Reply-To: <ZAZT11n4q5bBttW0@work>
[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]
On 3/6/2023 3:57 PM, Gustavo A. R. Silva (gustavoars@kernel.org) wrote:
> Zero-length arrays as fake flexible arrays are deprecated and we are
> moving towards adopting C99 flexible-array members instead.
>
> Transform zero-length array into flexible-array member in struct
> rxrpc_ackpacket.
>
> Address the following warnings found with GCC-13 and
> -fstrict-flex-arrays=3 enabled:
> net/rxrpc/call_event.c:149:38: warning: array subscript i is outside array bounds of ‘uint8_t[0]’ {aka ‘unsigned char[]’} [-Warray-bounds=]
>
> This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
> routines on memcpy() and help us make progress towards globally
> enabling -fstrict-flex-arrays=3 [1].
>
> Link: https://github.com/KSPP/linux/issues/21
> Link: https://github.com/KSPP/linux/issues/263
> Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> net/rxrpc/protocol.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/rxrpc/protocol.h b/net/rxrpc/protocol.h
> index 6760cb99c6d6..e8ee4af43ca8 100644
> --- a/net/rxrpc/protocol.h
> +++ b/net/rxrpc/protocol.h
> @@ -126,7 +126,7 @@ struct rxrpc_ackpacket {
> uint8_t nAcks; /* number of ACKs */
> #define RXRPC_MAXACKS 255
>
> - uint8_t acks[0]; /* list of ACK/NAKs */
> + uint8_t acks[]; /* list of ACK/NAKs */
> #define RXRPC_ACK_TYPE_NACK 0
> #define RXRPC_ACK_TYPE_ACK 1
>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4039 bytes --]
prev parent reply other threads:[~2023-04-21 13:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 20:57 Gustavo A. R. Silva
2023-03-07 15:46 ` Simon Horman
2023-03-20 17:39 ` Kees Cook
2023-03-30 20:15 ` Gustavo A. R. Silva
2023-04-21 13:00 ` Jeffrey E Altman [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=5f69be9f-0008-0253-0fe2-e982fd718146@auristor.com \
--to=jaltman@auristor.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=gustavoars@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome