linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Dave Chinner <david@fromorbit.com>,
	linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] xfs: Replace one-element arrays with flexible-array members
Date: Tue, 9 Mar 2021 16:03:56 -0600	[thread overview]
Message-ID: <6cd7c00a-a49c-41f9-06cb-e3123bb32d6c@embeddedor.com> (raw)
In-Reply-To: <20210309212643.GZ3419940@magnolia>



On 3/9/21 15:26, Darrick J. Wong wrote:
>>> It seems to work all right for casted NULL pointers, and then we get all
>>> the typechecking and multiplication overflow checking, e.g.:
>>>
>>> 	size_t len64 = struct_size((struct xfs_efi_log_format_32 *)NULL,
>>> 				efi_extents src_efi_fmt->efi_nextents);
>> Yeah; in that case, what do you think about casting 0, instead of NULL:
>>
>>        uint len32 = struct_size((xfs_efi_log_format_32_t *)0, efi_extents,
>>                                 src_efi_fmt->efi_nextents);
>>        uint len64 = struct_size((xfs_efi_log_format_64_t *)0, efi_extents,
>>                                 src_efi_fmt->efi_nextents);
> I don't have a preference either way, either here or for the half-dozen
> more of these scattered elsewhere in the file.

OK. I'll send v2, shortly

Thanks for the feedback!
--
Gustavo

  reply	other threads:[~2021-03-09 22:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 15:05 [PATCH][next] xfs: Replace one-element arrays with flexible-array members Gustavo A. R. Silva
2021-03-09 17:42 ` Darrick J. Wong
2021-03-09 19:57   ` Gustavo A. R. Silva
2021-03-09 21:26     ` Darrick J. Wong
2021-03-09 22:03       ` Gustavo A. R. Silva [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-02-03  1:24 Gustavo A. R. Silva
2023-02-03 17:53 ` Kees Cook
2023-02-06 19:17   ` Gustavo A. R. Silva
2023-02-03 21:32 ` Darrick J. Wong
2023-02-05 22:51 ` Dave Chinner
2023-02-06  0:21   ` Gustavo A. R. Silva

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=6cd7c00a-a49c-41f9-06cb-e3123bb32d6c@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=gustavoars@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@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;
as well as URLs for NNTP newsgroup(s).