08 Dec, 2006

1 commit


06 Oct, 2006

1 commit

  • Squash this warning:

    kernel/audit.c: In function 'kauditd_thread':
    kernel/audit.c:367: warning: no return statement in function returning non-void

    We might as test kthread_should_stop(), although it's not very pointful at
    present.

    The code which starts this thread looks racy - the kernel could start multiple
    threads.

    Cc: Al Viro
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

26 Sep, 2006

1 commit


12 Sep, 2006

1 commit


03 Aug, 2006

1 commit


30 Jun, 2006

1 commit

  • This patch encapsulates the usage of eff_cap (in netlink_skb_params) within
    the security framework by extending security_netlink_recv to include a required
    capability parameter and converting all direct usage of eff_caps outside
    of the lsm modules to use the interface. It also updates the SELinux
    implementation of the security_netlink_send and security_netlink_recv
    hooks to take advantage of the sid in the netlink_skb_params struct.
    This also enables SELinux to perform auditing of netlink capability checks.
    Please apply, for 2.6.18 if possible.

    Signed-off-by: Darrel Goeddel
    Signed-off-by: Stephen Smalley
    Acked-by: James Morris
    Signed-off-by: David S. Miller

    Darrel Goeddel
     

28 Jun, 2006

1 commit

  • locking init cleanups:

    - convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
    - convert rwlocks in a similar manner

    this patch was generated automatically.

    Motivation:

    - cleanliness
    - lockdep needs control of lock initialization, which the open-coded
    variants do not give
    - it's also useful for -rt and for lock debugging in general

    Signed-off-by: Ingo Molnar
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

20 Jun, 2006

6 commits

  • When an audit event involves changes to a directory entry, include
    a PATH record for the directory itself. A few other notable changes:

    - fixed audit_inode_child() hooks in fsnotify_move()
    - removed unused flags arg from audit_inode()
    - added audit log routines for logging a portion of a string

    Here's some sample output.

    before patch:
    type=SYSCALL msg=audit(1149821605.320:26): arch=40000003 syscall=39 success=yes exit=0 a0=bf8d3c7c a1=1ff a2=804e1b8 a3=bf8d3c7c items=1 ppid=739 pid=800 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttyS0 comm="mkdir" exe="/bin/mkdir" subj=root:system_r:unconfined_t:s0-s0:c0.c255
    type=CWD msg=audit(1149821605.320:26): cwd="/root"
    type=PATH msg=audit(1149821605.320:26): item=0 name="foo" parent=164068 inode=164010 dev=03:00 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=root:object_r:user_home_t:s0

    after patch:
    type=SYSCALL msg=audit(1149822032.332:24): arch=40000003 syscall=39 success=yes exit=0 a0=bfdd9c7c a1=1ff a2=804e1b8 a3=bfdd9c7c items=2 ppid=714 pid=777 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttyS0 comm="mkdir" exe="/bin/mkdir" subj=root:system_r:unconfined_t:s0-s0:c0.c255
    type=CWD msg=audit(1149822032.332:24): cwd="/root"
    type=PATH msg=audit(1149822032.332:24): item=0 name="/root" inode=164068 dev=03:00 mode=040750 ouid=0 ogid=0 rdev=00:00 obj=root:object_r:user_home_dir_t:s0
    type=PATH msg=audit(1149822032.332:24): item=1 name="foo" inode=164010 dev=03:00 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=root:object_r:user_home_t:s0

    Signed-off-by: Amy Griffis
    Signed-off-by: Al Viro

    Amy Griffis
     
  • In this implementation, audit registers inotify watches on the parent
    directories of paths specified in audit rules. When audit's inotify
    event handler is called, it updates any affected rules based on the
    filesystem event. If the parent directory is renamed, removed, or its
    filesystem is unmounted, audit removes all rules referencing that
    inotify watch.

    To keep things simple, this implementation limits location-based
    auditing to the directory entries in an existing directory. Given
    a path-based rule for /foo/bar/passwd, the following table applies:

    passwd modified -- audit event logged
    passwd replaced -- audit event logged, rules list updated
    bar renamed -- rule removed
    foo renamed -- untracked, meaning that the rule now applies to
    the new location

    Audit users typically want to have many rules referencing filesystem
    objects, which can significantly impact filtering performance. This
    patch also adds an inode-number-based rule hash to mitigate this
    situation.

    The patch is relative to the audit git tree:
    http://kernel.org/git/?p=linux/kernel/git/viro/audit-current.git;a=summary
    and uses the inotify kernel API:
    http://lkml.org/lkml/2006/6/1/145

    Signed-off-by: Amy Griffis
    Signed-off-by: Al Viro

    Amy Griffis
     
  • Just a few minor proposed updates. Only the last one will
    actually affect behavior. The rest are just misleading
    code.

    Several AUDIT_SET functions return 'old' value, but only
    return value
    Signed-off-by: Al Viro

    Serge E. Hallyn
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • We should not send a pile of replies while holding audit_netlink_mutex
    since we hold the same mutex when we receive commands. As the result,
    we can get blocked while sending and sit there holding the mutex while
    auditctl is unable to send the next command and get around to receiving
    what we'd sent.

    Solution: create skb and put them into a queue instead of sending;
    once we are done, send what we've got on the list. The former can
    be done synchronously while we are handling AUDIT_LIST or AUDIT_LIST_RULES;
    we are holding audit_netlink_mutex at that point. The latter is done
    asynchronously and without messing with audit_netlink_mutex.

    Signed-off-by: Al Viro

    Al Viro
     

