04 Sep, 2017

1 commit

  • struct timespec is not y2038 safe. Replace
    all uses of timespec by y2038 safe struct timespec64.

    Even though timespec is used here to represent timeouts,
    replace these with timespec64 so that it facilitates
    in verification by creating a y2038 safe kernel image
    that is free of timespec.

    The syscall interfaces themselves are not changed as part
    of the patch. They will be part of a different series.

    Signed-off-by: Deepa Dinamani
    Cc: Paul Moore
    Cc: Richard Guy Briggs
    Reviewed-by: Richard Guy Briggs
    Reviewed-by: Arnd Bergmann
    Acked-by: Paul Moore
    Signed-off-by: Al Viro

    Deepa Dinamani
     

13 Jun, 2017

1 commit

  • Fixed checkpatch.pl warnings of "function definition argument FOO
    should also have an identifier name"

    Signed-off-by: Derek Robson
    Reviewed-by: Richard Guy Briggs
    Signed-off-by: Paul Moore

    Derek Robson
     

31 May, 2017

1 commit

  • Capabilities were augmented to include ambient capabilities in v4.3
    commit 58319057b784 ("capabilities: ambient capabilities").

    Add ambient capabilities to the audit BPRM_FCAPS and CAPSET records.

    The record contains fields "old_pp", "old_pi", "old_pe", "new_pp",
    "new_pi", "new_pe" so in keeping with the previous record
    normalizations, change the "new_*" variants to simply drop the "new_"
    prefix.

    A sample of the replaced BPRM_FCAPS record:
    RAW: type=BPRM_FCAPS msg=audit(1491468034.252:237): fver=2
    fp=0000000000200000 fi=0000000000000000 fe=1 old_pp=0000000000000000
    old_pi=0000000000000000 old_pe=0000000000000000 old_pa=0000000000000000
    pp=0000000000200000 pi=0000000000000000 pe=0000000000200000
    pa=0000000000000000

    INTERPRET: type=BPRM_FCAPS msg=audit(04/06/2017 04:40:34.252:237):
    fver=2 fp=sys_admin fi=none fe=chown old_pp=none old_pi=none
    old_pe=none old_pa=none pp=sys_admin pi=none pe=sys_admin pa=none

    A sample of the replaced CAPSET record:
    RAW: type=CAPSET msg=audit(1491469502.371:242): pid=833
    cap_pi=0000003fffffffff cap_pp=0000003fffffffff cap_pe=0000003fffffffff
    cap_pa=0000000000000000

    INTERPRET: type=CAPSET msg=audit(04/06/2017 05:05:02.371:242) : pid=833
    cap_pi=chown,dac_override,dac_read_search,fowner,fsetid,kill,
    setgid,setuid,setpcap,linux_immutable,net_bind_service,net_broadcast,
    net_admin,net_raw,ipc_lock,ipc_owner,sys_module,sys_rawio,sys_chroot,
    sys_ptrace,sys_pacct,sys_admin,sys_boot,sys_nice,sys_resource,sys_time,
    sys_tty_config,mknod,lease,audit_write,audit_control,setfcap,
    mac_override,mac_admin,syslog,wake_alarm,block_suspend,audit_read
    cap_pp=chown,dac_override,dac_read_search,fowner,fsetid,kill,setgid,
    setuid,setpcap,linux_immutable,net_bind_service,net_broadcast,
    net_admin,net_raw,ipc_lock,ipc_owner,sys_module,sys_rawio,sys_chroot,
    sys_ptrace,sys_pacct,sys_admin,sys_boot,sys_nice,sys_resource,
    sys_time,sys_tty_config,mknod,lease,audit_write,audit_control,setfcap,
    mac_override,mac_admin,syslog,wake_alarm,block_suspend,audit_read
    cap_pe=chown,dac_override,dac_read_search,fowner,fsetid,kill,setgid,
    setuid,setpcap,linux_immutable,net_bind_service,net_broadcast,
    net_admin,net_raw,ipc_lock,ipc_owner,sys_module,sys_rawio,sys_chroot,
    sys_ptrace,sys_pacct,sys_admin,sys_boot,sys_nice,sys_resource,
    sys_time,sys_tty_config,mknod,lease,audit_write,audit_control,setfcap,
    mac_override,mac_admin,syslog,wake_alarm,block_suspend,audit_read
    cap_pa=none

    See: https://github.com/linux-audit/audit-kernel/issues/40

    Signed-off-by: Richard Guy Briggs
    Acked-by: Serge Hallyn
    Signed-off-by: Paul Moore

    Richard Guy Briggs
     

