Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3220427imd; Mon, 29 Oct 2018 03:50:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5dM9Oq/r5kEehXtpcfSiObSZuQ7Q1Xmpku62P4UNQpEwtFSlbsCroHdUPuV0FRliRSd4HIE X-Received: by 2002:a63:e40e:: with SMTP id a14-v6mr13387523pgi.28.1540810210765; Mon, 29 Oct 2018 03:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540810210; cv=none; d=google.com; s=arc-20160816; b=vSiKfC7x3WPdHFH7TVHK0ucLBxPRg8kUgKGFLCh2BgZMmNWVWwlQVVzMpo/RtnzaE+ s78Ih3gLCbNY+5xQJhgjGiRhoJZODBnnZysZ5OAbIi8pQgtxYpXCRXShkC05DWxSwHPJ 8WhbVlozTyc/qhmuxSzbpZ9+HWjUAYwFINUhtPn0ecUTJ7FRU5cApEzKbf2RbnB0q5hN 8yrtO75e6EKBGWfChxFr5aWwkHrGNkY+Y8yJtSB51EoTzhxYG/pCP7dWFaH+i9IqaxXp 7fCHh13FdwCPSOEeSBLWgqQJuXSJporpu9IeaYBSdfKOCMFIID5ZWVH/1ZCiF23Mbjax sDpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=aEWLaDb2yI+1DNd4jxamdSPIdF92GrY7Gw+p21fiuIo=; b=G4rxTptMNDV3xvqV1ckM9zOwWEjPPAl5FcVG5YY1KcTp1eqHbEQ3z8vCCje2oRFaEg YS/gKHlNBgPlaU4MHg9XpKvkDPWv65VzhVoiBCuZxDVH+eRlrJsM8iF7h1jsPMYm7//v Yliw8Ul37AzDC3NNRH4B6gaWo1i1l8/79OANyK7vgTf9m5/w0F+xlaUaRwDK3S3TzJZQ e9DilEdrbXasoz80LxkX/bQuCuCrn8PvtRyagzhwzk78TSNlP+z6BAAW9oN2Og+pNT4J jt+MFnkLatRBpkmhmU9DbnzX1OvGswNyDE80xfPcACiggTQ8VB9ZOuQYcOO4H+zMZJwI ZPCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Wvav30om; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9-v6si16157229pge.245.2018.10.29.03.49.55; Mon, 29 Oct 2018 03:50:10 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Wvav30om; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729829AbeJ2Thd (ORCPT + 99 others); Mon, 29 Oct 2018 15:37:33 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53981 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729751AbeJ2Thc (ORCPT ); Mon, 29 Oct 2018 15:37:32 -0400 Received: by mail-wm1-f66.google.com with SMTP id l26-v6so7688478wmh.3 for ; Mon, 29 Oct 2018 03:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aEWLaDb2yI+1DNd4jxamdSPIdF92GrY7Gw+p21fiuIo=; b=Wvav30omjGWoxCfcBTlkQcns3YJnsWigIDibAKGKPuOchPfuYZctMSh/Gni90RgKv8 zlWy8msSsr/o/xxOLjWNECYki6/kTrTsEjyCzTyv0PmxAG4v9wRcxO0swdJKxJpJw8mF mJRLgz1IG3vStpp73BWaBzlnIIGM/7DIStxZe9MobrdLvyRJfP0s6OxEaAghy+1wdp/3 BkjHik7oVvvBg1yeTSl/gA5sTr8YsZYdyTv836aCovRGiKgqnmPL6ZLX7aqoXERupdls 1OcgZG7dvv1jkECCjVOx+b1Eq5B+vz1N01KIaFhyt0P//YYkxZ+7k+SvL9yaNjKZ5Efz K6Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aEWLaDb2yI+1DNd4jxamdSPIdF92GrY7Gw+p21fiuIo=; b=d9mkcxrueRSAMqHXUFg0+IC+KXKF/Nc3rJFRYbGwd+/4XJ/KxmbfxF0hX5X6D49YH4 yYdGB+z5jlkayPv1JuW2qJzmzGZQ5CAiKlodVLm2mZJTRzVfRD0j5Q/snp22wR85UdQ+ rOyDhR7LxYzKCQTxGqNZA+E0HwzJSij2aCPTZ4ShY07KFvYBCa2UyH21F3VCljx/fWYN 7K1q8+OAuqzhw2mSVFNkZJQafDkCr3QiO4klnl3tTno1uhjLeiK6XdMJND1t394+Whk1 UbcPQaDGlvs7Jiu6HaAgxdpMHeev2DLB5j5rmSw4DYk7Wpxx1JQfu68GJY+aLvpHfp8O /PvA== X-Gm-Message-State: AGRZ1gLnVPfY6d0cpogZYZ6mbioOutwfnX8Tnyk5ymvw2bT9662jIcHL l/AX2VCaNVQzyEc0MJjTa6UujBwBQzI= X-Received: by 2002:a1c:9e93:: with SMTP id h141-v6mr14369759wme.56.1540810163070; Mon, 29 Oct 2018 03:49:23 -0700 (PDT) Received: from localhost.localdomain (ip-76.net-89-3-178.rev.numericable.fr. [89.3.178.76]) by smtp.gmail.com with ESMTPSA id l70-v6sm36360609wma.0.2018.10.29.03.49.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 03:49:22 -0700 (PDT) From: David Abdurachmanov To: palmer@sifive.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com Cc: David Abdurachmanov Subject: [PATCH 2/2] riscv: audit: add audit hook in do_syscall_trace_enter/exit() Date: Mon, 29 Oct 2018 11:48:54 +0100 Message-Id: <20181029104854.17432-3-david.abdurachmanov@gmail.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181029104854.17432-1-david.abdurachmanov@gmail.com> References: <20181029104854.17432-1-david.abdurachmanov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds auditing functions on entry to and exit from every system call invocation. Signed-off-by: David Abdurachmanov --- arch/riscv/kernel/ptrace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c index 9f82a7e34c64..85b0c93f00c6 100644 --- a/arch/riscv/kernel/ptrace.c +++ b/arch/riscv/kernel/ptrace.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -111,10 +112,14 @@ void do_syscall_trace_enter(struct pt_regs *regs) if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) trace_sys_enter(regs, syscall_get_nr(current, regs)); #endif + + audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3); } void do_syscall_trace_exit(struct pt_regs *regs) { + audit_syscall_exit(regs); + if (test_thread_flag(TIF_SYSCALL_TRACE)) tracehook_report_syscall_exit(regs, 0); -- 2.17.2