01 May, 2006

3 commits

  • Hi,

    The patch below builds upon the patch sent earlier and adds subject label to
    all audit events generated via the netlink interface. It also cleans up a few
    other minor things.

    Signed-off-by: Steve Grubb

    Signed-off-by: Al Viro

    Steve Grubb
     
  • The below patch should be applied after the inode and ipc sid patches.
    This patch is a reworking of Tim's patch that has been updated to match
    the inode and ipc patches since its similar.

    [updated:
    > Stephen Smalley also wanted to change a variable from isec to tsec in the
    > user sid patch. ]

    Signed-off-by: Steve Grubb
    Signed-off-by: Al Viro

    Steve Grubb
     
  • This patch provides the ability to filter audit messages based on the
    elements of the process' SELinux context (user, role, type, mls sensitivity,
    and mls clearance). It uses the new interfaces from selinux to opaquely
    store information related to the selinux context and to filter based on that
    information. It also uses the callback mechanism provided by selinux to
    refresh the information when a new policy is loaded.

    Signed-off-by: Al Viro

    Darrel Goeddel
     

01 Apr, 2006

1 commit

  • The boot cmdline is parsed in parse_early_param() and
    parse_args(,unknown_bootoption).

    And __setup() is used in obsolete_checksetup().

    start_kernel()
    -> parse_args()
    -> unknown_bootoption()
    -> obsolete_checksetup()

    If __setup()'s callback (->setup_func()) returns 1 in
    obsolete_checksetup(), obsolete_checksetup() thinks a parameter was
    handled.

    If ->setup_func() returns 0, obsolete_checksetup() tries other
    ->setup_func(). If all ->setup_func() that matched a parameter returns 0,
    a parameter is seted to argv_init[].

    Then, when runing /sbin/init or init=app, argv_init[] is passed to the app.
    If the app doesn't ignore those arguments, it will warning and exit.

    This patch fixes a wrong usage of it, however fixes obvious one only.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

21 Mar, 2006

