From patchwork Fri Jul 4 07:28:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 33072 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2B74A20C88 for ; Fri, 4 Jul 2014 07:30:37 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf2723372ykq.0 for ; Fri, 04 Jul 2014 00:30:37 -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=2VZrzDssdsSvuJ8miTYMsItV5AmKn7W1riX1sdTkpio=; b=DwZWRrx6/Gen+nYzvlcvXGEuGnOU05+u8fpuGJk6lGv7zBMQoTaTpl328wJEYrjJzM pK/sSbyqhHnOqAbV6pXVEPd2nnZGwDuAM9PZ1BwNDZN7De+/TUH8jeX3mqcFkpbdwygv XoTNG/ubq+hct2ULjGfnmsYghjRTXb4gsj0JirehiNiIRzMFCOylMf3gfikTfTl7BpWf NN+rWIfNzy41Pboox5sfKYlN7qP8fNMbjjJj9JXX9MiMHadui6KXHKSwcxRKv0Gg1v2I NiOHzMaRFBkfs49rtVk9IkRludX53S9gS+DK7ymlA0bsxuTe1GT2aXQYBa7CgqS6up1j gpbg== X-Gm-Message-State: ALoCoQlZlyFXA3Bt8G8LY33YqRAskrO5XLS+O3xj486renkyEFyJyVLW19A44WOxa4BcO3CmrB1Z X-Received: by 10.224.103.135 with SMTP id k7mr4757865qao.6.1404459036949; Fri, 04 Jul 2014 00:30:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.8 with SMTP id v8ls751927qge.15.gmail; Fri, 04 Jul 2014 00:30:36 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr8429443vcg.16.1404459036876; Fri, 04 Jul 2014 00:30:36 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id wy4si15184938vdc.8.2014.07.04.00.30.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 00:30:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id il7so1287740vcb.27 for ; Fri, 04 Jul 2014 00:30:36 -0700 (PDT) X-Received: by 10.220.177.133 with SMTP id bi5mr8235771vcb.26.1404459036786; Fri, 04 Jul 2014 00:30:36 -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.221.37.5 with SMTP id tc5csp446057vcb; Fri, 4 Jul 2014 00:30:36 -0700 (PDT) X-Received: by 10.66.132.36 with SMTP id or4mr9440192pab.42.1404459035834; Fri, 04 Jul 2014 00:30:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn5si5004688pac.36.2014.07.04.00.30.35; Fri, 04 Jul 2014 00:30:35 -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 S1754630AbaGDHa1 (ORCPT + 27 others); Fri, 4 Jul 2014 03:30:27 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:48206 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753674AbaGDHaT (ORCPT ); Fri, 4 Jul 2014 03:30:19 -0400 Received: by mail-pa0-f48.google.com with SMTP id et14so1574484pad.21 for ; Fri, 04 Jul 2014 00:30:18 -0700 (PDT) X-Received: by 10.70.118.5 with SMTP id ki5mr8795455pdb.104.1404459018721; Fri, 04 Jul 2014 00:30:18 -0700 (PDT) Received: from localhost.localdomain (KD182249080206.au-net.ne.jp. [182.249.80.206]) by mx.google.com with ESMTPSA id cj1sm151915331pac.40.2014.07.04.00.30.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Jul 2014 00:30:17 -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, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, AKASHI Takahiro Subject: [PATCH v10 3/3] arm64: audit: Add audit hook in syscall_trace_enter/exit() Date: Fri, 4 Jul 2014 16:28:31 +0900 Message-Id: <1404458911-8214-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404458911-8214-1-git-send-email-takahiro.akashi@linaro.org> References: <1404458911-8214-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) 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 9fde010..70526cf 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 @@ -1113,11 +1115,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));