From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbbBXXCB (ORCPT ); Tue, 24 Feb 2015 18:02:01 -0500 Received: from terminus.zytor.com ([198.137.202.10]:35196 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbbBXXCA (ORCPT ); Tue, 24 Feb 2015 18:02:00 -0500 Message-ID: <54ED02CA.4030007@zytor.com> Date: Tue, 24 Feb 2015 15:01:30 -0800 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Andy Lutomirski CC: Denys Vlasenko , Linus Torvalds , Steven Rostedt , Ingo Molnar , Borislav Petkov , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , X86 ML , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/4] x86: entry.S: tidy up several suboptimal insns References: <1424803895-4420-1-git-send-email-dvlasenk@redhat.com> <54ED00B5.3020203@zytor.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/24/2015 02:56 PM, Andy Lutomirski wrote: > On Tue, Feb 24, 2015 at 2:52 PM, H. Peter Anvin wrote: >> On 02/24/2015 02:25 PM, Andy Lutomirski wrote: >>> On Tue, Feb 24, 2015 at 10:51 AM, Denys Vlasenko wrote: >>>> In all three 32-bit entry points, %eax is zero-extended to %rax. >>>> It is safe to do 32-bit compare when checking that syscall# >>>> is not too large. >>> >>> Applied. Thanks! >>> >> >> NAK NAK NAK NAK NAK!!!! >> >> We have already had this turn into a security issue not just once but >> TWICE, because someone decided to "optimize" the path by taking out the >> zero extend. >> >> The use of a 64-bit compare here is an intentional "belts and >> suspenders" safety issue. > > Fair enough. OK if I just undo that part of this patch? > Actually this part should have been broken up. The word "several" in the patch description is by itself a cause to NAK the patch. -hpa