public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: linux-block@vger.kernel.org, axboe@kernel.dk,
	linux-m68k@vger.kernel.org, geert@linux-m68k.org
Subject: Re: [PATCH v4 1/2] block: fix signed int overflow in Amiga partition support
Date: Mon, 1 Oct 2018 17:27:07 +1300	[thread overview]
Message-ID: <33091043-aa03-0d82-2997-b0974eaa6837@gmail.com> (raw)
In-Reply-To: <m2pnwvmrvp.fsf@linux-m68k.org>

Thanks Andreas,

it appears I already made the same error in v2 of this series. My bad.

I'll wait for a few more comments before respinning.

Cheers,

	Michael


Am 30.09.2018 um 19:16 schrieb Andreas Schwab:
> On Sep 30 2018, Michael Schmitz <schmitzmic@gmail.com> wrote:
>
>> @@ -100,17 +101,17 @@ int amiga_partition(struct parsed_partitions *state)
>>
>>  		/* Tell Kernel about it */
>>
>> -		nr_sects = (be32_to_cpu(pb->pb_Environment[10]) + 1 -
>> -			    be32_to_cpu(pb->pb_Environment[9])) *
>> +		nr_sects = (sector_t) ((be32_to_cpu(pb->pb_Environment[10])
>> +			   + 1 - be32_to_cpu(pb->pb_Environment[9])) *
>>  			   be32_to_cpu(pb->pb_Environment[3]) *
>>  			   be32_to_cpu(pb->pb_Environment[5]) *
>> -			   blksize;
>> +			   blksize);
>
> That doesn't fix any signed int overflow.  If you want to do calculation
> in sector_t you need to cast at least one operand to sector_t.  In this
> form the cast is useless.
>
> Andreas.
>

  reply	other threads:[~2018-10-01  4:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29 23:56 [PATCH v4 0/2] Amiga RDB partition support fixes Michael Schmitz
2018-09-29 23:56 ` [PATCH v4 1/2] block: fix signed int overflow in Amiga partition support Michael Schmitz
2018-09-30  6:16   ` Andreas Schwab
2018-10-01  4:27     ` Michael Schmitz [this message]
2018-09-29 23:56 ` [PATCH v4 2/2] block: add overflow checks for " Michael Schmitz

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=33091043-aa03-0d82-2997-b0974eaa6837@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=geert@linux-m68k.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=schwab@linux-m68k.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