From patchwork Wed Apr 30 09:57:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 29403 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0606B203F3 for ; Wed, 30 Apr 2014 09:59:05 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf7727110oag.8 for ; Wed, 30 Apr 2014 02:59:05 -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=1LMs+VhNZqiPVHpLAWgiN2a/Xe5EYU/reWs/4/dQgrs=; b=eKsObyng7YnQVXDLL22yQ+V5qcoQTN33FCBUvh8pFqnxRDjIAwtb1JcMN7hIvu95hR IIdzgYudcCbQ7M/HNwOF4m7yT1fT2PVpNQIGe4DOzLSNgkNWtLmFJfGJJGc2Rs+Wd29W p0sGNNOQVGN0Sl76r571eryMgsu8u3oGN675tg+AGCNP80A6Eq5t99sBAi07eFM2L34/ q0brej/0gmLdzZoDm3DibFsCcvyI+siXFiXtqpVqNP2rN0jccb+zvLBPZqyVaE4UdoUd G7c/7x93Uaj6uGAFgujeFKtDA09SFrgA3oOTCztvddpEHOJ40Tf4HopxOSgGuET/9c8y vkhg== X-Gm-Message-State: ALoCoQlFbIgaqf8IxDyzIaOz8VJlZKJRFMk7bYoIo5iWQd4AWgKj+qGmaE6Hw/eD7kRviRg8ivwP X-Received: by 10.50.50.211 with SMTP id e19mr1856217igo.4.1398851944064; Wed, 30 Apr 2014 02:59:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.49 with SMTP id y46ls471734qgy.10.gmail; Wed, 30 Apr 2014 02:59:03 -0700 (PDT) X-Received: by 10.52.123.39 with SMTP id lx7mr2662453vdb.22.1398851943880; Wed, 30 Apr 2014 02:59:03 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id sh5si5188777vdc.158.2014.04.30.02.59.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 02:59:03 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so1814525veb.41 for ; Wed, 30 Apr 2014 02:59:03 -0700 (PDT) X-Received: by 10.220.190.197 with SMTP id dj5mr3084913vcb.19.1398851943779; Wed, 30 Apr 2014 02:59:03 -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.221.72 with SMTP id ib8csp265484vcb; Wed, 30 Apr 2014 02:59:03 -0700 (PDT) X-Received: by 10.66.124.137 with SMTP id mi9mr6674473pab.111.1398851942921; Wed, 30 Apr 2014 02:59:02 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pc9si16394231pac.230.2014.04.30.02.59.01 for ; Wed, 30 Apr 2014 02:59:01 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933719AbaD3J6q (ORCPT + 28 others); Wed, 30 Apr 2014 05:58:46 -0400 Received: from mail-ie0-f181.google.com ([209.85.223.181]:58089 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932198AbaD3J6n (ORCPT ); Wed, 30 Apr 2014 05:58:43 -0400 Received: by mail-ie0-f181.google.com with SMTP id y20so1546012ier.26 for ; Wed, 30 Apr 2014 02:58:42 -0700 (PDT) X-Received: by 10.50.170.130 with SMTP id am2mr3199114igc.15.1398851922769; Wed, 30 Apr 2014 02:58:42 -0700 (PDT) Received: from localhost.localdomain (KD182249095136.au-net.ne.jp. [182.249.95.136]) by mx.google.com with ESMTPSA id on9sm4435618igb.11.2014.04.30.02.58.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 02:58:41 -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 v9 2/2] arm64: audit: Add audit hook in syscall_trace_enter/exit() Date: Wed, 30 Apr 2014 18:57:23 +0900 Message-Id: <1398851843-16435-3-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398851843-16435-1-git-send-email-takahiro.akashi@linaro.org> References: <1394862548-29060-1-git-send-email-takahiro.akashi@linaro.org> <1398851843-16435-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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 Acked-by Will Deacon 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 0bf1955..0568dc9 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(), 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));