Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932779AbdCIPPq (ORCPT ); Thu, 9 Mar 2017 10:15:46 -0500 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:9111 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932565AbdCIPPp (ORCPT ); Thu, 9 Mar 2017 10:15:45 -0500 Subject: Re: [PATCH] audit: log module name on delete_module To: Richard Guy Briggs , , References: CC: Jessica Yu , Eric Paris , Paul Moore , Steve Grubb From: peter enderborg Message-ID: Date: Thu, 9 Mar 2017 16:15:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 798 Lines: 25 On 03/09/2017 03:08 PM, Richard Guy Briggs wrote: > Record the module name of a delete_module call. > > See: https://github.com/linux-audit/audit-kernel/issues/37 > > Signed-off-by: Richard Guy Briggs > --- > kernel/module.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/kernel/module.c b/kernel/module.c > index 5432dbe..633f6da 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -943,6 +943,8 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, > return -EFAULT; > name[MODULE_NAME_LEN-1] = '\0'; > > + audit_log_kern_module(name); > + > if (mutex_lock_interruptible(&module_mutex) != 0) > return -EINTR; > Is it not better to have that log when we are sure that the module will be deleted and are stopped?