Re: [PATCH] partitions: sun: calculate partition starts in sector_t

From: Jens Axboe

Date: Wed Nov 18 2026 - 11:08:26 EST



On Sun, 15 Nov 2026 00:33:47 +0800, shao.mingyin@xxxxxxxxxx wrote:
> The Sun label parser calculates sectors per cylinder and partition
> starts in unsigned long. On 32-bit systems a start above UINT_MAX
> sectors wraps before put_partition() receives it, potentially exposing
> a partition at the wrong location. The same label is parsed differently
> on a 64-bit system.
>
> Keep both values in sector_t and promote the first geometry operand
> before multiplication. This also prevents the two 16-bit geometry
> fields from being multiplied as signed int when their product exceeds
> INT_MAX.
>
> [...]

Applied, thanks!

[1/1] partitions: sun: calculate partition starts in sector_t
commit: a5be44a8243fd7f7875f54ce1c5df3df713257a9

Best regards,
--
Jens Axboe