• Jeff Layton's avatar
    audit: fix mq_open and mq_unlink to add the MQ root as a hidden parent audit_names record · 79f6530c
    Jeff Layton authored
    The old audit PATH records for mq_open looked like this:
    
      type=PATH msg=audit(1366282323.982:869): item=1 name=(null) inode=6777
      dev=00:0c mode=041777 ouid=0 ogid=0 rdev=00:00
      obj=system_u:object_r:tmpfs_t:s15:c0.c1023
      type=PATH msg=audit(1366282323.982:869): item=0 name="test_mq" inode=26732
      dev=00:0c mode=0100700 ouid=0 ogid=0 rdev=00:00
      obj=staff_u:object_r:user_tmpfs_t:s15:c0.c1023
    
    ...with the audit related changes that went into 3.7, they now look like this:
    
      type=PATH msg=audit(1366282236.776:3606): item=2 name=(null) inode=66655
      dev=00:0c mode=0100700 ouid=0 ogid=0 rdev=00:00
      obj=staff_u:object_r:user_tmpfs_t:s15:c0.c1023
      type=PATH msg=audit(1366282236.776:3606): item=1 name=(null) inode=6926
      dev=00:0c mode=041777 ouid=0 ogid=0 rdev=00:00
      obj=system_u:object_r:tmpfs_t:s15:c0.c1023
      type=PATH msg=audit(1366282236.776:3606): item=0 name="test_mq"
    
    Both of these look wrong to me.  As Steve Grubb pointed out:
    
     "What we need is 1 PATH record that identifies the MQ.  The other PATH
      records probably should not be there."
    
    Fix it to record the mq root as a parent, and flag it such that it
    should be hidden from view when the names are logged, since the root of
    the mq filesystem isn't terribly interesting.  With this change, we get
    a single PATH record that looks more like this:
    
      type=PATH msg=audit(1368021604.836:484): item=0 name="test_mq" inode=16914
      dev=00:0c mode=0100644 ouid=0 ogid=0 rdev=00:00
      obj=unconfined_u:object_r:user_tmpfs_t:s0
    
    In order to do this, a new audit_inode_parent_hidden() function is
    added.  If we do it this way, then we avoid having the existing callers
    of audit_inode needing to do any sort of flag conversion if auditing is
    inactive.
    Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
    Reported-by: default avatarJiri Jaburek <jjaburek@redhat.com>
    Cc: Steve Grubb <sgrubb@redhat.com>
    Cc: Eric Paris <eparis@redhat.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    79f6530c
Name
Last commit
Last update
..
cpu Loading commit data...
debug Loading commit data...
events Loading commit data...
gcov Loading commit data...
irq Loading commit data...
power Loading commit data...
sched Loading commit data...
time Loading commit data...
trace Loading commit data...
.gitignore Loading commit data...
Kconfig.freezer Loading commit data...
Kconfig.hz Loading commit data...
Kconfig.locks Loading commit data...
Kconfig.preempt Loading commit data...
Makefile Loading commit data...
acct.c Loading commit data...
async.c Loading commit data...
audit.c Loading commit data...
audit.h Loading commit data...
audit_tree.c Loading commit data...
audit_watch.c Loading commit data...
auditfilter.c Loading commit data...
auditsc.c Loading commit data...
backtracetest.c Loading commit data...
bounds.c Loading commit data...
capability.c Loading commit data...
cgroup.c Loading commit data...
cgroup_freezer.c Loading commit data...
compat.c Loading commit data...
configs.c Loading commit data...
context_tracking.c Loading commit data...
cpu.c Loading commit data...
cpu_pm.c Loading commit data...
cpuset.c Loading commit data...
crash_dump.c Loading commit data...
cred.c Loading commit data...
delayacct.c Loading commit data...
dma.c Loading commit data...
elfcore.c Loading commit data...
exec_domain.c Loading commit data...
exit.c Loading commit data...
extable.c Loading commit data...
fork.c Loading commit data...
freezer.c Loading commit data...
futex.c Loading commit data...
futex_compat.c Loading commit data...
groups.c Loading commit data...
hrtimer.c Loading commit data...
hung_task.c Loading commit data...
irq_work.c Loading commit data...
itimer.c Loading commit data...
jump_label.c Loading commit data...
kallsyms.c Loading commit data...
kcmp.c Loading commit data...
kexec.c Loading commit data...
kmod.c Loading commit data...
kprobes.c Loading commit data...
ksysfs.c Loading commit data...
kthread.c Loading commit data...
latencytop.c Loading commit data...
lglock.c Loading commit data...
lockdep.c Loading commit data...
lockdep_internals.h Loading commit data...
lockdep_proc.c Loading commit data...
lockdep_states.h Loading commit data...
modsign_certificate.S Loading commit data...
modsign_pubkey.c Loading commit data...
module-internal.h Loading commit data...
module.c Loading commit data...
module_signing.c Loading commit data...
mutex-debug.c Loading commit data...
mutex-debug.h Loading commit data...
mutex.c Loading commit data...
mutex.h Loading commit data...
notifier.c Loading commit data...
nsproxy.c Loading commit data...
padata.c Loading commit data...
panic.c Loading commit data...
params.c Loading commit data...
pid.c Loading commit data...
pid_namespace.c Loading commit data...
posix-cpu-timers.c Loading commit data...
posix-timers.c Loading commit data...
printk.c Loading commit data...
profile.c Loading commit data...
ptrace.c Loading commit data...
range.c Loading commit data...
rcu.h Loading commit data...
rcupdate.c Loading commit data...
rcutiny.c Loading commit data...
rcutiny_plugin.h Loading commit data...
rcutorture.c Loading commit data...
rcutree.c Loading commit data...
rcutree.h Loading commit data...
rcutree_plugin.h Loading commit data...
rcutree_trace.c Loading commit data...
relay.c Loading commit data...
res_counter.c Loading commit data...
resource.c Loading commit data...
rtmutex-debug.c Loading commit data...
rtmutex-debug.h Loading commit data...
rtmutex-tester.c Loading commit data...
rtmutex.c Loading commit data...
rtmutex.h Loading commit data...
rtmutex_common.h Loading commit data...
rwsem.c Loading commit data...
seccomp.c Loading commit data...
semaphore.c Loading commit data...
signal.c Loading commit data...
smp.c Loading commit data...
smpboot.c Loading commit data...
smpboot.h Loading commit data...
softirq.c Loading commit data...
spinlock.c Loading commit data...
srcu.c Loading commit data...
stacktrace.c Loading commit data...
stop_machine.c Loading commit data...
sys.c Loading commit data...
sys_ni.c Loading commit data...
sysctl.c Loading commit data...
sysctl_binary.c Loading commit data...
task_work.c Loading commit data...
taskstats.c Loading commit data...
test_kprobes.c Loading commit data...
time.c Loading commit data...
timeconst.bc Loading commit data...
timer.c Loading commit data...
tracepoint.c Loading commit data...
tsacct.c Loading commit data...
uid16.c Loading commit data...
up.c Loading commit data...
user-return-notifier.c Loading commit data...
user.c Loading commit data...
user_namespace.c Loading commit data...
utsname.c Loading commit data...
utsname_sysctl.c Loading commit data...
wait.c Loading commit data...
watchdog.c Loading commit data...
workqueue.c Loading commit data...
workqueue_internal.h Loading commit data...