lkml.org 
[lkml]   [2009]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 2/9] exec_path 2/9: switch audit to ->exec_path
    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
    ---
    kernel/auditsc.c | 23 +++++++----------------
    1 files changed, 7 insertions(+), 16 deletions(-)

    diff --git a/kernel/auditsc.c b/kernel/auditsc.c
    index 7d6ac7c..76829b6 100644
    --- a/kernel/auditsc.c
    +++ b/kernel/auditsc.c
    @@ -53,6 +53,7 @@
    #include <linux/socket.h>
    #include <linux/mqueue.h>
    #include <linux/audit.h>
    +#include <linux/path.h>
    #include <linux/personality.h>
    #include <linux/time.h>
    #include <linux/netlink.h>
    @@ -949,8 +950,7 @@ EXPORT_SYMBOL(audit_log_task_context);
    static void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk)
    {
    char name[sizeof(tsk->comm)];
    - struct mm_struct *mm = tsk->mm;
    - struct vm_area_struct *vma;
    + struct path exec_path;

    /* tsk == current */

    @@ -958,20 +958,11 @@ static void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk
    audit_log_format(ab, " comm=");
    audit_log_untrustedstring(ab, name);

    - if (mm) {
    - down_read(&mm->mmap_sem);
    - vma = mm->mmap;
    - while (vma) {
    - if ((vma->vm_flags & VM_EXECUTABLE) &&
    - vma->vm_file) {
    - audit_log_d_path(ab, "exe=",
    - &vma->vm_file->f_path);
    - break;
    - }
    - vma = vma->vm_next;
    - }
    - up_read(&mm->mmap_sem);
    - }
    + get_task_exec_path(tsk, &exec_path);
    + if (exec_path.mnt && exec_path.dentry)
    + audit_log_d_path(ab, "exe=", &exec_path);
    + path_put(&exec_path);
    +
    audit_log_task_context(ab);
    }


    \
     
     \ /
      Last update: 2009-06-04 01:07    [W:4.331 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site