02 May, 2017

3 commits


28 Mar, 2017

1 commit

  • Commit 5b52330bbfe6 ("audit: fix auditd/kernel connection state
    tracking") made inlining audit_signal_info() a bit pointless as
    it was always calling into auditd_test_task() so let's remove the
    inline function in kernel/audit.h and convert __audit_signal_info()
    in kernel/auditsc.c into audit_signal_info().

    Reviewed-by: Richard Guy Briggs
    Signed-off-by: Paul Moore

    Paul Moore
     

21 Mar, 2017

1 commit

  • What started as a rather straightforward race condition reported by
    Dmitry using the syzkaller fuzzer ended up revealing some major
    problems with how the audit subsystem managed its netlink sockets and
    its connection with the userspace audit daemon. Fixing this properly
    had quite the cascading effect and what we are left with is this rather
    large and complicated patch. My initial goal was to try and decompose
    this patch into multiple smaller patches, but the way these changes
    are intertwined makes it difficult to split these changes into
    meaningful pieces that don't break or somehow make things worse for
    the intermediate states.

    The patch makes a number of changes, but the most significant are
    highlighted below:

    * The auditd tracking variables, e.g. audit_sock, are now gone and
    replaced by a RCU/spin_lock protected variable auditd_conn which is
    a structure containing all of the auditd tracking information.

    * We no longer track the auditd sock directly, instead we track it
    via the network namespace in which it resides and we use the audit
    socket associated with that namespace. In spirit, this is what the
    code was trying to do prior to this patch (at least I think that is
    what the original authors intended), but it was done rather poorly
    and added a layer of obfuscation that only masked the underlying
    problems.

    * Big backlog queue cleanup, again. In v4.10 we made some pretty big
    changes to how the audit backlog queues work, here we haven't changed
    the queue design so much as cleaned up the implementation. Brought
    about by the locking changes, we've simplified kauditd_thread() quite
    a bit by consolidating the queue handling into a new helper function,
    kauditd_send_queue(), which allows us to eliminate a lot of very
    similar code and makes the looping logic in kauditd_thread() clearer.

    * All netlink messages sent to auditd are now sent via
    auditd_send_unicast_skb(). Other than just making sense, this makes
    the lock handling easier.

    * Change the audit_log_start() sleep behavior so that we never sleep
    on auditd events (unchanged) or if the caller is holding the
    audit_cmd_mutex (changed). Previously we didn't sleep if the caller
    was auditd or if the message type fell between a certain range; the
    type check was a poor effort of doing what the cmd_mutex check now
    does. Richard Guy Briggs originally proposed not sleeping the
    cmd_mutex owner several years ago but his patch wasn't acceptable
    at the time. At least the idea lives on here.

    * A problem with the lost record counter has been resolved. Steve
    Grubb and I both happened to notice this problem and according to
    some quick testing by Steve, this problem goes back quite some time.
    It's largely a harmless problem, although it may have left some
    careful sysadmins quite puzzled.

    Cc: # 4.10.x-
    Reported-by: Dmitry Vyukov
    Signed-off-by: Paul Moore

    Paul Moore
     

22 Feb, 2017

1 commit

  • Pull audit updates from Paul Moore:
    "The audit changes for v4.11 are relatively small compared to what we
    did for v4.10, both in terms of size and impact.

    - two patches from Steve tweak the formatting for some of the audit
    records to make them more consistent with other audit records.

    - three patches from Richard record the name of a module on module
    load, fix the logging of sockaddr information when using
    socketcall() on 32-bit systems, and add the ability to reset
    audit's lost record counter.

    - my lone patch just fixes an annoying style nit that I was reminded
    about by one of Richard's patches.

    All these patches pass our test suite"

    * 'stable-4.11' of git://git.infradead.org/users/pcmoore/audit:
    audit: remove unnecessary curly braces from switch/case statements
    audit: log module name on init_module
    audit: log 32-bit socketcalls
    audit: add feature audit_lost reset
    audit: Make AUDIT_ANOM_ABEND event normalized
    audit: Make AUDIT_KERNEL event conform to the specification

    Linus Torvalds
     

14 Feb, 2017

1 commit

  • This adds a new auxiliary record MODULE_INIT to the SYSCALL event.

    We get finit_module for free since it made most sense to hook this in to
    load_module().

    https://github.com/linux-audit/audit-kernel/issues/7
    https://github.com/linux-audit/audit-kernel/wiki/RFE-Module-Load-Record-Format

    Signed-off-by: Richard Guy Briggs
    Acked-by: Jessica Yu
    [PM: corrected links in the commit description]
    Signed-off-by: Paul Moore

    Richard Guy Briggs
     

06 Dec, 2016

1 commit


30 Jul, 2016

1 commit

  • Pull audit updates from Paul Moore:
    "Six audit patches for 4.8.

    There are a couple of style and minor whitespace tweaks for the logs,
    as well as a minor fixup to catch errors on user filter rules, however
    the major improvements are a fix to the s390 syscall argument masking
    code (reviewed by the nice s390 folks), some consolidation around the
    exclude filtering (less code, always a win), and a double-fetch fix
    for recording the execve arguments"

    * 'stable-4.8' of git://git.infradead.org/users/pcmoore/audit:
    audit: fix a double fetch in audit_log_single_execve_arg()
    audit: fix whitespace in CWD record
    audit: add fields to exclude filter by reusing user filter
    s390: ensure that syscall arguments are properly masked on s390
    audit: fix some horrible switch statement style crimes
    audit: fixup: log on errors from filter user rules

    Linus Torvalds
     

29 Jun, 2016

1 commit


27 Jun, 2016

1 commit

  • RFE: add additional fields for use in audit filter exclude rules
    https://github.com/linux-audit/audit-kernel/issues/5

    Re-factor and combine audit_filter_type() with audit_filter_user() to
    use audit_filter_user_rules() to enable the exclude filter to
    additionally filter on PID, UID, GID, AUID, LOGINUID_SET, SUBJ_*.

    The process of combining the similar audit_filter_user() and
    audit_filter_type() functions, required inverting the meaning and
    including the ALWAYS action of the latter.

    Include audit_filter_user_rules() into audit_filter(), removing
    unneeded logic in the process.

    Keep the check to quit early if the list is empty.

    Signed-off-by: Richard Guy Briggs
    [PM: checkpatch.pl fixes - whitespace damage, wrapped description]
    Signed-off-by: Paul Moore

    Richard Guy Briggs
     

25 Dec, 2015

1 commit


04 Nov, 2015

1 commit

  • This patch makes audit_tree_match return bool to improve readability
    due to this particular function only using either one or zero as its
    return value.

    No functional change.

    Signed-off-by: Yaowei Bai
    [PM: tweaked the subject line]
    Signed-off-by: Paul Moore

    Yaowei Bai
     

09 Sep, 2015

1 commit

  • Pull audit update from Paul Moore:
    "This is one of the larger audit patchsets in recent history,
    consisting of eight patches and almost 400 lines of changes.

    The bulk of the patchset is the new "audit by executable"
    functionality which allows admins to set an audit watch based on the
    executable on disk. Prior to this, admins could only track an
    application by PID, which has some obvious limitations.

    Beyond the new functionality we also have some refcnt fixes and a few
    minor cleanups"

    * 'upstream' of git://git.infradead.org/users/pcmoore/audit:
    fixup: audit: implement audit by executable
    audit: implement audit by executable
    audit: clean simple fsnotify implementation
    audit: use macros for unset inode and device values
    audit: make audit_del_rule() more robust
    audit: fix uninitialized variable in audit_add_rule()
    audit: eliminate unnecessary extra layer of watch parent references
    audit: eliminate unnecessary extra layer of watch references

    Linus Torvalds
     

07 Aug, 2015

2 commits

  • This adds the ability audit the actions of a not-yet-running process.

    This patch implements the ability to filter on the executable path. Instead of
    just hard coding the ino and dev of the executable we care about at the moment
    the rule is inserted into the kernel, use the new audit_fsnotify
    infrastructure to manage this dynamically. This means that if the filename
    does not yet exist but the containing directory does, or if the inode in
    question is unlinked and creat'd (aka updated) the rule will just continue to
    work. If the containing directory is moved or deleted or the filesystem is
    unmounted, the rule is deleted automatically. A future enhancement would be to
    have the rule survive across directory disruptions.

    This is a heavily modified version of a patch originally submitted by Eric
    Paris with some ideas from Peter Moody.

    Cc: Peter Moody
    Cc: Eric Paris
    Signed-off-by: Richard Guy Briggs
    [PM: minor whitespace clean to satisfy ./scripts/checkpatch]
    Signed-off-by: Paul Moore

    Richard Guy Briggs
     
  • This is to be used to audit by executable path rules, but audit watches should
    be able to share this code eventually.

    At the moment the audit watch code is a lot more complex. That code only
    creates one fsnotify watch per parent directory. That 'audit_parent' in
    turn has a list of 'audit_watches' which contain the name, ino, dev of
    the specific object we care about. This just creates one fsnotify watch
    per object we care about. So if you watch 100 inodes in /etc this code
    will create 100 fsnotify watches on /etc. The audit_watch code will
    instead create 1 fsnotify watch on /etc (the audit_parent) and then 100
    individual watches chained from that fsnotify mark.

    We should be able to convert the audit_watch code to do one fsnotify
    mark per watch and simplify things/remove a whole lot of code. After
    that conversion we should be able to convert the audit_fsnotify code to
    support that hierarchy if the optimization is necessary.

    Move the access to the entry for audit_match_signal() to the beginning of
    the audit_del_rule() function in case the entry found is the same one passed
    in. This will enable it to be used by audit_autoremove_mark_rule(),
    kill_rules() and audit_remove_parent_watches().

    This is a heavily modified and merged version of two patches originally
    submitted by Eric Paris.

    Cc: Peter Moody
    Cc: Eric Paris
    Signed-off-by: Richard Guy Briggs
    [PM: added a space after a declaration to keep ./scripts/checkpatch happy]
    Signed-off-by: Paul Moore

    Richard Guy Briggs
     

23 Apr, 2015

1 commit

  • Pull audit fixes from Paul Moore:
    "Seven audit patches for v4.1, all bug fixes.

    The largest, and perhaps most significant commit helps resolve some
    memory pressure issues related to the inode cache and audit, there are
    also a few small commits which help resolve some timing issues with
    the audit log queue, and the rest fall into the always popular "code
    clean-up" category.

    In general, nothing really substantial, just a nice set of maintenance
    patches"

    * 'upstream' of git://git.infradead.org/users/pcmoore/audit:
    audit: Remove condition which always evaluates to false
    audit: reduce mmap_sem hold for mm->exe_file
    audit: consolidate handling of mm->exe_file
    audit: code clean up
    audit: don't reset working wait time accidentally with auditd
    audit: don't lose set wait time on first successful call to audit_log_start()
    audit: move the tree pruning to a dedicated thread

    Linus Torvalds
     

24 Feb, 2015

1 commit


23 Jan, 2015

1 commit

  • In order to ensure that filenames are not released before the audit
    subsystem is done with the strings there are a number of hacks built
    into the fs and audit subsystems around getname() and putname(). To
    say these hacks are "ugly" would be kind.

    This patch removes the filename hackery in favor of a more
    conventional reference count based approach. The diffstat below tells
    most of the story; lots of audit/fs specific code is replaced with a
    traditional reference count based approach that is easily understood,
    even by those not familiar with the audit and/or fs subsystems.

    CC: viro@zeniv.linux.org.uk
    CC: linux-fsdevel@vger.kernel.org
    Signed-off-by: Paul Moore
    Signed-off-by: Al Viro

    Paul Moore
     

24 Sep, 2014

1 commit


20 Mar, 2014

2 commits

  • While reading through 3.14-rc1 I found a pretty siginficant mishandling
    of network namespaces in the recent audit changes.

    In struct audit_netlink_list and audit_reply add a reference to the
    network namespace of the caller and remove the userspace pid of the
    caller. This cleanly remembers the callers network namespace, and
    removes a huge class of races and nasty failure modes that can occur
    when attempting to relook up the callers network namespace from a pid_t
    (including the caller's network namespace changing, pid wraparound, and
    the pid simply not being present).

    Signed-off-by: "Eric W. Biederman"
    Acked-by: Richard Guy Briggs
    Signed-off-by: Eric Paris

    Eric W. Biederman
     
  • During an audit event, cache and print the value of the process's
    proctitle value (proc//cmdline). This is useful in situations
    where processes are started via fork'd virtual machines where the
    comm field is incorrect. Often times, setting the comm field still
    is insufficient as the comm width is not very wide and most
    virtual machine "package names" do not fit. Also, during execution,
    many threads have their comm field set as well. By tying it back to
    the global cmdline value for the process, audit records will be more
    complete in systems with these properties. An example of where this
    is useful and applicable is in the realm of Android. With Android,
    their is no fork/exec for VM instances. The bare, preloaded Dalvik
    VM listens for a fork and specialize request. When this request comes
    in, the VM forks, and the loads the specific application (specializing).
    This was done to take advantage of COW and to not require a load of
    basic packages by the VM on very app spawn. When this spawn occurs,
    the package name is set via setproctitle() and shows up in procfs.
    Many of these package names are longer then 16 bytes, the historical
    width of task->comm. Having the cmdline in the audit records will
    couple the application back to the record directly. Also, on my
    Debian development box, some audit records were more useful then
    what was printed under comm.

    The cached proctitle is tied to the life-cycle of the audit_context
    structure and is built on demand.

    Proctitle is controllable by userspace, and thus should not be trusted.
    It is meant as an aid to assist in debugging. The proctitle event is
    emitted during syscall audits, and can be filtered with auditctl.

    Example:
    type=AVC msg=audit(1391217013.924:386): avc: denied { getattr } for pid=1971 comm="mkdir" name="/" dev="selinuxfs" ino=1 scontext=system_u:system_r:consolekit_t:s0-s0:c0.c255 tcontext=system_u:object_r:security_t:s0 tclass=filesystem
    type=SYSCALL msg=audit(1391217013.924:386): arch=c000003e syscall=137 success=yes exit=0 a0=7f019dfc8bd7 a1=7fffa6aed2c0 a2=fffffffffff4bd25 a3=7fffa6aed050 items=0 ppid=1967 pid=1971 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="mkdir" exe="/bin/mkdir" subj=system_u:system_r:consolekit_t:s0-s0:c0.c255 key=(null)
    type=UNKNOWN[1327] msg=audit(1391217013.924:386): proctitle=6D6B646972002D70002F7661722F72756E2F636F6E736F6C65

    Acked-by: Steve Grubb (wrt record formating)

    Signed-off-by: William Roberts
    Signed-off-by: Eric Paris

    William Roberts
     

15 Jan, 2014

1 commit

  • The equivalent uapi struct uses __u32 so make the kernel
    uses u32 too.

    This can prevent some oddities where the limit is
    logged/emitted as a negative value.

    Convert kstrtol to kstrtouint to disallow negative values.

    Signed-off-by: Joe Perches
    [eparis: do not remove static from audit_default declaration]

    Joe Perches
     

14 Jan, 2014

2 commits

  • Convert audit from only listening in init_net to use register_pernet_subsys()
    to dynamically manage the netlink socket list.

    Signed-off-by: Richard Guy Briggs
    Signed-off-by: Eric Paris

    Richard Guy Briggs
     
  • Normally, netlink ports use the PID of the userspace process as the port ID.
    If the PID is already in use by a port, the kernel will allocate another port
    ID to avoid conflict. Re-name all references to netlink ports from pid to
    portid to reflect this reality and avoid confusion with actual PIDs. Ports
    use the __u32 type, so re-type all portids accordingly.

    (This patch is very similar to ebiederman's 5deadd69)

    Signed-off-by: Richard Guy Briggs
    Signed-off-by: Gao feng
    Signed-off-by: Eric Paris

    Richard Guy Briggs
     

06 Nov, 2013

2 commits

  • Move the audit_bprm() call from search_binary_handler() to exec_binprm(). This
    allows us to get rid of the mm member of struct audit_aux_data_execve since
    bprm->mm will equal current->mm.

    This also mitigates the issue that ->argc could be modified by the
    load_binary() call in search_binary_handler().

    audit_bprm() was being called to add an AUDIT_EXECVE record to the audit
    context every time search_binary_handler() was recursively called. Only one
    reference is necessary.

    Reported-by: Oleg Nesterov
    Cc: Eric Paris
    Signed-off-by: Richard Guy Briggs
    Signed-off-by: Eric Paris
    ---
    This patch is against 3.11, but was developed on Oleg's post-3.11 patches that
    introduce exec_binprm().

    Richard Guy Briggs
     
  • audit_bprm() was being called to add an AUDIT_EXECVE record to the audit
    context every time search_binary_handler() was recursively called. Only one
    reference is necessary, so just update it. Move the the contents of
    audit_aux_data_execve into the union in audit_context, removing dependence on a
    kmalloc along the way.

    Reported-by: Oleg Nesterov
    Cc: Eric Paris
    Signed-off-by: Richard Guy Briggs
    Signed-off-by: Eric Paris

    Richard Guy Briggs
     

10 Jul, 2013

1 commit

  • 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: Jeff Layton
    Reported-by: Jiri Jaburek
    Cc: Steve Grubb
    Cc: Eric Paris
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Layton
     

12 May, 2013

1 commit

  • Pull audit changes from Eric Paris:
    "Al used to send pull requests every couple of years but he told me to
    just start pushing them to you directly.

    Our touching outside of core audit code is pretty straight forward. A
    couple of interface changes which hit net/. A simple argument bug
    calling audit functions in namei.c and the removal of some assembly
    branch prediction code on ppc"

    * git://git.infradead.org/users/eparis/audit: (31 commits)
    audit: fix message spacing printing auid
    Revert "audit: move kaudit thread start from auditd registration to kaudit init"
    audit: vfs: fix audit_inode call in O_CREAT case of do_last
    audit: Make testing for a valid loginuid explicit.
    audit: fix event coverage of AUDIT_ANOM_LINK
    audit: use spin_lock in audit_receive_msg to process tty logging
    audit: do not needlessly take a lock in tty_audit_exit
    audit: do not needlessly take a spinlock in copy_signal
    audit: add an option to control logging of passwords with pam_tty_audit
    audit: use spin_lock_irqsave/restore in audit tty code
    helper for some session id stuff
    audit: use a consistent audit helper to log lsm information
    audit: push loginuid and sessionid processing down
    audit: stop pushing loginid, uid, sessionid as arguments
    audit: remove the old depricated kernel interface
    audit: make validity checking generic
    audit: allow checking the type of audit message in the user filter
    audit: fix build break when AUDIT_DEBUG == 2
    audit: remove duplicate export of audit_enabled
    Audit: do not print error when LSMs disabled
    ...

    Linus Torvalds
     

01 May, 2013

1 commit

  • The userspace audit tools didn't like the existing formatting of the
    AUDIT_ANOM_LINK event. It needed to be expanded to emit an AUDIT_PATH
    event as well, so this implements the change. The bulk of the patch is
    moving code out of auditsc.c into audit.c and audit.h for general use.
    It expands audit_log_name to include an optional "struct path" argument
    for the simple case of just needing to report a pathname. This also
    makes
    audit_log_task_info available when syscall auditing is not enabled,
    since
    it is needed in either case for process details.

    Signed-off-by: Kees Cook
    Reported-by: Steve Grubb

    Eric Paris
     

30 Apr, 2013

2 commits

  • The files which include kernel/audit.h are complied only when
    CONFIG_AUDIT is set.

    Just like audit_pid, there is no need to surround audit_ever_enabled
    with CONFIG_AUDIT.

    Signed-off-by: Gao feng
    Cc: Al Viro
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gao feng
     
  • audit_enabled has already been exported in include/linux/audit.h. and
    kernel/audit.h includes include/linux/audit.h, no need to export
    aduit_enabled again in kernel/audit.h

    Signed-off-by: Gao feng
    Cc: Al Viro
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gao feng
     

12 Apr, 2013

1 commit


12 Oct, 2012

3 commits

  • In the cases where we already know the length of the parent, pass it as
    a parm so we don't need to recompute it. In the cases where we don't
    know the length, pass in AUDIT_NAME_FULL (-1) to indicate that it should
    be determined.

    Signed-off-by: Jeff Layton
    Signed-off-by: Al Viro

    Jeff Layton
     
  • All the callers set this to NULL now.

    Signed-off-by: Jeff Layton
    Signed-off-by: Al Viro

    Jeff Layton
     
  • Currently, this gets set mostly by happenstance when we call into
    audit_inode_child. While that might be a little more efficient, it seems
    wrong. If the syscall ends up failing before audit_inode_child ever gets
    called, then you'll have an audit_names record that shows the full path
    but has the parent inode info attached.

    Fix this by passing in a parent flag when we call audit_inode that gets
    set to the value of LOOKUP_PARENT. We can then fix up the pathname for
    the audit entry correctly from the get-go.

    While we're at it, clean up the no-op macro for audit_inode in the
    !CONFIG_AUDITSYSCALL case.

    Signed-off-by: Jeff Layton
    Signed-off-by: Al Viro

    Jeff Layton
     

18 Sep, 2012

1 commit

  • - Explicitly format uids gids in audit messges in the initial user
    namespace. This is safe because auditd is restrected to be in
    the initial user namespace.

    - Convert audit_sig_uid into a kuid_t.

    - Enable building the audit code and user namespaces at the same time.

    The net result is that the audit subsystem now uses kuid_t and kgid_t whenever
    possible making it almost impossible to confuse a raw uid_t with a kuid_t
    preventing bugs.

    Cc: Al Viro
    Cc: Eric Paris
    Cc: Greg Kroah-Hartman
    Signed-off-by: Eric W. Biederman

    Eric W. Biederman