From patchwork Wed Oct 28 00:20:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11862265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD8ABC388F9 for ; Wed, 28 Oct 2020 00:20:45 +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 3285322281 for ; Wed, 28 Oct 2020 00:20:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ogShdpi9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="AQPWAMS6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3285322281 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+linux-arm-kernel=archiver.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:References:In-Reply-To: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:List-Owner; bh=dutoJpuEwWEt+Mg/GBTs9+1s4hieoyHNhf+SHFTu2ik=; b=ogShdpi9A/f0c5BXxUCKtQTAV ZXkm7UqowE4vmktwEdFaea5xMUCJ/+GY4kDT5KEGFUh5RDt3Rj4RMeOF7Jag2IOAvq3irRtrLrVcO p57JK8SsiNlUaFUdWX4vHw2+tw8rFySwvoB4q5xqqwmnI4FcffB1/za2tSu4192svAq4/3ZXPIaJ5 CbVpwbXYQhRpEbv3AMymlJMPRVh1H89sMPTVpv8CDa016pGeYbDZjcFbRSLIBtIWrMN/ZdpuJmEJl ZTIOc7pTRgCONuyREUUjvQbipYFqBjqTk/s+0DgaQuiy6E2dSMjxkYPkQ8aBo+feeTh9aNDScsm5d RiPqy7T9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXZCG-00077C-3S; Wed, 28 Oct 2020 00:20:12 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXZCD-00075x-88 for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 00:20:10 +0000 Received: by mail-pg1-x541.google.com with SMTP id i26so1736428pgl.5 for ; Tue, 27 Oct 2020 17:20:06 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=lIDedNlfgZ1oog3IrHLVaiNsZPdquv/snadYKp5vh58=; b=AQPWAMS61o9C2pgZgGy869tf3lXXylVcqXe+ikHWir/EyId4ku2Uf4dVFHo75eRxM0 pU70ulSbdeyn4CjKwEO9adG6Mnz4iOyxseQEmvlzHIkrnGErHk3m3EshZMBhm59jPQHD VI7t12b5AQU91NcmIRc6DBggtiuW4Fb+Gu1Ag= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=lIDedNlfgZ1oog3IrHLVaiNsZPdquv/snadYKp5vh58=; b=CHtLOtaerCvis7Syiau8fNDM/k22gmqYyg8UQI6y1zHVVWYPFM5Yqu+bP/y4xmiSsI SMaumD9a9VWEGnGcXpvNRVdptNqefHMM0U4UzBXs5NOs3+bMP0fNvAs45MZU78i7cbLA MaiEDekUxwf8Qh39tnYJuRNtWSzTvV+5mgf7xcWjzS1LHfpIMSHuF2xpoN3zKsnil7tS 0ehWkim0jcZHCof9qHhA5ERdigBwugR/Nu1feTrbqe08m7d9S2Hb7L9e9lTSBSSuO24p FwYk2C/wBhhQzO7rXt5zTGU4llnVtTrGjMr4G6VfFFqg4PUOVL1/5df9iwnmsSakD9YY oduA== X-Gm-Message-State: AOAM531A8ka22dZZVry2eQnJvOYMWDFxb3p4A8LMBnCTBByFkVPa0hbF 7sP0dnBVF3GnJ6nlpE3DvCLqGg== X-Google-Smtp-Source: ABdhPJyC5mG5Vd1iSzO7J5KCCw8uK60zFkD3M2QaSd8ZJFFK04kgCWtjeWEJlAdQcSZ2tE/Xgk1QMQ== X-Received: by 2002:a63:2021:: with SMTP id g33mr4048563pgg.5.1603844405194; Tue, 27 Oct 2020 17:20:05 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b4sm3590451pfi.208.2020.10.27.17.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 17:20:04 -0700 (PDT) From: Kees Cook To: YiFei Zhu Subject: [PATCH 2/2] arm: Enable seccomp architecture tracking Date: Tue, 27 Oct 2020 17:20:00 -0700 Message-Id: <20201028002000.2666043-3-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201028002000.2666043-1-keescook@chromium.org> References: <20201028002000.2666043-1-keescook@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_202009_330083_6DFE48C7 X-CRM114-Status: GOOD ( 17.59 ) 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: Will Drewry , Kees Cook , Catalin Marinas , linux-kernel@vger.kernel.org, Russell King , Andy Lutomirski , Will Deacon , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To enable seccomp constant action bitmaps, we need to have a static mapping to the audit architecture and system call table size. Add these for arm. Signed-off-by: Kees Cook --- arch/arm/include/asm/Kbuild | 1 - arch/arm/include/asm/seccomp.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/asm/seccomp.h diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 383635b68763..4a0848aef207 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += extable.h generic-y += flat.h generic-y += local64.h generic-y += parport.h -generic-y += seccomp.h generated-y += mach-types.h generated-y += unistd-nr.h diff --git a/arch/arm/include/asm/seccomp.h b/arch/arm/include/asm/seccomp.h new file mode 100644 index 000000000000..e9ad0f37d2ba --- /dev/null +++ b/arch/arm/include/asm/seccomp.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _ASM_SECCOMP_H +#define _ASM_SECCOMP_H + +#include + +#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARM +#define SECCOMP_ARCH_NATIVE_NR NR_syscalls +#define SECCOMP_ARCH_NATIVE_NAME "arm" + +#endif /* _ASM_SECCOMP_H */