Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp374995pxb; Sat, 6 Mar 2021 02:47:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJylEUgTOBw9KRhGQDPQ8l1AQNpO7sVvCxwPc7L3cIvSsAgn6mGsDqTa6hRv8lUnXYAWrzN4 X-Received: by 2002:aa7:cb8e:: with SMTP id r14mr13438530edt.331.1615027661571; Sat, 06 Mar 2021 02:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615027661; cv=none; d=google.com; s=arc-20160816; b=Ne9cdngJo4knRRE8aFjQDejt1sa9+kepjK+y2cQOetwL9uUYEb+SkpwKghFPat4iLO djQVPrOXvgcUtd9uTyuWefmuDINJ3VPZvJ/S5dpkTnSBFxzInVhuE8c3j+NUT+hy4RmY Ewtb4zZH7ozqGwBgNa9tc4ZyWqcJkujkvMLhVBjbfjfKG0zTka0usx0F5mlfDmotSw49 15KMFatpf7qxKhR9cLWu7yzQsV3zrlVQ8LLx3stRii0KCsEPT82Nl7LOEEVh9Fksj4Gd czLQpYR20TOHNgMs+A61b2tVaSIRmbfARk+zXip5RieLlJN5VQjaENEdyTV/hKhnUgRL hgvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=HBTjD6zV73ekOl/oBSpZFhkXjPYcZvWFowNsPr6svwc=; b=TV3D0JGarNf3ZoPDEbw9qo9BfAPD/XeFtOq1HXHace4C88nVscy0fdKaOogejNJmBY vZ+2HP/qwUbPx31P5Q/roSc/rOgKKbGjcNVkJkiU84EBFbHCp9ghuhh7Euxy/pHMHJX+ pUhYBwR+BD/EMDvcEhqTS3JosMXzKks6YGP7zzHPZgZszFnP/m9+OtrWyTlh1L9fXySu ERjSBQKCEpmR8z+JU2/lSeWSEoBnqzzwuxZJzXjDEB2SbxtcW5PPJlHK46i8d2KMuwnP XSf9mjhi3p+BdEz0A2hIH8DI9Hy2pUiqdrUAdfczx/3BVGgunf30SDBC0lQnQDpr9hDX TyOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lVw0wa8c; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=u3NMMHs5; 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 h17si3337703edr.331.2021.03.06.02.47.18; Sat, 06 Mar 2021 02:47:41 -0800 (PST) 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=lVw0wa8c; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=u3NMMHs5; 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 S230161AbhCFKoR (ORCPT + 99 others); Sat, 6 Mar 2021 05:44:17 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:33932 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbhCFKoM (ORCPT ); Sat, 6 Mar 2021 05:44:12 -0500 Date: Sat, 06 Mar 2021 10:44:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1615027450; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HBTjD6zV73ekOl/oBSpZFhkXjPYcZvWFowNsPr6svwc=; b=lVw0wa8c37WL+uZ5qWILY/Rvzqhx/sYmMzTMMx6J7DAGYH2eJJLsEfNJXZbtCDw+QvOGJV nwep/MKrtjPyL88QGKP4LKFxlQkzJtnR8sL4DyUKGxXCuyRatcfZcjkgI0w9dcdOWaVp4d y+N2oAVnJt7qdJcsUDZqeqsdxR0FqDqqWDKErhmx6xzgemJOQUVMwA/5XNRamPoHL7XWJ4 snIxsVbjoQJplate2/OwSafx8Bd4jO+vxa01u+Sc/nVodvmp5BBEppyJ5NFudkE0yM3gg0 qDvx+7kvXj2/oVfcUMHUaO7NYNaStnjjj1pFaCYM1ZHqDYzMCDYJb8nVKHz7EQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1615027450; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HBTjD6zV73ekOl/oBSpZFhkXjPYcZvWFowNsPr6svwc=; b=u3NMMHs541HvsvOfSl2lFCNKhC+i41t/yAjf2GxhzkovSyvVkBU6O6CKE8Tyx+F80GRvCG IEpxEwmhCksBpoCQ== From: "tip-bot2 for Andy Lutomirski" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/entry: Fix entry/exit mismatch on failed fast 32-bit syscalls Cc: Andy Lutomirski , Thomas Gleixner , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <8c82296ddf803b91f8d1e5eac89e5803ba54ab0e.1614884673.git.luto@kernel.org> References: <8c82296ddf803b91f8d1e5eac89e5803ba54ab0e.1614884673.git.luto@kernel.org> MIME-Version: 1.0 Message-ID: <161502744987.398.7050665815456355997.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: e59ba7bf71a09e474198741563e0e587ae43d1c7 Gitweb: https://git.kernel.org/tip/e59ba7bf71a09e474198741563e0e587ae43d1c7 Author: Andy Lutomirski AuthorDate: Thu, 04 Mar 2021 11:05:54 -08:00 Committer: Borislav Petkov CommitterDate: Sat, 06 Mar 2021 11:37:00 +01:00 x86/entry: Fix entry/exit mismatch on failed fast 32-bit syscalls On a 32-bit fast syscall that fails to read its arguments from user memory, the kernel currently does syscall exit work but not syscall entry work. This confuses audit and ptrace. For example: $ ./tools/testing/selftests/x86/syscall_arg_fault_32 ... strace: pid 264258: entering, ptrace_syscall_info.op == 2 ... This is a minimal fix intended for ease of backporting. A more complete cleanup is coming. Fixes: 0b085e68f407 ("x86/entry: Consolidate 32/64 bit syscall entry") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/8c82296ddf803b91f8d1e5eac89e5803ba54ab0e.1614884673.git.luto@kernel.org --- arch/x86/entry/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c index a2433ae..4efd39a 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c @@ -128,7 +128,8 @@ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs) regs->ax = -EFAULT; instrumentation_end(); - syscall_exit_to_user_mode(regs); + local_irq_disable(); + irqentry_exit_to_user_mode(regs); return false; }