Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1670303pxk; Sun, 13 Sep 2020 11:28:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwEGxYUflpewAJRInZsC7DUZiiorC0lb7/4Rse42I+x/QxTlm3swO+ZCrnF4RMTuNEYVsS X-Received: by 2002:a17:906:375a:: with SMTP id e26mr10905189ejc.552.1600021725730; Sun, 13 Sep 2020 11:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600021725; cv=none; d=google.com; s=arc-20160816; b=AovRIJm9ha1ZEFLYYDpzAHM7+PaTckmok4B0H7x9SgzQDNhYEfCnjxo9kRI/hkSQg8 kIKz/ppxlWXeDH9QUMGMMfOYuBXf1a2litrmyUbqtRmL8NlY/cN7JpIC+fbRmt/D9nGL TpwqRvlx/w+qmBAQfor9tjNgAMwx23tQyp4SjP8spNWqoaN48ZjI8m/WvFt/Hn3Wt8iI HM7S1Mq5dUcG3h7gVKTZUDuiD9/xP2ZREg1zTojGDLWqSc+5BNL99VMR1aycF8cDk4Xr GzaY4yO8gnH2xS44nP/CcBYw7xcG7ZzCK+GacmuS6UTYvu6iPaUt2PUrOe28yKRADRBW +S4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=oMJtr2JqN0kiR0GwnxtFMazq99OS4VS1oSm7b6RaJJI=; b=DxEshc7vNS7yfUXy2fAFqQB18vXK/msROEkZBmEcBKPVAEKJ66mNP0jtKwGhilO+zm Ec1UDPUK+lBF7uVdWEojpjOvm+j0XIsP7lw83sSovNZd5FWB/pDDbPn1LWIRTQgWYrro uh/fIQzDZrDJIeSTV1jXS6TXXGVwIJcXCoAGDPivdU9Q4oM+Zcv4B5FR+0fbC2TEXdot +1gQuhauKDhnQWlW4bw4uvByja2IHwIhi3nIu+12DbOpaP5396Br+WO6Vzv7tHKE02B4 usBNDffrpgWfImgSuxKLlqvOGC0apjUok9Hawa7ldBsJoONQPUeoFUYFhh9HlkaEp85c nf+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JApFJsFI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si5400710ejz.238.2020.09.13.11.28.22; Sun, 13 Sep 2020 11:28:45 -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=@linutronix.de header.s=2020 header.b=JApFJsFI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725954AbgIMS13 (ORCPT + 99 others); Sun, 13 Sep 2020 14:27:29 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:57550 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbgIMS11 (ORCPT ); Sun, 13 Sep 2020 14:27:27 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1600021644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oMJtr2JqN0kiR0GwnxtFMazq99OS4VS1oSm7b6RaJJI=; b=JApFJsFIE09rG1/wKIq7C2ldW8nsOc/YlZnAzu4PoH4i5Vg5OTQ/Qq7BDop274ufYS4FvX KzZmUMcW1rjmi4dXDRQSSD6wD9+Qe+Scdxe5wMKqyxbc1B4jl2xoqT1I+7IhZAXMbANwn2 V7hjNH8p84vVU4kWWLqlnZgGoYbktmvS4YSt9O/g+z0JUS+rpyu27zahpqJiaH2w/JYjKX 62prwzOJfBS+4DX1bqQtRtcQWFNz5wfBEkZfLl49lHFkWWWCdO18BObk+a+noXUYufIalc r08KwpToXkToo2X+gemB6+YohtIODK7oWoMMiCZ7qXIsqgPRu77CnP3h4jns3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1600021644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oMJtr2JqN0kiR0GwnxtFMazq99OS4VS1oSm7b6RaJJI=; b=javeHOqMh8camHOqoHhky7mRCIFcwAQJ4n5f0CfBB7PyTjmoQFv9Qlwb1Za3nHcZjcAdkD 0al/trQBmpGRaACw== To: Michael Ellerman , Kees Cook 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: <87d02qqfxy.fsf@mpe.ellerman.id.au> References: <87blj6ifo8.fsf@nanos.tec.linutronix.de> <87a6xzrr89.fsf@mpe.ellerman.id.au> <202009111609.61E7875B3@keescook> <87d02qqfxy.fsf@mpe.ellerman.id.au> Date: Sun, 13 Sep 2020 20:27:23 +0200 Message-ID: <87o8m98rck.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, tglx