9 commits

  • Make audit_init() failure path handle situations where the audit_panic()
    action is not AUDIT_FAIL_PANIC (default is AUDIT_FAIL_PRINTK). Other uses
    of audit_sock are not reached unless audit's netlink message handler is
    properly registered. Bug noticed by Peter Staubach.

    Signed-off-by: Amy Griffis
    Signed-off-by: Al Viro

    Amy Griffis
     
  • Hi,

    This is a trivial patch that enables the possibility of using some auditing
    functions within loadable kernel modules (ie. inside a Linux Security Module).

    _

    Make the audit_log_start, audit_log_end, audit_format and audit_log
    interfaces available to Loadable Kernel Modules, thus making possible
    the usage of the audit framework inside LSMs, etc.

    Signed-off-by: >
    Signed-off-by: Al Viro

    lorenzo@gnu.org
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Ingo Molnar
     
  • Updated patch to dynamically allocate audit rule fields in kernel's
    internal representation. Added unlikely() calls for testing memory
    allocation result.

    Amy Griffis wrote: [Wed Jan 11 2006, 02:02:31PM EST]
    > Modify audit's kernel-userspace interface to allow the specification
    > of string fields in audit rules.
    >
    > Signed-off-by: Amy Griffis

    Signed-off-by: Al Viro
    (cherry picked from 5ffc4a863f92351b720fe3e9c5cd647accff9e03 commit)

    Amy Griffis
     
  • This fixes the per-user and per-message-type filtering when syscall
    auditing isn't enabled.

    [AV: folded followup fix from the same author]

    Signed-off-by: David Woodhouse
    Signed-off-by: Al Viro

    David Woodhouse
     
  • This patch extends existing audit records with subject/object context
    information. Audit records associated with filesystem inodes, ipc, and
    tasks now contain SELinux label information in the field "subj" if the
    item is performing the action, or in "obj" if the item is the receiver
    of an action.

    These labels are collected via hooks in SELinux and appended to the
    appropriate record in the audit code.

    This additional information is required for Common Criteria Labeled
    Security Protection Profile (LSPP).

    [AV: fixed kmalloc flags use]
    [folded leak fixes]
    [folded cleanup from akpm (kfree(NULL)]
    [folded audit_inode_context() leak fix]
    [folded akpm's fix for audit_ipc_perm() definition in case of !CONFIG_AUDIT]

    Signed-off-by: Dustin Kirkland
    Signed-off-by: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Dustin Kirkland
     
  • - Add a new, 5th filter called "exclude".
    - And add a new field AUDIT_MSGTYPE.
    - Define a new function audit_filter_exclude() that takes a message type
    as input and examines all rules in the filter. It returns '1' if the
    message is to be excluded, and '0' otherwise.
    - Call the audit_filter_exclude() function near the top of
    audit_log_start() just after asserting audit_initialized. If the
    message type is not to be audited, return NULL very early, before
    doing a lot of work.
    [combined with followup fix for bug in original patch, Nov 4, same author]
    [combined with later renaming AUDIT_FILTER_EXCLUDE->AUDIT_FILTER_TYPE
    and audit_filter_exclude() -> audit_filter_type()]

    Signed-off-by: Dustin Kirkland
    Signed-off-by: David Woodhouse
    Signed-off-by: Al Viro

    Dustin Kirkland
     
  • The attached patch updates various items for the new user space
    messages. Please apply.

    Signed-off-by: Steve Grubb
    Signed-off-by: David Woodhouse

    Steve Grubb
     
  • - add kerneldoc for non-static functions;
    - don't init static data to 0;
    - limit lines to < 80 columns;
    - fix long-format style;
    - delete whitespace at end of some lines;

    (chrisw: resend and update to current audit-2.6 tree)

    Signed-off-by: Randy Dunlap
    Signed-off-by: Chris Wright
    Signed-off-by: David Woodhouse

    Randy Dunlap
     

19 Jan, 2006

1 commit

  • EDAC requires a way to scrub memory if an ECC error is found and the chipset
    does not do the work automatically. That means rewriting memory locations
    atomically with respect to all CPUs _and_ bus masters. That means we can't
    use atomic_add(foo, 0) as it gets optimised for non-SMP

    This adds a function to include/asm-foo/atomic.h for the platforms currently
    supported which implements a scrub of a mapped block.

    It also adjusts a few other files include order where atomic.h is included
    before types.h as this now causes an error as atomic_scrub uses u32.

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     

09 Jan, 2006

1 commit

  • This patch contains the following cleanups:
    - make needlessly global functions static
    - every file should include the headers containing the prototypes for
    it's global functions

    Signed-off-by: Adrian Bunk
    Acked-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

13 Dec, 2005

1 commit

  • kauditd was causing suspends to fail because it refused to freeze. Adding
    a try_to_freeze() to its sleep loop solves the issue.

    Signed-off-by: Pierre Ossman
    Acked-by: Pavel Machek
    Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pierre Ossman
     

28 Oct, 2005

1 commit


09 Oct, 2005

1 commit

  • - added typedef unsigned int __nocast gfp_t;

    - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
    the same warnings as far as sparse is concerned, doesn't change
    generated code (from gcc point of view we replaced unsigned int with
    typedef) and documents what's going on far better.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

14 Sep, 2005

1 commit


30 Aug, 2005

2 commits


17 Aug, 2005

1 commit

  • The following patch against audit.81 prevents duplicate syscall rules in
    a given filter list by walking the list on each rule add.

    I also removed the unused struct audit_entry in audit.c and made the
    static inlines in auditsc.c consistent.

    Signed-off-by: Amy Griffis
    Signed-off-by: David Woodhouse

    Amy Griffis
     

19 Jul, 2005

1 commit


15 Jul, 2005

1 commit


14 Jul, 2005

1 commit


02 Jul, 2005

1 commit

  • We force a rate-limit on auditable events by making them wait for space
    on the backlog queue. However, if auditd really is AWOL then this could
    potentially bring the entire system to a halt, depending on the audit
    rules in effect.

    Firstly, make sure the wait time is honoured correctly -- it's the
    maximum time the process should wait, rather than the time to wait
    _each_ time round the loop. We were getting re-woken _each_ time a
    packet was dequeued, and the timeout was being restarted each time.

    Secondly, reset the wait time after audit_panic() is called. In general
    this will be reset to zero, to allow progress to be made. If the system
    is configured to _actually_ panic on audit_panic() then that will
    already have happened; otherwise we know that audit records are being
    lost anyway.

    These two tunables can't be exposed via AUDIT_GET and AUDIT_SET because
    those aren't particularly well-designed. It probably should have been
    done by sysctls or sysfs anyway -- one for a later patch.

    Signed-off-by: David Woodhouse

    David Woodhouse
     

25 Jun, 2005

1 commit