Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751565AbcDREuv (ORCPT ); Mon, 18 Apr 2016 00:50:51 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51188 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbcDREuu (ORCPT ); Mon, 18 Apr 2016 00:50:50 -0400 Subject: Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the fast path To: Ben Hutchings , Andy Lutomirski References: <1460940317.9121.56.camel@decadent.org.uk> <20160418004731.GB3348@decadent.org.uk> Cc: X86 ML , LKML From: "H. Peter Anvin" Message-ID: <5714679B.3040806@zytor.com> Date: Sun, 17 Apr 2016 21:50:35 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160418004731.GB3348@decadent.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 593 Lines: 15 On 04/17/16 17:47, Ben Hutchings wrote: > We've always masked off the top 32 bits when x32 is enabled, but > hopefully no-one relies on that. Now that the slow path is in C, we > check all the bits there, regardless of whether x32 is enabled. Let's > make the fast path consistent with it. We have always masked off the top 32 bits *period*. We have had some bugs where we haven't, because someone has tried to "optimize" the code and they have been quite serious. The system call number is an int, which means the upper 32 bits are undefined on call entry: we HAVE to mask them. -hpa