Re: [PATCH v7 2/2] block: add overflow checks for Amiga partition support

Michael Schmitz
2023-06-15T01:06:18Z

Hi Finn,

[resent after it bounced from vger ...]

On 15/06/23 12:13, Finn Thain wrote:
> On Wed, 14 Jun 2023, Michael Schmitz wrote:
>
>> The reason why only rdb_SummedLongs, rdb_BlockBytes and
>> rdb_PartitionList are explicitly declared big endian is probably quite
>> simple - nothing else was used by the Linux RDB parser. My patch adds
>> rdb_CylBlocks to that list, so that ought to be changed to big endian,
>> too.
>>
>> affs_hardblocks.h is a UAPI header - what are the rules and
>> ramifications around changes to those? Might not be worth the hassle in
>> the end.
>>
> I think it's safe to fix the UAPI header if we are talking about
> endianness annotations that affect static checking and not code
> generation. The existing annotations in that struct would appear to
> support that notion, if indeed they were put there for the benefit of the
> kernel.

The annotations pre-date mainstream git history - looking at Thomas
Gleixner's full history git
(https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/), the
annotations were added by Al Viro in 2004 (commit
380768f5a50524ff7eab00d03d82a56cf2fdfe7b
<https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/include/linux/affs_hardblocks.h?id=380768f5a50524ff7eab00d03d82a56cf2fdfe7b>
there).

Al said at the time that he only annotated only those fields that are
used by the kernel, and left everything else alone even though it all
ought to be big endian.

Reason enough to now change the rdb_CylBlocks annotation.

Thanks,

Michael