From patchwork Tue Nov 18 01:10:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 40983 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1950924035 for ; Tue, 18 Nov 2014 01:11:59 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf12088055lbg.9 for ; Mon, 17 Nov 2014 17:11:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=tI9UjmG0ceaF7wtzgDWWSnh7VEzVW0zhsViIbC9rYno=; b=GLUgy1Q1n19IkB1/341ln4sUnLwSsAgvsmkDUNQSV8znBVVQ0JPnhMesMXYbvfdAu0 T8ioODgsugB85g01dMtA56zLnJgMcvbpKuTicljE242b6QljBG5rm6xcKrMMm+T+rQvC XBWrhMuGOUXL6tprfhiClHKt61iIPeSXx1NTLw70qO+lkYYjQ9A0xmdOuA5OcaXzt9l6 Ak7bQ4AV5gGyXkkj8qILmYqWolXivGaWprYe+FYaOBAsdEXHrXuR5rY9VtHtgez+m3mW nVkg6+bxiomoXJp+TscQkCAiG/NHJ8g+uzmqwWqoBH6fQvjLQUGPyAgfVEKcF9+d0aRJ E86g== X-Gm-Message-State: ALoCoQkzENVawZgiD6fjZDb8mpmx+gVNbCFkLcnHPrbX82KGRR+8UkVbTkC4goP0ScGwmcPZ8REH X-Received: by 10.112.154.194 with SMTP id vq2mr1150618lbb.10.1416273118015; Mon, 17 Nov 2014 17:11:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.98 with SMTP id lb2ls762995lab.81.gmail; Mon, 17 Nov 2014 17:11:57 -0800 (PST) X-Received: by 10.112.135.197 with SMTP id pu5mr31805394lbb.22.1416273117548; Mon, 17 Nov 2014 17:11:57 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id uf7si38490043lac.99.2014.11.17.17.11.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 17:11:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so311174lab.22 for ; Mon, 17 Nov 2014 17:11:56 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr31691637lad.44.1416273116754; Mon, 17 Nov 2014 17:11:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp1256963lbc; Mon, 17 Nov 2014 17:11:55 -0800 (PST) X-Received: by 10.70.43.229 with SMTP id z5mr33215757pdl.25.1416273114493; Mon, 17 Nov 2014 17:11:54 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si36601944pdr.161.2014.11.17.17.11.53 for ; Mon, 17 Nov 2014 17:11:54 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753692AbaKRBLv (ORCPT + 26 others); Mon, 17 Nov 2014 20:11:51 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:37145 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753658AbaKRBLs (ORCPT ); Mon, 17 Nov 2014 20:11:48 -0500 Received: by mail-pa0-f41.google.com with SMTP id rd3so8868118pab.0 for ; Mon, 17 Nov 2014 17:11:48 -0800 (PST) X-Received: by 10.66.90.161 with SMTP id bx1mr14489536pab.35.1416273108387; Mon, 17 Nov 2014 17:11:48 -0800 (PST) Received: from localhost.localdomain (KD182249087116.au-net.ne.jp. [182.249.87.116]) by mx.google.com with ESMTPSA id cf12sm36225005pdb.77.2014.11.17.17.11.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Nov 2014 17:11:47 -0800 (PST) From: AKASHI Takahiro To: keescook@chromium.org, catalin.marinas@arm.com, will.deacon@arm.com Cc: dsaxena@linaro.org, arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, AKASHI Takahiro Subject: [PATCH v8 3/6] asm-generic: add generic seccomp.h for secure computing mode 1 Date: Tue, 18 Nov 2014 10:10:35 +0900 Message-Id: <1416273038-15590-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416273038-15590-1-git-send-email-takahiro.akashi@linaro.org> References: <1416273038-15590-1-git-send-email-takahiro.akashi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Those values (__NR_seccomp_*) are used solely in secure_computing() to identify mode 1 system calls. If compat system calls have different syscall numbers, asm/seccomp.h may override them. Acked-by: Arnd Bergmann Reviewed-by: Kees Cook Signed-off-by: AKASHI Takahiro --- include/asm-generic/seccomp.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/asm-generic/seccomp.h diff --git a/include/asm-generic/seccomp.h b/include/asm-generic/seccomp.h new file mode 100644 index 0000000..9fa1f65 --- /dev/null +++ b/include/asm-generic/seccomp.h @@ -0,0 +1,30 @@ +/* + * include/asm-generic/seccomp.h + * + * Copyright (C) 2014 Linaro Limited + * Author: AKASHI Takahiro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef _ASM_GENERIC_SECCOMP_H +#define _ASM_GENERIC_SECCOMP_H + +#include + +#if defined(CONFIG_COMPAT) && !defined(__NR_seccomp_read_32) +#define __NR_seccomp_read_32 __NR_read +#define __NR_seccomp_write_32 __NR_write +#define __NR_seccomp_exit_32 __NR_exit +#define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn +#endif /* CONFIG_COMPAT && ! already defined */ + +#define __NR_seccomp_read __NR_read +#define __NR_seccomp_write __NR_write +#define __NR_seccomp_exit __NR_exit +#ifndef __NR_seccomp_sigreturn +#define __NR_seccomp_sigreturn __NR_rt_sigreturn +#endif + +#endif /* _ASM_GENERIC_SECCOMP_H */