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: 24281 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E82922096A for ; Fri, 7 Feb 2014 10:10:58 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf13247353obc.11 for ; Fri, 07 Feb 2014 02:10: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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=yZqbMIPa0on558WaRrDmSucZZlppeii5R/rzjMNJwH4=; b=H4uB9m3kG04z3kouzwISKGcvr80D8RREjhEZNGXm7W74r94vpgdgo+bMZQH7R1Vwl3 rmm/2GvAShPnx6mF5e5BKeN1rPMUZZrhyM3dGj8ta9mMSXaY7O9BJbWYwGZb4NFphImC yBr2WeXOjmL/SXXRA2ivYLJ17re7x5fwhKXiR4G/rEBop4KkZRnkTec68aPDi+b7oTI4 ZEmVyroawC5rtwzZf16TdfkxrEDfWweJOhfKHWaj1EIImBLNeoIRKVu6I43KvHxjGecE KSb950R4pnOk80Jt7m2ugAX3HDQHxtsUmzP4j4HdvFpa13Voqhnaa7dgwdJgJmy11JrM mPDw== X-Gm-Message-State: ALoCoQmf1mBS+oBzxsOGCO/ftWnWa7cf3OvWQueBe66l5gqC2BMyogisU61zWNFMN4WVlxX9jbk5 X-Received: by 10.182.104.200 with SMTP id gg8mr5782919obb.45.1391767858015; Fri, 07 Feb 2014 02:10:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.98 with SMTP id j89ls1029040qga.73.gmail; Fri, 07 Feb 2014 02:10:57 -0800 (PST) X-Received: by 10.52.106.107 with SMTP id gt11mr8210929vdb.7.1391767857948; Fri, 07 Feb 2014 02:10:57 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id n8si1157870vdv.81.2014.02.07.02.10.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:10:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id id10so2507273vcb.27 for ; Fri, 07 Feb 2014 02:10:57 -0800 (PST) X-Received: by 10.52.30.167 with SMTP id t7mr4323386vdh.36.1391767857828; Fri, 07 Feb 2014 02:10:57 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp91054vcz; Fri, 7 Feb 2014 02:10:57 -0800 (PST) X-Received: by 10.68.164.4 with SMTP id ym4mr18871338pbb.53.1391767856671; Fri, 07 Feb 2014 02:10:56 -0800 (PST) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id ds4si4493516pbb.49.2014.02.07.02.10.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:10:56 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.220.43; Received: by mail-pa0-f43.google.com with SMTP id rd3so2993522pab.2 for ; Fri, 07 Feb 2014 02:10:56 -0800 (PST) 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 Cc: arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, patches@linaro.org, AKASHI Takahiro 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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())