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: 26329 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C7DE3202DD for ; Sat, 15 Mar 2014 05:51:32 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wn1sf12999367obc.5 for ; Fri, 14 Mar 2014 22:51:32 -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=AgE5NcG5x7EZFpgpgiPrBi7/Bp2iZR45UUJvFZFt7FE=; b=DD3X2KHrqxD+SgCKLq0ruBCwb24V6gtK459YTDG9Co5bjkAcWqsdPWo4AxiOb4ZTUk b/cofG2U2xN3JRE+AsHbLpxLIVFJpVXOv3EZFkYBvDTux/+zLVOCamo8yuFholMBj3ui R+bdVMXbobpE/7D2rXTcD7I8XJiCp5lA8jaRzoiRZDPlWsy7zH2+OdLkwZSZ6aZfcJcO DYSdFGIIJP6BApIWQHoKySHZKp9IuveWgCy0ERUMirl9wBodqNSj7XBKMGrQ6HGLmydf pMHLFQdeUhIQcStfmTEzbJRHrSiRuev4loVN0lWosMCCh0/41yO2+ha0htDDW9QYE5Rd /5Pg== X-Gm-Message-State: ALoCoQmYdYDTmo5dPcIKNthhHi7PpZj7/VBu/Cc8RTTb/VFWdJABXx1pIjzaiTIP0MQWSFmORXoN X-Received: by 10.182.95.68 with SMTP id di4mr5098171obb.4.1394862692326; Fri, 14 Mar 2014 22:51:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.9 with SMTP id k9ls140482qgk.20.gmail; Fri, 14 Mar 2014 22:51:32 -0700 (PDT) X-Received: by 10.52.241.106 with SMTP id wh10mr8173923vdc.16.1394862692233; Fri, 14 Mar 2014 22:51:32 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id dd4si2929996vcb.70.2014.03.14.22.51.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 22:51:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id hu19so3735808vcb.15 for ; Fri, 14 Mar 2014 22:51:32 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr654085vcb.22.1394862692140; Fri, 14 Mar 2014 22:51:32 -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 i9csp73319vck; Fri, 14 Mar 2014 22:51:31 -0700 (PDT) X-Received: by 10.68.178.131 with SMTP id cy3mr12980158pbc.146.1394862691179; Fri, 14 Mar 2014 22:51:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xj10si4417398pab.327.2014.03.14.22.51.17; Fri, 14 Mar 2014 22:51:17 -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 S1756546AbaCOFtn (ORCPT + 26 others); Sat, 15 Mar 2014 01:49:43 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:63563 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756099AbaCOFtk (ORCPT ); Sat, 15 Mar 2014 01:49:40 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq2so3479098pbb.5 for ; Fri, 14 Mar 2014 22:49:39 -0700 (PDT) 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 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_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> 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.170 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 --- 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));