Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp24154pxk; Wed, 16 Sep 2020 17:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOU+sDBoE3WQ8VfE+Ep55ieFpVsaHHnzUrw2LNdaTKpb8ISEl4qJ6rDHczHMfpjljuU4g/ X-Received: by 2002:a17:906:8246:: with SMTP id f6mr16245747ejx.296.1600303802354; Wed, 16 Sep 2020 17:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600303802; cv=none; d=google.com; s=arc-20160816; b=iz3beE/jCcTSL+e3Fs+b9LB83Yob1DuIencO30X1UlSErXv8/pYrpZ2na9QGQ9WfY7 JoZqmo9CnTGb2P/gU34h/CK9fC4U3N/QdUiuQ9yOE8x991F9vFfwguBthWqnVX/v4eHl cM5ITNfYykGdveMN79Vx28Sf6ARpjfheZmxepucn3R1oF+FWjkzMksb/Rc2JhcHs6kyB K3rv608aWFLyVX2LWalbH2dFRcY3KMPk6RHr75tBx90VTX/3edl94osA1m4GdBE1DU+R 8kRbbb6pqh59XYWDJxU+SiQZfA76tp4vpGynJO1tHxcXw29AELPoE7tMnnYi/X7WAjKE WhJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=7KfhcbfBGCtl3BVwtvL0/LxKo1dseCJYWczLy4iPdbI=; b=jaaHKaCS+1a7qa04NCCgg/U03Ih/ktbwQCfdZjIwduJA0zhgXFd7RxlVaKDKQiOI+a V6sURh7REY2ojU5V9jwgDdbtzJ/G80qk6QNNNovkqgGcvxEP67yAvnx4PlIBVvWeYKbi 7S5Y2b221Hc68JAEALvtZOEd2M3yGaFryYmhnmOFxDUXOzK0jyr5yCwmgrh96ncMBdRa DpYN2JuNNu+jOZVRGB9IqojBRhv89RGdickGbD0x910uAtdk5BXD9YjUP/14Jxjno3Ey 42VdLL6hVVFFFn/Qw8PV9t1vL0z6MJUCIHMjoVjl6ku5TsTdHs/6q41EGgQ9lW1DNhnA Uwzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=WtHyNl5R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si12759886ejs.259.2020.09.16.17.49.39; Wed, 16 Sep 2020 17:50:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=WtHyNl5R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726255AbgIQAsT (ORCPT + 99 others); Wed, 16 Sep 2020 20:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbgIQAsJ (ORCPT ); Wed, 16 Sep 2020 20:48:09 -0400 X-Greylist: delayed 488 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Sep 2020 20:48:00 EDT Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C3CCC061352; Wed, 16 Sep 2020 17:39:52 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BsJ5G6swKzB3yN; Thu, 17 Sep 2020 10:39:46 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1600303188; bh=COHpZK0BD0VqQ7amRyqQpQAYRPxhUDHH36Dg3xKyUzE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WtHyNl5RuVAVzBUi6IiSpYd32cWlj/8QiYwHDQkzF5qZ5lH+RSRxUrqR0jJQRNyIB dd+YPElX28UKWhi0pmBGjBXTiZJ7YYjbFN2MBhDFCciTSOUKrmQqbxiLUnjKh7DvgN i6InX4eNbxk9T6r7TkPxK7VSNrEkPvRSBVAHon5vxyAS8kiOBEMFoU+tQ0b3YHfl7S s3hH28Hm82++uC/v9pTrbcKb96vSqVf1I63KROvk1egNk1a8pCET65h3YcuEKSL4AB N/juH6rjcy5WGx/7h/q8qeCjkB68++E1Jc9hNYP9k8OwNI1eqMG89Dm9xYpSNJyzgu aFozBTXoBW4zw== From: Michael Ellerman To: Kees Cook , Thomas Gleixner Cc: Robert O'Callahan , LKML , "maintainer\:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , linux-arch@vger.kernel.org, Will Deacon , Arnd Bergmann , Mark Rutland , Keno Fischer , Paolo Bonzini , kvm list , Gabriel Krisman Bertazi , Sean Christopherson , Kyle Huey Subject: Re: [REGRESSION] x86/entry: Tracer no longer has opportunity to change the syscall number at entry via orig_ax In-Reply-To: <202009141303.08B39E5783@keescook> References: <87blj6ifo8.fsf@nanos.tec.linutronix.de> <87a6xzrr89.fsf@mpe.ellerman.id.au> <202009111609.61E7875B3@keescook> <87d02qqfxy.fsf@mpe.ellerman.id.au> <87o8m98rck.fsf@nanos.tec.linutronix.de> <202009141303.08B39E5783@keescook> Date: Thu, 17 Sep 2020 10:39:40 +1000 Message-ID: <875z8dp777.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kees Cook writes: > On Sun, Sep 13, 2020 at 08:27:23PM +0200, Thomas Gleixner wrote: >> On Sun, Sep 13 2020 at 17:44, Michael Ellerman wrote: >> > Kees Cook writes: >> > diff --git a/kernel/entry/common.c b/kernel/entry/common.c >> > index 18683598edbc..901361e2f8ea 100644 >> > --- a/kernel/entry/common.c >> > +++ b/kernel/entry/common.c >> > @@ -60,13 +60,15 @@ static long syscall_trace_enter(struct pt_regs *regs, long syscall, >> > return ret; >> > } >> > >> > + syscall = syscall_get_nr(current, regs); >> > + >> > if (unlikely(ti_work & _TIF_SYSCALL_TRACEPOINT)) >> > trace_sys_enter(regs, syscall); >> > >> > syscall_enter_audit(regs, syscall); >> > >> > /* The above might have changed the syscall number */ >> > - return ret ? : syscall_get_nr(current, regs); >> > + return ret ? : syscall; >> > } >> >> Yup, this looks right. Can you please send a proper patch? > > I already did on Friday: > https://lore.kernel.org/lkml/20200912005826.586171-1-keescook@chromium.org/ Thanks. cheers