linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v11 0/3] Amiga RDB partition support fixes
@ 2023-06-16  1:19 Michael Schmitz
  2023-06-16  1:19 ` [PATCH v11 1/3] block: fix signed int overflow in Amiga partition support Michael Schmitz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michael Schmitz @ 2023-06-16  1:19 UTC (permalink / raw)
  To: linux-block, axboe
  Cc: linux-m68k, geert, hch, martin, fthain, Michael Schmitz

Hi Jens,

Following up on Martin's enquiry, I am resubmitting the Amiga
partition support fixes again as v11, with changes addressing
your comments on v8, and a fix for warnings I saw from sparse
checking on v8 and v9. 

The simple fix (patch 1) still leaves ample room for overflows in
calculating start address and size of a RDB partition, though
such overflows should only be seen in rather unusual cases.

To address these potential overflows, checks are added in the
third patch of this series. Comments by Geert have been
addressed in full. 

In order to avoid warnings about a cast to a restricted
type (__be32, inside be32_to_cpu()) introduced by the third
patch, the second patch changes the annotation of all __u32
fields to __be32 (which is what these fields in the RDB
struct ought to have been in the first instance). 

Reviewed-by tags by Geert and Christoph added. Fixes and
prerequisites for stable backport also added. 

Patch 2 has been initially reviewed by Christoph and Geert
(but no Reviewed-by tags have been added). In my humble
opinion, patch 1 can be applied while we wait for further
review, as it does mostly fix this long standing bug (at
least when LBD is enabled). 

Only change in this version is to change all __u32 in the
affs_hardblocks.h header, not just the one that caused
the sparse warning.

Cheers,

        Michael

Michael Schmitz (3):
  block: fix signed int overflow in Amiga partition support
  block: change annotation of rdb_CylBlocks in affs_hardblocks.h
  block: add overflow checks for Amiga partition support

 block/partitions/amiga.c             | 102 ++++++++++++++++++++++-----
 include/uapi/linux/affs_hardblocks.h |  64 ++++++++---------
 2 files changed, 117 insertions(+), 49 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-16  5:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16  1:19 [PATCH v11 0/3] Amiga RDB partition support fixes Michael Schmitz
2023-06-16  1:19 ` [PATCH v11 1/3] block: fix signed int overflow in Amiga partition support Michael Schmitz
2023-06-16  1:19 ` [PATCH v11 2/3] block: change annotation of rdb_CylBlocks in affs_hardblocks.h Michael Schmitz
2023-06-16  5:49   ` Christoph Hellwig
2023-06-16  1:19 ` [PATCH v11 3/3] block: add overflow checks for Amiga partition support Michael Schmitz

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).