[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6cd7c00a-a49c-41f9-06cb-e3123bb32d6c@embeddedor.com>
Date: Tue, 9 Mar 2021 16:03:56 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: "Gustavo A. R. Silva" <gustavoars@...nel.org>,
Dave Chinner <david@...morbit.com>, linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH][next] xfs: Replace one-element arrays with flexible-array
members
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
Powered by blists - more mailing lists