[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhR212FmSEhV_2yryt0=YxTN34ktZ8vveBD3kv4Uhd4WTw@mail.gmail.com>
Date: Wed, 18 Feb 2015 22:23:45 -0500
From: Paul Moore <paul@...l-moore.com>
To: Davidlohr Bueso <dbueso@...e.de>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, dave@...olabs.net,
Eric Paris <eparis@...hat.com>, linux-audit@...hat.com
Subject: Re: [PATCH 1/3] kernel/audit: consolidate handling of mm->exe_file
On Wed, Feb 18, 2015 at 7:10 PM, Davidlohr Bueso <dbueso@...e.de> wrote:
> From: Davidlohr Bueso <dave@...olabs.net>
>
> This patch adds a audit_log_d_path_exe() helper function
> to share how we handle auditing of the exe_file's path.
> Used by both audit and auditsc. No functionality is changed.
>
> Cc: Paul Moore <paul@...l-moore.com>
> Cc: Eric Paris <eparis@...hat.com>
> Cc: linux-audit@...hat.com
> Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
> ---
>
> Compile tested only.
>
> kernel/audit.c | 9 +--------
> kernel/audit.h | 14 ++++++++++++++
> kernel/auditsc.c | 9 +--------
> 3 files changed, 16 insertions(+), 16 deletions(-)
I'd prefer if the audit_log_d_path_exe() helper wasn't a static inline.
> --- a/kernel/audit.h
> +++ b/kernel/audit.h
> @@ -257,6 +257,20 @@ extern struct list_head audit_filter_list[];
>
> extern struct audit_entry *audit_dupe_rule(struct audit_krule *old);
>
> +static inline void audit_log_d_path_exe(struct audit_buffer *ab,
> + struct mm_struct *mm)
> +{
> + if (!mm) {
> + audit_log_format(ab, " exe=(null)");
> + return;
> + }
> +
> + down_read(&mm->mmap_sem);
> + if (mm->exe_file)
> + audit_log_d_path(ab, " exe=", &mm->exe_file->f_path);
> + up_read(&mm->mmap_sem);
> +}
> +
> /* audit watch functions */
> #ifdef CONFIG_AUDIT_WATCH
> extern void audit_put_watch(struct audit_watch *watch);
--
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists