Re: [PATCH] x86/microcode: Change checksum to u32

From: Pavel Machek
Date: Wed Mar 16 2016 - 06:52:35 EST


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