From patchwork Sat Mar 15 05:49:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 3836581 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 3D348BF540 for ; Sat, 15 Mar 2014 07:01:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 619082034F for ; Sat, 15 Mar 2014 07:01:33 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 0B35F20295 for ; Sat, 15 Mar 2014 07:01:32 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOhUZ-0005Fr-71; Sat, 15 Mar 2014 05:50:43 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOhU9-0008S9-CO; Sat, 15 Mar 2014 05:50:17 +0000 Received: from mail-pb0-f51.google.com ([209.85.160.51]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOhTs-0008OJ-EU for linux-arm-kernel@lists.infradead.org; Sat, 15 Mar 2014 05:50:02 +0000 Received: by mail-pb0-f51.google.com with SMTP id uo5so3519685pbc.10 for ; Fri, 14 Mar 2014 22:49:39 -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=65K5S28YKSlyfuaQi3oR7OuiPUHjquwCq7U9ct0dyCI=; b=k+k0ddkC4oPh+wsZu8nYS8EezfRLSO5tt0pNsHJq0gBqEQEaSY5txr/3UZVjuF5ULL KNRDgb0k2+AG2KyDEo0qrsZjmg0Zh8GwnV/Ihpdd9n1ANZzsI+nnQ590QzFd4Tq1PfWU Wcnwn7l2AhVuzwqmrAl5TNMJPpsRC1JGSM1bJ68Xjby8xSBofr2t9y2XeIUmVLuXAsWG uxhrd+ZF8e5SYcl2Mxrs3B9ia+dD40bozy3IorCugcrq50fFYQX2JGNxYnUBM2gHFYyS WMBgFh6awVpUVA09kCMDGpsE69JzKNn4kH7Wm2Qx0h4UgDo7fg+RV0GCtYPCrenGMXzR ULPg== X-Gm-Message-State: ALoCoQleFbXJLYvAnnhUZ9LTwOoGRcMb4VIAQoYa8EpL55rEy3QxUAMnMfWSeZgQMT8y/3M2GnzT X-Received: by 10.66.227.193 with SMTP id sc1mr13358184pac.102.1394862579645; Fri, 14 Mar 2014 22:49:39 -0700 (PDT) Received: from localhost.localdomain (pdddd29.tkyoac00.ap.so-net.ne.jp. [218.221.221.41]) by mx.google.com with ESMTPSA id el14sm36061873pac.31.2014.03.14.22.49.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 22:49:38 -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_v8 2/2] arm64: audit: Add audit hook in syscall_trace_enter/exit() Date: Sat, 15 Mar 2014 14:49:08 +0900 Message-Id: <1394862548-29060-3-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394862548-29060-1-git-send-email-takahiro.akashi@linaro.org> References: <1394705767-12423-1-git-send-email-takahiro.akashi@linaro.org> <1394862548-29060-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140315_015000_612567_1173EF54 X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 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 3ee76ed..f9e1339 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(current, regs), 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));