From patchwork Thu Mar 13 10:16:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 26192 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0990720A66 for ; Thu, 13 Mar 2014 10:16:53 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf1822162pdb.9 for ; Thu, 13 Mar 2014 03:16:53 -0700 (PDT) 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=VPN7VRsTO9hE3c95X40VxI3Ka/K7mNZfdy8tvC4MLAc=; b=S3hXsbBNA0wk/Qtx+azTmEvzVLDNMWRzvFovO1l8s4jAbBLnkY7hlFu+XLIj4q35vp IL1q+C+wyzhTzUFaG0wBvKzIqSEHCq1nn6F+vIcqrI6o0QWoYkGSD7L3HPbuHFjgDWgP pFhfH5lY0KnIKs7VNfAPY2wy++EMBaD6YUbL6Pkyn4OhU/n01Ms+XM3n0+PcPnkIVWVR A3MGpZLk7ABOQ0VCc4DSjmjuL8wcjmddMObdeH2LOkysSHM2L0GL5sVXmE9ZWVwKxe4B 4n19mt7F6u+FWrsdm4VssxmwzGRdVDyjZeHDtTRc/wFvgRILeBjdZllhy7zIjvInlvhc dyFA== X-Gm-Message-State: ALoCoQlxHZ7Zelq3n2nS4tuKSe7HdlbJB06SInfElPlQoak/gAMYiSpeTlXlW7RVBPK8mhuIz3U7 X-Received: by 10.66.65.109 with SMTP id w13mr387983pas.21.1394705813269; Thu, 13 Mar 2014 03:16:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls203581qgc.56.gmail; Thu, 13 Mar 2014 03:16:53 -0700 (PDT) X-Received: by 10.58.123.70 with SMTP id ly6mr723598veb.26.1394705813120; Thu, 13 Mar 2014 03:16:53 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id wt4si606086vcb.115.2014.03.13.03.16.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 03:16:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id if17so817826vcb.8 for ; Thu, 13 Mar 2014 03:16:53 -0700 (PDT) X-Received: by 10.220.12.140 with SMTP id x12mr694517vcx.19.1394705813032; Thu, 13 Mar 2014 03:16:53 -0700 (PDT) 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.220.78.9 with SMTP id i9csp356009vck; Thu, 13 Mar 2014 03:16:52 -0700 (PDT) X-Received: by 10.68.178.131 with SMTP id cy3mr1283640pbc.146.1394705812177; Thu, 13 Mar 2014 03:16:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zo6si1827488pbc.103.2014.03.13.03.16.51; Thu, 13 Mar 2014 03:16:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754229AbaCMKQm (ORCPT + 26 others); Thu, 13 Mar 2014 06:16:42 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:43625 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753543AbaCMKQi (ORCPT ); Thu, 13 Mar 2014 06:16:38 -0400 Received: by mail-pa0-f41.google.com with SMTP id fa1so916037pad.0 for ; Thu, 13 Mar 2014 03:16:38 -0700 (PDT) X-Received: by 10.66.136.103 with SMTP id pz7mr1283567pab.140.1394705798274; Thu, 13 Mar 2014 03:16:38 -0700 (PDT) Received: from localhost.localdomain (KD182249091179.au-net.ne.jp. [182.249.91.179]) by mx.google.com with ESMTPSA id pi1sm7591558pac.14.2014.03.13.03.16.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 03:16:36 -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 Cc: dsaxena@linaro.org, arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, AKASHI Takahiro Subject: [PATCH v7 2/2] arm64: audit: Add audit hook in syscall_trace_enter/exit() Date: Thu, 13 Mar 2014 19:16:07 +0900 Message-Id: <1394705767-12423-3-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394705767-12423-1-git-send-email-takahiro.akashi@linaro.org> References: <1393564635-3921-1-git-send-email-takahiro.akashi@linaro.org> <1394705767-12423-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=neutral (google.com: 209.85.220.177 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 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: , 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 Acked-by: Will Deacon --- 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 9c52b3e..d10c637 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 @@ -1091,6 +1093,9 @@ 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; } @@ -1098,6 +1103,8 @@ asmlinkage void syscall_trace_exit(struct pt_regs *regs) { unsigned long saved_reg; + audit_syscall_exit(regs); + if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) trace_sys_exit(regs, regs_return_value(regs));