From patchwork Fri Feb 7 10:10:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 3600711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2BE269F2D6 for ; Fri, 7 Feb 2014 10:13:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 677EA2012B for ; Fri, 7 Feb 2014 10:13:10 +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 78BD520120 for ; Fri, 7 Feb 2014 10:13:09 +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 1WBiPZ-0001mG-GT; Fri, 07 Feb 2014 10:11:54 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBiPI-0002PO-GH; Fri, 07 Feb 2014 10:11:36 +0000 Received: from mail-pd0-f177.google.com ([209.85.192.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBiOz-0002Jj-UX for linux-arm-kernel@lists.infradead.org; Fri, 07 Feb 2014 10:11:19 +0000 Received: by mail-pd0-f177.google.com with SMTP id x10so2919173pdj.8 for ; Fri, 07 Feb 2014 02:10:56 -0800 (PST) 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=yZqbMIPa0on558WaRrDmSucZZlppeii5R/rzjMNJwH4=; b=KyrH3Hu1LrGrtlq8sOYmUDVtccPhUojJ1vO7Xu+3M4goUCoUHlnoHsaORhKusZyhlj vLtBqBQ+KbNJ63+vFjJcHh8s6Z7eoFgOTkget2tNK0aRbBEdQVCFUvj3Xd1t8G4kSWk6 so8Jz7Qmd82JTO079P9KJOfuINhLrVtkYNz6z59/C7loccb8ppTXX1dxoT/Yn4BiQlV1 FBAt6IulGkzgeZEwhXJq9KUeSFDt7SoD1fbC7Wjkwy/RMR616xDsySneM0M/AdVxktc5 Kv8owFyDA8cznOvcbPg45WZHdiMNtxrPRT+PM5hev8nTCLxNskYYXt9AwG/a79p7J/hQ WmNg== X-Gm-Message-State: ALoCoQnypHvA24lCKo21sYrPPRveqeyBOXj0TTPMAl4IFgKdX6iaAqhYvvjt80EzTuCnfuz2nd4v X-Received: by 10.68.234.230 with SMTP id uh6mr18709291pbc.161.1391767856272; Fri, 07 Feb 2014 02:10:56 -0800 (PST) Received: from localhost.localdomain (KD182249085115.au-net.ne.jp. [182.249.85.115]) by mx.google.com with ESMTPSA id oa3sm12004141pbb.15.2014.02.07.02.10.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:10:55 -0800 (PST) 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 v4 3/3] arm64: audit: Add audit hook in ptrace/syscall_trace Date: Fri, 7 Feb 2014 19:10:03 +0900 Message-Id: <1391767803-5350-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391767803-5350-1-git-send-email-takahiro.akashi@linaro.org> References: <1391410590-4884-1-git-send-email-takahiro.akashi@linaro.org> <1391767803-5350-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140207_051118_127165_F65614C7 X-CRM114-Status: GOOD ( 10.49 ) X-Spam-Score: -1.9 (-) Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, arndb@arndb.de, linux-kernel@vger.kernel.org, AKASHI Takahiro , 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.7 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, 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. 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 64ce39f..8cdba09 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 @@ -38,6 +39,7 @@ #include #include #include +#include #include #include @@ -1076,10 +1078,15 @@ asmlinkage int syscall_trace(int dir, struct pt_regs *regs) } if (dir) { + audit_syscall_exit(regs); tracehook_report_syscall_exit(regs, 0); } else { if (tracehook_report_syscall_entry(regs)) regs->syscallno = ~0UL; + audit_syscall_entry(syscall_get_arch(current, regs), + (int)regs->syscallno, + regs->orig_x0, regs->regs[1], + regs->regs[2], regs->regs[3]); } if (is_compat_task())