From patchwork Mon Aug 28 18:15:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 13368188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31874C83F11 for ; Mon, 28 Aug 2023 18:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ooinNzLYaZWAje0mXAVUCA/u1IgnW/8/yKo0wdyhXn0=; b=QlfxuvvRjZ+AjD yOfiHDK/C4Oa7FoZ9BdaM9WdoCj2lRP2ohGTfxyxlhTpnpUY/0OLvEUAR7KAZlb2mpb/7nurmdWfK w8ZrE4jZlz6zDwkqGmt6PW8i95xT2dKktSTbnuP65WbpbQOHex8HPtWHCBKHLHNbnNJLhBgpVAg71 qWTPXP/hdv++p1T/+vyyEG+//u0c49F9hoKMxhC6w76qslDUZw48XSHklLMy+DArp8sbAw/7UIgDL +5uDaTP7bng2qplGtCEuEEM4yDJXHQqtyQpmJz98QWfASpA55VW5ZC5csIz0DfxNlZnjcx4oKB42+ TOOFce8PXE/vvbT3IlJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qagmK-00A45f-0S; Mon, 28 Aug 2023 18:15:56 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qagmG-00A451-3A for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 18:15:54 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68a3e943762so3035289b3a.1 for ; Mon, 28 Aug 2023 11:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693246550; x=1693851350; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=cjDal+ixa9ENmQiKo0p9J0ZqWbGwZzR7cpKF1PwAJAg=; b=jaekYtqeH6iaIHkJZqUEWrO3m021S2786tp9bZINlUy0z3DcplxuPhme+Am4dqt48q 3Iaz7OlMZLixvd+HNOoN3Pk+t4E19SN3T//rq415GpBr1XLHFFEj+Aec1m6MSfgYVvDp ujvSXv9rY2ZuHAJ5nZ/Cyh2aLUzyRPN8Zm0VI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693246550; x=1693851350; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cjDal+ixa9ENmQiKo0p9J0ZqWbGwZzR7cpKF1PwAJAg=; b=Ibd389LGOz2/9g1L0oVb7ZPBB7ayggtzx3RP79DV3O7SkDK7r/eOyAy0dJvsT8nyDn VMRUgbq9Ty/Zaq92bon7pS0hBW3CmXUmXWZkv/F3lsyY7mKzwfOXR+B1fnJmceXStEpM 1h82sZllHXTf6/gcqHaEmhtl28TZuZ6cdIANAC3+B5UuenDrJrSbMDjAc5KUCO5lehUq EFxB+7okaknd0e2K94DJ8n9iVKHFTA1WpWHaHEHKQm9lq3Dw9eAEGnr6f8IsbTh0fSKu QdVDQHQcKqhT90uLX1vT3P+nxDztSgMqb7nu7/GzuYUxs6SsI4T/5RFDd3bZzooKC/FC Z8+g== X-Gm-Message-State: AOJu0YyhUCaCgc/kpkeNimUH4qHsYACRDIaO38tIpOrBHUiRTz6Okl9o DHedKxrXhN23TYakgLOngASobw== X-Google-Smtp-Source: AGHT+IES+Jfux6yMWXlCYrJu23EDCfdfCQwtX0UYkSUgBR3ynEIncD4ig8c5LJ6VZlp8nNf/n8Ne8w== X-Received: by 2002:a05:6a20:1018:b0:14c:3679:a583 with SMTP id gs24-20020a056a20101800b0014c3679a583mr10012908pzc.3.1693246550033; Mon, 28 Aug 2023 11:15:50 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id t25-20020aa79399000000b0068be4ce33easm7140791pfe.96.2023.08.28.11.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 11:15:49 -0700 (PDT) Date: Mon, 28 Aug 2023 11:15:48 -0700 From: Kees Cook To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Andrei Vagin , Andy Lutomirski , Arnd Bergmann , Arnd Bergmann , Kees Cook , kernel test robot , Lecopzer Chen , linux-arm-kernel@lists.infradead.org, Oleg Nesterov , Peter Oskolkov , "Peter Zijlstra (Intel)" , Russell King , Will Drewry Subject: [GIT PULL] seccomp updates for v6.6-rc1 Message-ID: <202308281112.3C1EB9E@keescook> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_111553_040455_4EAFBE59 X-CRM114-Status: GOOD ( 14.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Linus, Please pull these seccomp updates for v6.6-rc1. These changes touch stuff that doesn't normally look like things related to seccomp (sched, perf, arm), but it is intentional. :) Each have been acked by maintainers and have been in -next for a while. Thanks! -Kees The following changes since commit fdf0eaf11452d72945af31804e2a1048ee1b574c: Linux 6.5-rc2 (2023-07-16 15:10:37 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/seccomp-v6.6-rc1 for you to fetch changes up to 46822860a5a9a5a558475d323a55c8aab0b54012: seccomp: Add missing kerndoc notations (2023-08-17 12:32:15 -0700) ---------------------------------------------------------------- seccomp updates for v6.6-rc1 - Provide USER_NOTIFY flag for synchronous mode (Andrei Vagin, Peter Oskolkov). This touches the scheduler and perf but has been Acked by Peter Zijlstra. - Fix regression in syscall skipping and restart tracing on arm32. This touches arch/arm/ but has been Acked by Arnd Bergmann. ---------------------------------------------------------------- Andrei Vagin (5): seccomp: don't use semaphore and wait_queue together sched: add a few helpers to wake up tasks on the current cpu seccomp: add the synchronous mode for seccomp_unotify selftest/seccomp: add a new test for the sync mode of seccomp_user_notify perf/benchmark: add a new benchmark for seccom_unotify Kees Cook (4): selftests/seccomp: Handle arm32 corner cases better ARM: ptrace: Restore syscall restart tracing ARM: ptrace: Restore syscall skipping for tracers seccomp: Add missing kerndoc notations Peter Oskolkov (1): sched: add WF_CURRENT_CPU and externise ttwu arch/arm/include/asm/syscall.h | 3 + arch/arm/kernel/entry-common.S | 1 + arch/arm/kernel/ptrace.c | 5 +- include/linux/completion.h | 1 + include/linux/swait.h | 2 +- include/linux/wait.h | 3 + include/uapi/linux/seccomp.h | 4 + kernel/sched/completion.c | 26 ++-- kernel/sched/core.c | 5 +- kernel/sched/fair.c | 4 + kernel/sched/sched.h | 13 +- kernel/sched/swait.c | 8 +- kernel/sched/wait.c | 5 + kernel/seccomp.c | 84 ++++++++++-- tools/arch/x86/include/uapi/asm/unistd_32.h | 3 + tools/arch/x86/include/uapi/asm/unistd_64.h | 3 + tools/perf/bench/Build | 1 + tools/perf/bench/bench.h | 1 + tools/perf/bench/sched-seccomp-notify.c | 178 ++++++++++++++++++++++++++ tools/perf/builtin-bench.c | 1 + tools/testing/selftests/seccomp/seccomp_bpf.c | 67 +++++++++- 21 files changed, 384 insertions(+), 34 deletions(-) create mode 100644 tools/perf/bench/sched-seccomp-notify.c