From patchwork Wed Apr 30 09:57:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 4092471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 623C3BFF02 for ; Wed, 30 Apr 2014 10:01:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B7A0200F3 for ; Wed, 30 Apr 2014 10:01:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BBDE200E7 for ; Wed, 30 Apr 2014 10:01:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WfRIZ-0000zG-MR; Wed, 30 Apr 2014 09:59:31 +0000 Received: from mail-ig0-f182.google.com ([209.85.213.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WfRI7-0008TB-QS for linux-arm-kernel@lists.infradead.org; Wed, 30 Apr 2014 09:59:04 +0000 Received: by mail-ig0-f182.google.com with SMTP id l13so1396984iga.3 for ; Wed, 30 Apr 2014 02:58:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i2Jc+zaRmVcHFjo1JfymMNtCJPHekfCM/5HRvFAt8+w=; b=DRJtng78d6sa5nC6e5nHR8kdz40RYRGZlvkSKU3SQATauea+JDyxG7R2+2yMSdaz8o XGnjKj/JQkzeXT2K2+/PWPxwQNYxHKyvJXGVPzujTtTqQWfdtSXdfqHsKPto7yzZgBbk qkO71w4pzbinAda5mZVcKQO5lzOyQNS/FsFfknAaTPZ8lngt9u19+rAN6zZMocoN5MrE miIZpCzAwW2pmasmiJsNr7YqYe9Cb7Aph48ur/8O8yUEiYjcMSYzrV45GnnuikQW+hOi EOCSD6rV05vPvLA0xa98YebxSmasadO4fAhXbYL/utCrNAutLxwyvbMnHktAWZwXsnGH ANeg== X-Gm-Message-State: ALoCoQkIAJlNqt7+c+ni6ZtOLmYIGeCwW6nTbK3+iqvIw9+q4cTFWHDyv3+iS1PrNiL+MIRDJ/Yp X-Received: by 10.50.170.130 with SMTP id am2mr3199114igc.15.1398851922769; Wed, 30 Apr 2014 02:58:42 -0700 (PDT) Received: from localhost.localdomain (KD182249095136.au-net.ne.jp. [182.249.95.136]) by mx.google.com with ESMTPSA id on9sm4435618igb.11.2014.04.30.02.58.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 02:58:41 -0700 (PDT) From: AKASHI Takahiro To: viro@zeniv.linux.org.uk, eparis@redhat.com, rgb@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v9 2/2] arm64: audit: Add audit hook in syscall_trace_enter/exit() Date: Wed, 30 Apr 2014 18:57:23 +0900 Message-Id: <1398851843-16435-3-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398851843-16435-1-git-send-email-takahiro.akashi@linaro.org> References: <1394862548-29060-1-git-send-email-takahiro.akashi@linaro.org> <1398851843-16435-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140430_025904_022611_5B49F853 X-CRM114-Status: GOOD ( 10.22 ) X-Spam-Score: -0.7 (/) Cc: linaro-kernel@lists.linaro.org, AKASHI Takahiro , arndb@arndb.de, linux-kernel@vger.kernel.org, dsaxena@linaro.org, linux-audit@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds auditing functions on entry to or exit from every system call invocation. Acked-by: Richard Guy Briggs Acked-by Will Deacon Signed-off-by: AKASHI Takahiro --- arch/arm64/kernel/ptrace.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 0bf1955..0568dc9 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -19,6 +19,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include @@ -1097,11 +1099,16 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) trace_sys_enter(regs, regs->syscallno); + audit_syscall_entry(syscall_get_arch(), regs->syscallno, + regs->orig_x0, regs->regs[1], regs->regs[2], regs->regs[3]); + return regs->syscallno; } asmlinkage void syscall_trace_exit(struct pt_regs *regs) { + audit_syscall_exit(regs); + if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) trace_sys_exit(regs, regs_return_value(regs));