From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992646AbcB0W3g (ORCPT ); Sat, 27 Feb 2016 17:29:36 -0500 Received: from mail.skyhub.de ([78.46.96.112]:44909 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2992585AbcB0W3g (ORCPT ); Sat, 27 Feb 2016 17:29:36 -0500 Date: Sat, 27 Feb 2016 23:29:28 +0100 From: Borislav Petkov To: Chris Bainbridge Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/microcode: Change checksum to u32 Message-ID: <20160227222928.GD5261@pd.tnic> References: <1456570907-5344-1-git-send-email-chris.bainbridge@gmail.com> <20160227175118.GC5261@pd.tnic> <20160227182329.GA4947@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160227182329.GA4947@localhost> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 27, 2016 at 06:23:29PM +0000, Chris Bainbridge wrote: > /* calculate the checksum */ > orig_sum = 0; > i = (MC_HEADER_SIZE + data_size) / DWSIZE; > while (i--) > orig_sum += ((int *)mc)[i]; Ok, since SDM says that all fields should be treated as unsigneds when doing the checksum verification, that cast above should be (u32 *) too. Also, the extended table signature should be fixed to use u32s too: ext_tablep = (int *)ext_header; i = ext_table_size / sizeof(u32); while (i--) ext_table_sum += ext_tablep[i]; ... Care to complete your patch please? Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.