Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbbDGJZb (ORCPT ); Tue, 7 Apr 2015 05:25:31 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:41318 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751122AbbDGJZ0 (ORCPT ); Tue, 7 Apr 2015 05:25:26 -0400 Date: Tue, 7 Apr 2015 11:27:08 +0200 From: Quentin Casasnovas To: Borislav Petkov Cc: Ingo Molnar , Quentin Casasnovas , X86 ML , LKML , "H. Peter Anvin" , Thomas Gleixner , Oleg Nesterov , Andy Lutomirski Subject: Re: [PATCH] x86/alternatives: Fix ALTERNATIVE_2 padding generation properly Message-ID: <20150407092708.GA25397@chrystal.uk.oracle.com> References: <20150403173306.GG14902@chrystal.uk.oracle.com> <20150403174824.GL3418@pd.tnic> <20150403204217.GH14902@chrystal.uk.oracle.com> <20150404073454.GA21152@pd.tnic> <20150404083611.GA5922@chrystal.uk.oracle.com> <20150404092536.GB21152@pd.tnic> <20150404101155.GB5922@chrystal.uk.oracle.com> <20150404102922.GC21152@pd.tnic> <20150404133243.GD21152@pd.tnic> <20150404133443.GE21152@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150404133443.GE21152@pd.tnic> User-Agent: Mutt/1.5.22 (2013-10-16) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 709 Lines: 19 On Sat, Apr 04, 2015 at 03:34:43PM +0200, Borislav Petkov wrote: > From: Borislav Petkov > > Quentin caught a corner case with the generation of instruction padding > in the ALTERNATIVE_2 macro: if len(orig_insn) < len(alt1) < len(alt2), > then not enough padding gets added and that is not good(tm) as we could > overwrite the beginning of the next instruction. > FWIW, this patch looks good to me (I have not tested it though). Thanks! Quentin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/