All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Chris Bainbridge <chris.bainbridge@gmail.com>
Cc: bp@alien8.de, x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/microcode: Change checksum to u32
Date: Wed, 16 Mar 2016 11:52:26 +0100	[thread overview]
Message-ID: <20160316105226.GB21259@amd> (raw)
In-Reply-To: <1456570907-5344-1-git-send-email-chris.bainbridge@gmail.com>

Hi!

> Checksum should be unsigned 32-bit otherwise the calculation overflows
> resulting in undefined behaviour:

> @@ -49,7 +49,7 @@ int microcode_sanity_check(void *mc, int print_err)
>  	unsigned long total_size, data_size, ext_table_size;
>  	struct microcode_header_intel *mc_header = mc;
>  	struct extended_sigtable *ext_header = NULL;
> -	int sum, orig_sum, ext_sigcount = 0, i;
> +	u32 sum, orig_sum, ext_sigcount = 0, i;

Ok, but what about i and ext_sigcount?
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

      parent reply	other threads:[~2016-03-16 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-27 11:01 [PATCH] x86/microcode: Change checksum to u32 Chris Bainbridge
2016-02-27 17:51 ` Borislav Petkov
2016-02-27 18:23   ` Chris Bainbridge
2016-02-27 19:44     ` Henrique de Moraes Holschuh
2016-02-27 22:29     ` Borislav Petkov
2016-02-27 20:12   ` Henrique de Moraes Holschuh
2016-03-16 10:52 ` Pavel Machek [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=20160316105226.GB21259@amd \
    --to=pavel@ucw.cz \
    --cc=bp@alien8.de \
    --cc=chris.bainbridge@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.