1. 20 6月, 2006 2 次提交
    • 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
    • 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
  2. 01 5月, 2006 1 次提交
    • S
      [PATCH] Rework of IPC auditing · 073115d6
      Steve Grubb 提交于
      1) The audit_ipc_perms() function has been split into two different
      functions:
              - audit_ipc_obj()
              - audit_ipc_set_perm()
      
      There's a key shift here...  The audit_ipc_obj() collects the uid, gid,
      mode, and SElinux context label of the current ipc object.  This
      audit_ipc_obj() hook is now found in several places.  Most notably, it
      is hooked in ipcperms(), which is called in various places around the
      ipc code permforming a MAC check.  Additionally there are several places
      where *checkid() is used to validate that an operation is being
      performed on a valid object while not necessarily having a nearby
      ipcperms() call.  In these locations, audit_ipc_obj() is called to
      ensure that the information is captured by the audit system.
      
      The audit_set_new_perm() function is called any time the permissions on
      the ipc object changes.  In this case, the NEW permissions are recorded
      (and note that an audit_ipc_obj() call exists just a few lines before
      each instance).
      
      2) Support for an AUDIT_IPC_SET_PERM audit message type.  This allows
      for separate auxiliary audit records for normal operations on an IPC
      object and permissions changes.  Note that the same struct
      audit_aux_data_ipcctl is used and populated, however there are separate
      audit_log_format statements based on the type of the message.  Finally,
      the AUDIT_IPC block of code in audit_free_aux() was extended to handle
      aux messages of this new type.  No more mem leaks I hope ;-)
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      073115d6
  3. 18 4月, 2006 2 次提交
    • A
      [PATCH] IPC: access to unmapped vmalloc area in grow_ary() · a9a5cd5d
      Alexey Kuznetsov 提交于
      grow_ary() should not copy struct ipc_id_ary (it copies new->p, not
      new). Due to this, memcpy() src pointer could hit unmapped vmalloc page
      when near page boundary.
      
      Found during OpenVZ stress testing
      Signed-off-by: NAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Signed-off-by: NKirill Korotaev <dev@openvz.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a9a5cd5d
    • H
      [PATCH] shmat: stop mprotect from giving write permission to a readonly attachment (CVE-2006-1524) · b78b6af6
      Hugh Dickins 提交于
      I found that all of 2.4 and 2.6 have been letting mprotect give write
      permission to a readonly attachment of shared memory, whether or not IPC
      would give the caller that permission.
      
      SUS says "The behaviour of this function [mprotect] is unspecified if the
      mapping was not established by a call to mmap", but I don't think we can
      interpret that as allowing it to subvert IPC permissions.
      
      I haven't tried 2.2, but the 2.2.26 source looks like it gets it right; and
      the patch below reproduces that behaviour - mprotect cannot be used to add
      write permission to a shared memory segment attached readonly.
      
      This patch is simple, and I'm sure it's what we should have done in 2.4.0:
      if you want to go on to switch write permission on and off with mprotect,
      just don't attach the segment readonly in the first place.
      
      However, we could have accumulated apps which attach readonly (even though
      they would be permitted to attach read/write), and which subsequently use
      mprotect to switch write permission on and off: it's not unreasonable.
      
      I was going to add a second ipcperms check in do_shmat, to check for
      writable when readonly, and if not writable find_vma and clear VM_MAYWRITE.
       But security_ipc_permission might do auditing, and it seems wrong to
      report an attempt for write permission when there has been none.  Or we
      could flag the vma as SHM, note the shmid or shp in vm_private_data, and
      then get mprotect to check.
      
      But the patch below is a lot simpler: I'd rather stick with it, if we can
      convince ourselves somehow that it'll be safe.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b78b6af6
  4. 02 4月, 2006 1 次提交
  5. 01 4月, 2006 1 次提交
  6. 29 3月, 2006 1 次提交
  7. 27 3月, 2006 3 次提交
  8. 25 3月, 2006 1 次提交
  9. 24 3月, 2006 1 次提交
    • H
      [PATCH] shmdt: check address alignment · df1e2fb5
      Hugh Dickins 提交于
      SUSv3 says the shmdt() function shall fail with EINVAL if the value of
      shmaddr is not the data segment start address of a shared memory segment:
      our sys_shmdt needs to reject a shmaddr which is not page-aligned.
      
      Does it have the potential to break existing apps?
      
      Hugh says
      
        "sys_shmdt() just does the wrong (unexpected) thing with a misaligned
        address: it'll fail on what you might expect it to succeed on, and only
        succeed on what it should definitely fail on.
      
        "That is, I think it behaves as if shmaddr gets rounded up, when the only
        understandable behaviour would be if it rounded it down.
      
        "Which does mean you'd have to be devious to see anything but EINVAL from
        a misaligned shmaddr there, so it's not terribly important."
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      df1e2fb5
  10. 22 3月, 2006 1 次提交
  11. 21 3月, 2006 1 次提交
    • D
      [PATCH] Capture selinux subject/object context information. · 8c8570fb
      Dustin Kirkland 提交于
      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: NDustin Kirkland <dustin.kirkland@us.ibm.com>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      8c8570fb
  12. 11 2月, 2006 1 次提交
  13. 10 2月, 2006 1 次提交
    • A
      [NETLINK]: Fix a severe bug · a70ea994
      Alexey Kuznetsov 提交于
      netlink overrun was broken while improvement of netlink.
      Destination socket is used in the place where it was meant to be source socket,
      so that now overrun is never sent to user netlink sockets, when it should be,
      and it even can be set on kernel socket, which results in complete deadlock
      of rtnetlink.
      
      Suggested fix is to restore status quo passing source socket as additional
      argument to netlink_attachskb().
      
      A little explanation: overrun is set on a socket, when it failed
      to receive some message and sender of this messages does not or even
      have no way to handle this error. This happens in two cases:
      1. when kernel sends something. Kernel never retransmits and cannot
         wait for buffer space.
      2. when user sends a broadcast and the message was not delivered
         to some recipients.
      Signed-off-by: NAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a70ea994
  14. 15 1月, 2006 2 次提交
    • C
      correct email address of Manfred Spraul · 624dffcb
      Christian Kujau 提交于
      I  tried to send the forcedeth maintainer an email, but it came back with:
      
      "The mail address manfreds@colorfullife.com is not read anymore.
      Please resent your mail to manfred@ instead of manfreds@."
      
      This patch fixes this.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      624dffcb
    • A
      [PATCH] Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open · 7c7dce92
      Alexander Viro 提交于
      Fixed the refcounting on failure exits in sys_mq_open() and
      cleaned the logics up.  Rules are actually pretty simple - dentry_open()
      expects vfsmount and dentry to be pinned down and it either transfers
      them into created struct file or drops them.  Old code had been very
      confused in that area - if dentry_open() had failed either in do_open()
      or do_create(), we ended up dentry and mqueue_mnt dropped twice, once
      by dentry_open() cleanup and then by sys_mq_open().
      
      Fix consists of making the rules for do_create() and do_open()
      same as for dentry_open() and updating the sys_mq_open() accordingly;
      that actually leads to more straightforward code and less work on
      normal path.
      Signed-off-by: NAl Viro <aviro@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7c7dce92
  15. 12 1月, 2006 1 次提交
  16. 10 1月, 2006 1 次提交
  17. 09 1月, 2006 1 次提交
  18. 07 1月, 2006 1 次提交
    • D
      [PATCH] NOMMU: Make SYSV IPC SHM use ramfs facilities on NOMMU · b0e15190
      David Howells 提交于
      The attached patch makes the SYSV IPC shared memory facilities use the new
      ramfs facilities on a no-MMU kernel.
      
      The following changes are made:
      
       (1) There are now shmem_mmap() and shmem_get_unmapped_area() functions to
           allow the IPC SHM facilities to commune with the tiny-shmem and shmem
           code.
      
       (2) ramfs files now need resizing using do_truncate() rather than by modifying
           the inode size directly (see shmem_file_setup()). This causes ramfs to
           attempt to bind a block of pages of sufficient size to the inode.
      
       (3) CONFIG_SYSVIPC is no longer contingent on CONFIG_MMU.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b0e15190
  19. 25 12月, 2005 2 次提交
  20. 07 11月, 2005 3 次提交
  21. 30 10月, 2005 1 次提交
  22. 28 9月, 2005 1 次提交
  23. 11 9月, 2005 1 次提交
  24. 08 9月, 2005 3 次提交
  25. 06 8月, 2005 1 次提交
  26. 02 8月, 2005 1 次提交
  27. 13 7月, 2005 1 次提交
  28. 08 7月, 2005 1 次提交
  29. 24 6月, 2005 1 次提交
  30. 01 5月, 2005 1 次提交