From: Michael Schmitz <schmitzmic@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH 5.4.y] block: add overflow checks for Amiga partition support
Date: Tue, 18 Jul 2023 10:17:29 +1200 [thread overview]
Message-ID: <f0fd6bda-7b63-ac47-a1db-4eed0164f0e3@gmail.com> (raw)
In-Reply-To: <cbdb7cde68dc4d239861a631436dc01d@AcuMS.aculab.com>
Hi David,
On 17/07/23 20:00, David Laight wrote:
> From: Michael Schmitz
>> Sent: 16 July 2023 00:27
>>
>> The Amiga partition parser module uses signed int for partition sector
>> address and count, which will overflow for disks larger than 1 TB.
>>
>> Use u64 as type for sector address and size to allow using disks up to
>> 2 TB without LBD support, and disks larger than 2 TB with LBD. The RBD
>> format allows to specify disk sizes up to 2^128 bytes (though native
>> OS limitations reduce this somewhat, to max 2^68 bytes),
> Pretty much everything (including the mass of an proton) stops
> you having a disk with anywhere near 2^64 bytes in it.
I put my hopes on all that dark matter we still seem to be missing then.
Seriously though - RDB allows for this size, no matter how unlikely.
2^32 heads or 2^32 sectors per track would have been seen as impossible
when RDB was designed. On the other hand, the '16 bit address space
ought to be enough for everybody' was probably still fresh in the mind
of the Amiga developers at that time.
All that matters is that we get the size calculations right (and then
let the partition core enforce the known disk size limit).
Cheers,
Michael
>
> David
>
>> so check for
>> u64 overflow carefully to protect against overflowing sector_t.
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
prev parent reply other threads:[~2023-07-17 22:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 20:30 FAILED: patch "[PATCH] block: add overflow checks for Amiga partition support" failed to apply to 5.4-stable tree gregkh
2023-07-15 23:26 ` [PATCH 5.4.y] block: add overflow checks for Amiga partition support Michael Schmitz
2023-07-17 8:00 ` David Laight
2023-07-17 22:17 ` Michael Schmitz [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=f0fd6bda-7b63-ac47-a1db-4eed0164f0e3@gmail.com \
--to=schmitzmic@gmail.com \
--cc=David.Laight@ACULAB.COM \
--cc=axboe@kernel.dk \
--cc=stable@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