Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp29800pxu; Tue, 24 Nov 2020 17:31:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7XHBhlWj2/7edQiepr1RzwwuzJ/juwzH1V0X3HqZf+YescUuqWWB0KavoyJR/4d+AB/9u X-Received: by 2002:a17:907:420f:: with SMTP id oh23mr1087381ejb.237.1606267882874; Tue, 24 Nov 2020 17:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606267882; cv=none; d=google.com; s=arc-20160816; b=MQJdVvwopo3T6uNT0YAEjfXDnO5bihEES7/YB4ATtlKCjOWb5Mhe3YL9tQiijOtBT6 WkoTSW8C+WLg7UtfucMI6hGmnjvMcSkdlUE+o4C1kLWv0F2MZror3ECI8ILpOj/IgCRG Mj2D5ED2U4Em9QGOkc5QcC1DVk4W4KCdI1cExn+Qm3B9jBG7MqkESdo2/fSHx9ZWyALi j5qXguEzXrQu5wOk8JFPSNbQFZ+GUAwW6WDT4aY8FA/MshMZCpgQAre851ZBbR3sHL8s Md80EHajtjjMXceuitGNnBpgJbhPXVFq4Lfmy1VbqfnJWALc7qGNjarQBaIIlglJ2f/Z VSyw== 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=0PYRq1UsZs6vh3HXuyDgAQnJyYMwqmqRAflznAJPOrA=; b=qZT5hTX1KIoDHp8QZrXHMM+viuxranieWFml2fOKKPFT694HUccdTU9XbmDXqtl5Ez R8Y1BC0XkEBi1hQQTgr+PPaQNFCthtcEvupacmZRQcYSE6iuLbJ7d4ZM2D6TS/HwkiTz sCp7gY6i4LPFbU96lCFiDe0B44ZJYVOOG1QRQOT3NZgkHlCzlO/8VrlMF0n6MNmuqaBp 7CTNLHOV0Yke5n8uIPyijzpAiX0A7T4P+FS2DPdnPsnOek5ujv2moTh61263J3/8NjOh EUjzOSLfTzY+EST6WtAhDNL1dnnVpyC/gcuRaA5KIt0LGCPQCJICPLjf4HSo3HG25ocp pOTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PE6Y2EMn; 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 a42si408287edf.129.2020.11.24.17.30.09; Tue, 24 Nov 2020 17:31:22 -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=PE6Y2EMn; 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 S1728455AbgKYB0e (ORCPT + 99 others); Tue, 24 Nov 2020 20:26:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbgKYB0e (ORCPT ); Tue, 24 Nov 2020 20:26:34 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EFA2C0613D4; Tue, 24 Nov 2020 17:26:34 -0800 (PST) Date: Wed, 25 Nov 2020 01:26:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1606267591; 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=0PYRq1UsZs6vh3HXuyDgAQnJyYMwqmqRAflznAJPOrA=; b=PE6Y2EMnayB2F3uA4+UlgWNe5bXay2GIZAxsKgGh2+upqGsZXZWBIxPAVfBtzPz3fFolUP HqYUymRweC1mi6zqLToBzjEAH3/vMrhwEqLWkTRBB/XldQMWc4CUMu3GrRsuUHlRgiPEMQ YAxNYpMuE0+sY75+iu8wBELafTWj74Kc3HyamKCJ9DRBtLgK/p6qkaYI8ancNcsHGL5kc5 umnH/hACi4TM10ePUMvgeSkA8WnUu/Ha1zaVEWwJJQ1eoDLd9lFYwvjeaTOj1hVFW/TAyu qwzAnFfwSGytOae3YFhMW33Rd185yBzIV0Ke3bm/yclZlfO5SKZ5kXwXLBLRrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1606267591; 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=0PYRq1UsZs6vh3HXuyDgAQnJyYMwqmqRAflznAJPOrA=; b=py6crgZi2TzLQX7hoLymnGIJgY0JCX76bQGWckjGbcvFejAWChHuceeINYgVDF+u/YLl6+ AGBLPwek1rk/7sDw== From: "tip-bot2 for Gabriel Krisman Bertazi" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/entry] entry: Fix boot for !CONFIG_GENERIC_ENTRY Cc: Naresh Kamboju , Jann Horn , Gabriel Krisman Bertazi , Thomas Gleixner , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <87a6v8qd9p.fsf_-_@collabora.com> References: <87a6v8qd9p.fsf_-_@collabora.com> MIME-Version: 1.0 Message-ID: <160626759088.3364.15796596877725637031.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 core/entry branch of tip: Commit-ID: 5903f61e035320104394f721f74cd22171636f63 Gitweb: https://git.kernel.org/tip/5903f61e035320104394f721f74cd22171636f63 Author: Gabriel Krisman Bertazi AuthorDate: Mon, 23 Nov 2020 10:54:58 -05:00 Committer: Thomas Gleixner CommitterDate: Wed, 25 Nov 2020 02:20:09 +01:00 entry: Fix boot for !CONFIG_GENERIC_ENTRY A copy-pasta mistake tries to set SYSCALL_WORK flags instead of TIF flags for !CONFIG_GENERIC_ENTRY. Also, add safeguards to catch this at compilation time. Fixes: 3136b93c3fb2 ("entry: Expose helpers to migrate TIF to SYSCALL_WORK flags") Reported-by: Naresh Kamboju Suggested-by: Jann Horn Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Thomas Gleixner Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/87a6v8qd9p.fsf_-_@collabora.com --- include/linux/thread_info.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 3173632..ca80a21 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -35,6 +35,7 @@ enum { GOOD_STACK, }; +#ifdef CONFIG_GENERIC_ENTRY enum syscall_work_bit { SYSCALL_WORK_BIT_SECCOMP, SYSCALL_WORK_BIT_SYSCALL_TRACEPOINT, @@ -48,6 +49,7 @@ enum syscall_work_bit { #define SYSCALL_WORK_SYSCALL_TRACE BIT(SYSCALL_WORK_BIT_SYSCALL_TRACE) #define SYSCALL_WORK_SYSCALL_EMU BIT(SYSCALL_WORK_BIT_SYSCALL_EMU) #define SYSCALL_WORK_SYSCALL_AUDIT BIT(SYSCALL_WORK_BIT_SYSCALL_AUDIT) +#endif #include @@ -129,11 +131,11 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) #else /* CONFIG_GENERIC_ENTRY */ #define set_syscall_work(fl) \ - set_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl) + set_ti_thread_flag(current_thread_info(), TIF_##fl) #define test_syscall_work(fl) \ - test_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl) + test_ti_thread_flag(current_thread_info(), TIF_##fl) #define clear_syscall_work(fl) \ - clear_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl) + clear_ti_thread_flag(current_thread_info(), TIF_##fl) #define set_task_syscall_work(t, fl) \ set_ti_thread_flag(task_thread_info(t), TIF_##fl)