1. 23 6月, 2006 24 次提交
    • A
      [PATCH] CONFIG_NET=n build fix · 57ae2508
      Andrew Morton 提交于
      Cc: Greg KH <greg@kroah.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      57ae2508
    • A
      83d4e6e7
    • D
      [PATCH] invert irq/migration.c brach prediction · 89d0cf01
      Daniel Walker 提交于
      If you get to that point in the code it means that desc->move_irq is set,
      pending_irq_cpumask[irq] and cpu_online_map should have a value.  Still
      pretty good chance anding those two you'll still have a value.  So these
      two branch predictors should be inverted.
      Signed-off-by: NDaniel Walker <dwalker@mvista.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      89d0cf01
    • I
      [PATCH] cond_resched() might_sleep() fix · 8e0a43d8
      Ingo Molnar 提交于
      add the __might_sleep() check back to cond_resched().
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8e0a43d8
    • P
      [PATCH] dup fd error fix · 6e667260
      Prasanna Meda 提交于
      Set errorp in dup_fd, it will be used in sys_unshare also.
      Signed-off-by: NPrasanna Meda <mlp@google.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6e667260
    • A
      [PATCH] mmput() might sleep · 0ae26f1b
      Andrew Morton 提交于
      exit_aio() and exit_mmap() can sleep.  But it's easy to accidentally call
      mmput() from inside locks.
      
      Cc: Dave Peterson <dsp@llnl.gov>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0ae26f1b
    • J
      [PATCH] Add a sysfs file to determine if a kexec kernel is loaded · c330dda9
      Jeff Moyer 提交于
      Create two files in /sys/kernel, kexec_loaded and kexec_crash_loaded.  Each
      file contains a simple boolean value indicating whether the relevant kernel
      has been loaded into memory.  The motivation for this is geared around
      support.
      Signed-off-by: NJeff Moyer <jmoyer@redhat.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c330dda9
    • R
      [PATCH] swsusp: use less memory during resume · 968808b8
      Rafael J. Wysocki 提交于
      Make swsusp allocate only as much memory as needed to store the image data
      and metadata during resume.
      
      Without this patch swsusp additionally allocates many page frames that will
      conflict with the "original" locations of the image data and are considered
      as "unsafe", treating them as "eaten" pages (ie.  allocated but unusable).
      
      The patch makes swsusp allocate as many pages as it'll need to store the
      data read from the image in one shot, creating a list of allocated "safe"
      pages, and use the observation that all pages allocated by it are marked
      with the PG_nosave and PG_nosave_free flags set.   Namely, when it's about
      to load an image page, swsusp can check whether the page frame
      corresponding to the "original" location of this page has been allocated
      (ie.  if the page frame has the PG_nosave and PG_nosave_free flags set) and
      if so, it can load the page directly into this page frame.   Otherwise it
      uses an allocated "safe" page from the list to store the data that will be
      copied to their "original" location later on.
      
      This allows us to save many page copyings and page allocations during
      resume and in the future it may allow us to load images greater than 50% of
      the normal zone.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: N"Pavel Machek" <pavel@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      968808b8
    • A
      [PATCH] kernel/power/snapshot.c: cleanups · 7bff24e2
      Adrian Bunk 提交于
      - make needlessly global functions static
      - make dummy functions static inline
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7bff24e2
    • R
      [PATCH] swsusp: take lowmem reserves into account · a938c356
      Rafael J. Wysocki 提交于
      swsusp allocates memory from the normal zone, so it cannot use lowmem
      reserve pages from the lower zones.  Therefore it should not count these
      pages as available to it.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a938c356
    • S
      [PATCH] swsusp: add architecture special saveable pages support · ce4ab001
      Shaohua Li 提交于
      1. Add architecture specific pages save/restore support.  Next two patches
         will use this to save/restore 'ACPI NVS' pages.
      
      2. Allow reserved pages 'nosave'.  This could avoid save/restore BIOS
         reserved pages.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Nigel Cunningham <nigel@suspend2.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ce4ab001
    • Z
      [PATCH] x86: kernel irq balance doesn't work · 1b61b910
      Zhang Yanmin 提交于
      On i386, kernel irq balance doesn't work.
      
      1) In function do_irq_balance, after kernel finds the min_loaded cpu but
         before calling set_pending_irq to really pin the selected_irq to the
         target cpu, kernel does a cpus_and with irq_affinity[selected_irq].
         Later on, when the irq is acked, kernel would calls
         move_native_irq=>desc->handler->set_affinity to change the irq affinity.
          However, every function pointed by
         hw_interrupt_type->set_affinity(unsigned int irq, cpumask_t cpumask)
         always changes irq_affinity[irq] to cpumask.  Next time when recalling
         do_irq_balance, it has to do cpu_ands again with
         irq_affinity[selected_irq], but irq_affinity[selected_irq] already
         becomes one cpu selected by the first irq balance.
      
      2) Function balance_irq in file arch/i386/kernel/io_apic.c has the same
         issue.
      
      [akpm@osdl.org: cleanups]
      Signed-off-by: NZhang Yanmin <yanmin.zhang@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1b61b910
    • D
      [PATCH] SELinux: add security hook call to mediate attach_task (kernel/cpuset.c) · 22fb52dd
      David Quigley 提交于
      Add a security hook call to enable security modules to control the ability
      to attach a task to a cpuset.  While limited control over this operation is
      possible via permission checks on the pseudo fs interface, those checks are
      not sufficient to control access to the target task, which is looked up in
      this function.  The existing task_setscheduler hook is re-used for this
      operation since this falls under the same class of operations.
      Signed-off-by: NDavid Quigley <dpquigl@tycho.nsa.gov>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      Acked-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      22fb52dd
    • D
      [PATCH] SELinux: add security hooks to {get,set}affinity · e7834f8f
      David Quigley 提交于
      This patch adds LSM hooks into the setaffinity and getaffinity functions to
      enable security modules to control these operations between tasks with
      task_setscheduler and task_getscheduler LSM hooks.
      Signed-off-by: NDavid Quigley <dpquigl@tycho.nsa.gov>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e7834f8f
    • C
      [PATCH] move_pages: fix 32 -> 64 bit compat function · 9216dfad
      Christoph Lameter 提交于
      The definition of the third parameter is a pointer to an array of virtual
      addresses which give us some trouble.  The existing code calculated the
      wrong address in the array since I used void to avoid having to specify a
      type.
      
      I now use the correct type "compat_uptr_t __user *" in the definition of
      the function in kernel/compat.c.
      
      However, I used __u32 in syscalls.h.  Would have to include compat.h there
      in order to provide the same definition which would generate an ugly
      include situation.
      
      On both ia64 and x86_64 compat_uptr_t is u32. So this works although
      parameter declarations differ.
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9216dfad
    • C
      [PATCH] sys_move_pages: 32bit support (i386, x86_64) · 1b2db9fb
      Christoph Lameter 提交于
      sys_move_pages() support for 32bit (i386 plus x86_64 compat layer)
      
      Add support for move_pages() on i386 and also add the compat functions
      necessary to run 32 bit binaries on x86_64.
      
      Add compat_sys_move_pages to the x86_64 32bit binary layer.  Note that it is
      not up to date so I added the missing pieces.  Not sure if this is done the
      right way.
      
      [akpm@osdl.org: compile fix]
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Andi Kleen <ak@muc.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1b2db9fb
    • C
      [PATCH] page migration: sys_move_pages(): support moving of individual pages · 742755a1
      Christoph Lameter 提交于
      move_pages() is used to move individual pages of a process. The function can
      be used to determine the location of pages and to move them onto the desired
      node. move_pages() returns status information for each page.
      
      long move_pages(pid, number_of_pages_to_move,
      		addresses_of_pages[],
      		nodes[] or NULL,
      		status[],
      		flags);
      
      The addresses of pages is an array of void * pointing to the
      pages to be moved.
      
      The nodes array contains the node numbers that the pages should be moved
      to. If a NULL is passed instead of an array then no pages are moved but
      the status array is updated. The status request may be used to determine
      the page state before issuing another move_pages() to move pages.
      
      The status array will contain the state of all individual page migration
      attempts when the function terminates. The status array is only valid if
      move_pages() completed successfullly.
      
      Possible page states in status[]:
      
      0..MAX_NUMNODES	The page is now on the indicated node.
      
      -ENOENT		Page is not present
      
      -EACCES		Page is mapped by multiple processes and can only
      		be moved if MPOL_MF_MOVE_ALL is specified.
      
      -EPERM		The page has been mlocked by a process/driver and
      		cannot be moved.
      
      -EBUSY		Page is busy and cannot be moved. Try again later.
      
      -EFAULT		Invalid address (no VMA or zero page).
      
      -ENOMEM		Unable to allocate memory on target node.
      
      -EIO		Unable to write back page. The page must be written
      		back in order to move it since the page is dirty and the
      		filesystem does not provide a migration function that
      		would allow the moving of dirty pages.
      
      -EINVAL		A dirty page cannot be moved. The filesystem does not provide
      		a migration function and has no ability to write back pages.
      
      The flags parameter indicates what types of pages to move:
      
      MPOL_MF_MOVE	Move pages that are only mapped by the process.
      
      MPOL_MF_MOVE_ALL Also move pages that are mapped by multiple processes.
      		Requires sufficient capabilities.
      
      Possible return codes from move_pages()
      
      -ENOENT		No pages found that would require moving. All pages
      		are either already on the target node, not present, had an
      		invalid address or could not be moved because they were
      		mapped by multiple processes.
      
      -EINVAL		Flags other than MPOL_MF_MOVE(_ALL) specified or an attempt
      		to migrate pages in a kernel thread.
      
      -EPERM		MPOL_MF_MOVE_ALL specified without sufficient priviledges.
      		or an attempt to move a process belonging to another user.
      
      -EACCES		One of the target nodes is not allowed by the current cpuset.
      
      -ENODEV		One of the target nodes is not online.
      
      -ESRCH		Process does not exist.
      
      -E2BIG		Too many pages to move.
      
      -ENOMEM		Not enough memory to allocate control array.
      
      -EFAULT		Parameters could not be accessed.
      
      A test program for move_pages() may be found with the patches
      on ftp.kernel.org:/pub/linux/kernel/people/christoph/pmig/patches-2.6.17-rc4-mm3
      
      From: Christoph Lameter <clameter@sgi.com>
      
        Detailed results for sys_move_pages()
      
        Pass a pointer to an integer to get_new_page() that may be used to
        indicate where the completion status of a migration operation should be
        placed.  This allows sys_move_pags() to report back exactly what happened to
        each page.
      
        Wish there would be a better way to do this. Looks a bit hacky.
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Jes Sorensen <jes@trained-monkey.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Michael Kerrisk <mtk-manpages@gmx.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      742755a1
    • R
      [PATCH] swsusp: rework memory shrinker · d6277db4
      Rafael J. Wysocki 提交于
      Rework the swsusp's memory shrinker in the following way:
      
      - Simplify balance_pgdat() by removing all of the swsusp-related code
        from it.
      
      - Make shrink_all_memory() use shrink_slab() and a new function
        shrink_all_zones() which calls shrink_active_list() and
        shrink_inactive_list() directly for each zone in a way that's optimized
        for suspend.
      
      In shrink_all_memory() we try to free exactly as many pages as the caller
      asks for, preferably in one shot, starting from easier targets.   If slab
      caches are huge, they are most likely to have enough pages to reclaim.
       The inactive lists are next (the zones with more inactive pages go first)
      etc.
      
      Each time shrink_all_memory() attempts to shrink the active and inactive
      lists for each zone in 5 passes.   In the first pass, only the inactive
      lists are taken into consideration.   In the next two passes the active
      lists are also shrunk, but mapped pages are not reclaimed.   In the last
      two passes the active and inactive lists are shrunk and mapped pages are
      reclaimed as well.  The aim of this is to alter the reclaim logic to choose
      the best pages to keep on resume and improve the responsiveness of the
      resumed system.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NCon Kolivas <kernel@kolivas.org>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d6277db4
    • K
      [PATCH] support for panic at OOM · fadd8fbd
      KAMEZAWA Hiroyuki 提交于
      This patch adds panic_on_oom sysctl under sys.vm.
      
      When sysctl vm.panic_on_oom = 1, the kernel panics intead of killing rogue
      processes.  And if vm.panic_on_oom is 0 the kernel will do oom_kill() in
      the same way as it does today.  Of course, the default value is 0 and only
      root can modifies it.
      
      In general, oom_killer works well and kill rogue processes.  So the whole
      system can survive.  But there are environments where panic is preferable
      rather than kill some processes.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      fadd8fbd
    • D
      [PATCH] VFS: Permit filesystem to perform statfs with a known root dentry · 726c3342
      David Howells 提交于
      Give the statfs superblock operation a dentry pointer rather than a superblock
      pointer.
      
      This complements the get_sb() patch.  That reduced the significance of
      sb->s_root, allowing NFS to place a fake root there.  However, NFS does
      require a dentry to use as a target for the statfs operation.  This permits
      the root in the vfsmount to be used instead.
      
      linux/mount.h has been added where necessary to make allyesconfig build
      successfully.
      
      Interest has also been expressed for use with the FUSE and XFS filesystems.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: Nathan Scott <nathans@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      726c3342
    • D
      [PATCH] VFS: Permit filesystem to override root dentry on mount · 454e2398
      David Howells 提交于
      Extend the get_sb() filesystem operation to take an extra argument that
      permits the VFS to pass in the target vfsmount that defines the mountpoint.
      
      The filesystem is then required to manually set the superblock and root dentry
      pointers.  For most filesystems, this should be done with simple_set_mnt()
      which will set the superblock pointer and then set the root dentry to the
      superblock's s_root (as per the old default behaviour).
      
      The get_sb() op now returns an integer as there's now no need to return the
      superblock pointer.
      
      This patch permits a superblock to be implicitly shared amongst several mount
      points, such as can be done with NFS to avoid potential inode aliasing.  In
      such a case, simple_set_mnt() would not be called, and instead the mnt_root
      and mnt_sb would be set directly.
      
      The patch also makes the following changes:
      
       (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
           pointer argument and return an integer, so most filesystems have to change
           very little.
      
       (*) If one of the convenience function is not used, then get_sb() should
           normally call simple_set_mnt() to instantiate the vfsmount. This will
           always return 0, and so can be tail-called from get_sb().
      
       (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
           dcache upon superblock destruction rather than shrink_dcache_anon().
      
           This is required because the superblock may now have multiple trees that
           aren't actually bound to s_root, but that still need to be cleaned up. The
           currently called functions assume that the whole tree is rooted at s_root,
           and that anonymous dentries are not the roots of trees which results in
           dentries being left unculled.
      
           However, with the way NFS superblock sharing are currently set to be
           implemented, these assumptions are violated: the root of the filesystem is
           simply a dummy dentry and inode (the real inode for '/' may well be
           inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
           with child trees.
      
           [*] Anonymous until discovered from another tree.
      
       (*) The documentation has been adjusted, including the additional bit of
           changing ext2_* into foo_* in the documentation.
      
      [akpm@osdl.org: convert ipath_fs, do other stuff]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: Nathan Scott <nathans@sgi.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      454e2398
    • R
      [PATCH] avoid tasklist_lock at getrusage for multithreaded case too · de047c1b
      Ravikiran G Thirumalai 提交于
      Avoid taking tasklist_lock for at getrusage for the multithreaded case too.
      We don't need to take the tasklist lock for thread traversal of a process
      since Oleg's do-__unhash_process-under-siglock.patch and related work.
      Signed-off-by: NRavikiran Thirumalai <kiran@scalex86.org>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      de047c1b
    • A
      [PATCH] suspend_console() warning fix · 6cc07191
      Andrew Morton 提交于
      kernel/power/main.c: In function 'suspend_prepare':
      kernel/power/main.c:89: warning: implicit declaration of function 'suspend_console'
      kernel/power/main.c: In function 'suspend_finish':
      kernel/power/main.c:137: warning: implicit declaration of function 'resume_console'
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6cc07191
    • M
      [PATCH] selinux: add hooks for key subsystem · d720024e
      Michael LeMay 提交于
      Introduce SELinux hooks to support the access key retention subsystem
      within the kernel.  Incorporate new flask headers from a modified version
      of the SELinux reference policy, with support for the new security class
      representing retained keys.  Extend the "key_alloc" security hook with a
      task parameter representing the intended ownership context for the key
      being allocated.  Attach security information to root's default keyrings
      within the SELinux initialization routine.
      
      Has passed David's testsuite.
      Signed-off-by: NMichael LeMay <mdlemay@epoch.ncsc.mil>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d720024e
  2. 20 6月, 2006 16 次提交
    • S
      [PATCH] make set_loginuid obey audit_enabled · 41757106
      Steve Grubb 提交于
      Hi,
      
      I was doing some testing and noticed that when the audit system was disabled,
      I was still getting messages about the loginuid being set. The following patch
      makes audit_set_loginuid look at in_syscall to determine if it should create
      an audit event. The loginuid will continue to be set as long as there is a context.
      Signed-off-by: NSteve Grubb <sgrubb@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      41757106
    • A
      [PATCH] log more info for directory entry change events · 9c937dcc
      Amy Griffis 提交于
      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: NAmy Griffis <amy.griffis@hp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9c937dcc
    • A
      [PATCH] fix AUDIT_FILTER_PREPEND handling · 6a2bceec
      Amy Griffis 提交于
      Clear AUDIT_FILTER_PREPEND flag after adding rule to list.  This
      fixes three problems when a rule is added with the -A syntax:
      
          - auditctl displays filter list as "(null)"
          - the rule cannot be removed using -d
          - a duplicate rule can be added with -a
      Signed-off-by: NAmy Griffis <amy.griffis@hp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6a2bceec
    • A
      [PATCH] validate rule fields' types · 0a73dccc
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0a73dccc
    • A
      [PATCH] audit: path-based rules · f368c07d
      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/145Signed-off-by: NAmy Griffis <amy.griffis@hp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f368c07d
    • G
      [PATCH] Audit of POSIX Message Queue Syscalls v.2 · 20ca73bc
      George C. Wilson 提交于
      This patch adds audit support to POSIX message queues.  It applies cleanly to
      the lspp.b15 branch of Al Viro's git tree.  There are new auxiliary data
      structures, and collection and emission routines in kernel/auditsc.c.  New hooks
      in ipc/mqueue.c collect arguments from the syscalls.
      
      I tested the patch by building the examples from the POSIX MQ library tarball.
      Build them -lrt, not against the old MQ library in the tarball.  Here's the URL:
      http://www.geocities.com/wronski12/posix_ipc/libmqueue-4.41.tar.gz
      Do auditctl -a exit,always -S for mq_open, mq_timedsend, mq_timedreceive,
      mq_notify, mq_getsetattr.  mq_unlink has no new hooks.  Please see the
      corresponding userspace patch to get correct output from auditd for the new
      record types.
      
      [fixes folded]
      Signed-off-by: NGeorge Wilson <ltcgcw@us.ibm.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      20ca73bc
    • A
      [PATCH] deprecate AUDIT_POSSBILE · 014149cc
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      014149cc
    • A
      [PATCH] inline more audit helpers · d8945bb5
      Al Viro 提交于
      pull checks for ->audit_context into inlined wrappers
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d8945bb5
    • L
      [PATCH] update of IPC audit record cleanup · ac03221a
      Linda Knippers 提交于
      The following patch addresses most of the issues with the IPC_SET_PERM
      records as described in:
      https://www.redhat.com/archives/linux-audit/2006-May/msg00010.html
      and addresses the comments I received on the record field names.
      
      To summarize, I made the following changes:
      
      1. Changed sys_msgctl() and semctl_down() so that an IPC_SET_PERM
         record is emitted in the failure case as well as the success case.
         This matches the behavior in sys_shmctl().  I could simplify the
         code in sys_msgctl() and semctl_down() slightly but it would mean
         that in some error cases we could get an IPC_SET_PERM record
         without an IPC record and that seemed odd.
      
      2. No change to the IPC record type, given no feedback on the backward
         compatibility question.
      
      3. Removed the qbytes field from the IPC record.  It wasn't being
         set and when audit_ipc_obj() is called from ipcperms(), the
         information isn't available.  If we want the information in the IPC
         record, more extensive changes will be necessary.  Since it only
         applies to message queues and it isn't really permission related, it
         doesn't seem worth it.
      
      4. Removed the obj field from the IPC_SET_PERM record.  This means that
         the kern_ipc_perm argument is no longer needed.
      
      5. Removed the spaces and renamed the IPC_SET_PERM field names.  Replaced iuid and
         igid fields with ouid and ogid in the IPC record.
      
      I tested this with the lspp.22 kernel on an x86_64 box.  I believe it
      applies cleanly on the latest kernel.
      
      -- ljk
      Signed-off-by: NLinda Knippers <linda.knippers@hp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      ac03221a
    • S
      [PATCH] minor audit updates · 5d136a01
      Serge E. Hallyn 提交于
      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 <0 is checked for.  So just return 0.
      
      propagate audit_set_rate_limit and audit_set_backlog_limit
      error values
      
      In audit_buffer_free, the audit_freelist_count was being
      incremented even when we discard the return buffer, so
      audit_freelist_count can end up wrong.  This could cause
      the actual freelist to shrink over time, eventually
      threatening to degrate audit performance.
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5d136a01
    • A
      [PATCH] fix audit_krule_to_{rule,data} return values · 0a3b483e
      Amy Griffis 提交于
      Don't return -ENOMEM when callers of these functions are checking for
      a NULL return.  Bug noticed by Serge Hallyn.
      Signed-off-by: NAmy Griffis <amy.griffis@hp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0a3b483e
    • A
      [PATCH] add filtering by ppid · 3c66251e
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      3c66251e
    • A
      [PATCH] log ppid · f46038ff
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f46038ff
    • A
      [PATCH] collect sid of those who send signals to auditd · e1396065
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e1396065
    • A
      [PATCH] execve argument logging · 473ae30b
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      473ae30b
    • A
      [PATCH] fix deadlocks in AUDIT_LIST/AUDIT_LIST_RULES · 9044e6bc
      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: NAl Viro <viro@zeniv.linux.org.uk>
      9044e6bc