From patchwork Sat Sep 19 08:06:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11786733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD93359D for ; Sat, 19 Sep 2020 08:08:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B34921481 for ; Sat, 19 Sep 2020 08:08:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Efth6RSe"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VliAdCAK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B34921481 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: 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=viNu4UCwCVLfuhPiKyVP45KTz3piFYYPkmoa/cgtq7E=; b=Efth6RSeCSx9yDMn5gmOR2PjpX yZwwc/Pb4OvhuwozwFydfRNJmOIdKhlYxHUZIC/6TcEzqcTHPaLx5u2PcnubX0LqsMLfnZf7Pxix7 v/xutXI9AGtuP72DU8H9L5C/Bhtu0Cc2N2Zha/n+4aeY06riMG5FJIiY1ZaHaszdnrc5iIy40YfUD CK2DyrEC2KDqWmI4/WbouwaNYGmSKjoyxUGl3mAVXH9GSmOpO5kjdlGQiUs034VYn3qgzKTFvPt1L MMMBHoMayPyEdFaRhfYwfFESQ/uN0HeGufQSisDGHDTU5QOzZxDzwsnAxduEkRA5YbVZHnpLhSHAT 71A37obQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJXtT-0005ya-Fh; Sat, 19 Sep 2020 08:06:51 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJXtQ-0005xT-CE for linux-arm-kernel@lists.infradead.org; Sat, 19 Sep 2020 08:06:49 +0000 Received: by mail-pf1-x441.google.com with SMTP id z19so4959286pfn.8 for ; Sat, 19 Sep 2020 01:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9iH7lg3YkHOWr7NTqH/dXox+CFNwDp9U5uBDltp9opg=; b=VliAdCAKA8262/f1rFGSxP8xylGXaZO4FcA+nCHPcdNqzcUPuWcsjFUnaLb/PJdGDc 77LDfBN6skG3zcIHXXKVxcVAm5eMB9le2+2lsMUje1wbpOCIZh2A4ZLSie9ILwBOpC9K 4vvx0i4xKcWt+EOoZlwSsPar86nskR8syAyuE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9iH7lg3YkHOWr7NTqH/dXox+CFNwDp9U5uBDltp9opg=; b=o+HXWkrPIZkyTZFsSjVfmJQ/8PtUt9M6LJjaIEoDNPDn9Nl+enQFGCnhEmqs22GGsZ 7MIua2MZNitTjLgB2as4gr82Ou/dLW3VeGmjyTla/dK10e9aZtgs3rXzNGWV5+vt8gMv tRAl0lQ8GQ6ElSQlJU1HYjhsJCyuBKoJrk57P3TIt+ltrFNhm6IXWb2xZK7xBPpZZvSz q6HMKG2eo1MC27DWZrG3KtWkAdr5ijz+zEhRFjNE2M5oPRoZRNnTBW6PVqpbKGxl8HVP z+UUWHJUzqr3IcjF6GNE8SKQBJeQWDkd4apaVamAp5Lkt2pW/0Yk5FovwoV9fXoR36qB MWaA== X-Gm-Message-State: AOAM530Q5n4CwFlUGp0N306VMdjaTdRBf5nt5WJqMbUONLHxVISM3RST SnNA8IgxkNaf6AANRRYr1RRhyA== X-Google-Smtp-Source: ABdhPJxqwI/NRVwSlA1Y4+c6UzNBZYDGK/U+ZUNMSqUez01WLw6CEsVrOzXeoFKh2YifcS+xdf+aPg== X-Received: by 2002:aa7:87da:0:b029:13c:1611:66bf with SMTP id i26-20020aa787da0000b029013c161166bfmr35672458pfo.10.1600502806153; Sat, 19 Sep 2020 01:06:46 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id gj6sm4896682pjb.10.2020.09.19.01.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 01:06:45 -0700 (PDT) From: Kees Cook To: linux-kernel@vger.kernel.org Subject: [PATCH v2 0/4] selftests/seccomp: Refactor change_syscall() Date: Sat, 19 Sep 2020 01:06:33 -0700 Message-Id: <20200919080637.259478-1-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_040648_446709_02392949 X-CRM114-Status: GOOD ( 11.28 ) X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -3.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thadeu Lima de Souza Cascardo , Will Drewry , Kees Cook , linux-xtensa@linux-xtensa.org, Michael Ellerman , linux-mips@vger.kernel.org, Andy Lutomirski , Max Filippov , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Christian Brauner Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org v1: https://lore.kernel.org/lkml/20200912110820.597135-1-keescook@chromium.org v2: - Took Acked patches into -next - refactored powerpc syscall setting implementation - refactored clone3 args implementation Hi, This finishes the refactoring of the seccomp selftest logic used in for ptrace syscall number/return handling for powerpc. Additionally fixes clone3 (which seccomp depends on for testing) to run under MIPS where an old struct clone_args has become visible. (FWIW, I expect to take these via the seccomp tree.) Thanks, Kees Cook (4): selftests/seccomp: Record syscall during ptrace entry selftests/seccomp: Allow syscall nr and ret value to be set separately selftests/seccomp: powerpc: Set syscall return during ptrace syscall exit selftests/clone3: Avoid OS-defined clone_args tools/testing/selftests/clone3/clone3.c | 45 +++---- .../clone3/clone3_cap_checkpoint_restore.c | 4 +- .../selftests/clone3/clone3_clear_sighand.c | 2 +- .../selftests/clone3/clone3_selftests.h | 24 ++-- .../testing/selftests/clone3/clone3_set_tid.c | 4 +- tools/testing/selftests/seccomp/seccomp_bpf.c | 120 ++++++++++++++---- 6 files changed, 131 insertions(+), 68 deletions(-)