1. 13 3月, 2010 1 次提交
  2. 04 3月, 2010 6 次提交
  3. 17 12月, 2009 1 次提交
  4. 22 9月, 2009 1 次提交
  5. 29 6月, 2009 1 次提交
  6. 07 4月, 2009 3 次提交
    • S
      namespaces: mqueue namespace: adapt sysctl · bdc8e5f8
      Serge E. Hallyn 提交于
      Largely inspired from ipc/ipc_sysctl.c.  This patch isolates the mqueue
      sysctl stuff in its own file.
      
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: NCedric Le Goater <clg@fr.ibm.com>
      Signed-off-by: NNadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bdc8e5f8
    • S
      namespaces: ipc namespaces: implement support for posix msqueues · 7eafd7c7
      Serge E. Hallyn 提交于
      Implement multiple mounts of the mqueue file system, and link it to usage
      of CLONE_NEWIPC.
      
      Each ipc ns has a corresponding mqueuefs superblock.  When a user does
      clone(CLONE_NEWIPC) or unshare(CLONE_NEWIPC), the unshare will cause an
      internal mount of a new mqueuefs sb linked to the new ipc ns.
      
      When a user does 'mount -t mqueue mqueue /dev/mqueue', he mounts the
      mqueuefs superblock.
      
      Posix message queues can be worked with both through the mq_* system calls
      (see mq_overview(7)), and through the VFS through the mqueue mount.  Any
      usage of mq_open() and friends will work with the acting task's ipc
      namespace.  Any actions through the VFS will work with the mqueuefs in
      which the file was created.  So if a user doesn't remount mqueuefs after
      unshare(CLONE_NEWIPC), mq_open("/ab") will not be reflected in "ls
      /dev/mqueue".
      
      If task a mounts mqueue for ipc_ns:1, then clones task b with a new ipcns,
      ipcns:2, and then task a is the last task in ipc_ns:1 to exit, then (1)
      ipc_ns:1 will be freed, (2) it's superblock will live on until task b
      umounts the corresponding mqueuefs, and vfs actions will continue to
      succeed, but (3) sb->s_fs_info will be NULL for the sb corresponding to
      the deceased ipc_ns:1.
      
      To make this happen, we must protect the ipc reference count when
      
      a) a task exits and drops its ipcns->count, since it might be dropping
         it to 0 and freeing the ipcns
      
      b) a task accesses the ipcns through its mqueuefs interface, since it
         bumps the ipcns refcount and might race with the last task in the ipcns
         exiting.
      
      So the kref is changed to an atomic_t so we can use
      atomic_dec_and_lock(&ns->count,mq_lock), and every access to the ipcns
      through ns = mqueuefs_sb->s_fs_info is protected by the same lock.
      Signed-off-by: NCedric Le Goater <clg@fr.ibm.com>
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7eafd7c7
    • S
      namespaces: mqueue ns: move mqueue_mnt into struct ipc_namespace · 614b84cf
      Serge E. Hallyn 提交于
      Move mqueue vfsmount plus a few tunables into the ipc_namespace struct.
      The CONFIG_IPC_NS boolean and the ipc_namespace struct will serve both the
      posix message queue namespaces and the SYSV ipc namespaces.
      
      The sysctl code will be fixed separately in patch 3.  After just this
      patch, making a change to posix mqueue tunables always changes the values
      in the initial ipc namespace.
      Signed-off-by: NCedric Le Goater <clg@fr.ibm.com>
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      614b84cf
  7. 01 4月, 2009 1 次提交
  8. 16 3月, 2009 1 次提交
    • J
      Use f_lock to protect f_flags · db1dd4d3
      Jonathan Corbet 提交于
      Traditionally, changes to struct file->f_flags have been done under BKL
      protection, or with no protection at all.  This patch causes all f_flags
      changes after file open/creation time to be done under protection of
      f_lock.  This allows the removal of some BKL usage and fixes a number of
      longstanding (if microscopic) races.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      db1dd4d3
  9. 14 1月, 2009 3 次提交
  10. 09 1月, 2009 1 次提交
    • S
      mqueue: fix si_pid value in mqueue do_notify() · a6684999
      Sukadev Bhattiprolu 提交于
      If a process registers for asynchronous notification on a POSIX message
      queue, it gets a signal and a siginfo_t structure when a message arrives
      on the message queue.  The si_pid in the siginfo_t structure is set to the
      PID of the process that sent the message to the message queue.
      
      The principle is the following:
      . when mq_notify(SIGEV_SIGNAL) is called, the caller registers for
        notification when a msg arrives. The associated pid structure is stroed into
        inode_info->notify_owner. Let's call this process P1.
      . when mq_send() is called by say P2, P2 sends a signal to P1 to notify
        him about msg arrival.
      
      The way .si_pid is set today is not correct, since it doesn't take into account
      the fact that the process that is sending the message might not be in the
      same namespace as the notified one.
      
      This patch proposes to set si_pid to the sender's pid into the notify_owner
      namespace.
      Signed-off-by: NNadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Acked-by: NOleg Nesterov <oleg@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Bastian Blank <bastian@waldi.eu.org>
      Cc: Pavel Emelyanov <xemul@openvz.org>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a6684999
  11. 06 1月, 2009 1 次提交
  12. 05 1月, 2009 4 次提交
    • A
      sanitize audit_mq_open() · 564f6993
      Al Viro 提交于
      * don't bother with allocations
      * don't do double copy_from_user()
      * don't duplicate parts of check for audit_dummy_context()
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      564f6993
    • A
      sanitize AUDIT_MQ_SENDRECV · c32c8af4
      Al Viro 提交于
      * logging the original value of *msg_prio in mq_timedreceive(2)
        is insane - the argument is write-only (i.e. syscall always
        ignores the original value and only overwrites it).
      * merge __audit_mq_timed{send,receive}
      * don't do copy_from_user() twice
      * don't mess with allocations in auditsc part
      * ... and don't bother checking !audit_enabled and !context in there -
        we'd already checked for audit_dummy_context().
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c32c8af4
    • A
      sanitize audit_mq_notify() · 20114f71
      Al Viro 提交于
      * don't copy_from_user() twice
      * don't bother with allocations
      * don't duplicate parts of audit_dummy_context()
      * make it return void
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      20114f71
    • A
      sanitize audit_mq_getsetattr() · 7392906e
      Al Viro 提交于
      * get rid of allocations
      * make it return void
      * don't duplicate parts of audit_dummy_context()
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      7392906e
  13. 14 11月, 2008 4 次提交
  14. 20 10月, 2008 1 次提交
    • J
      message queues: increase range limits · b231cca4
      Joe Korty 提交于
      Increase the range of various posix message queue limits.
      
      Posix gives the message queue user the ability to 'trade off' the maximum
      size of messages with the number of possible messages that can be 'in
      flight'.  Linux currently makes this trade off more restrictive than it
      needs to be.
      
      In particular, the maximum message size today can be made no smaller than
      8192.  This greatly restricts those applications that would like to have
      the ability to post large numbers of very small messages.
      
      So this task lowers the limit that the maximum message size can be set to,
      from 8192 to 128.  It also lowers the limit that the maximum #number of
      messages in flight can be set to, from 10 to 1.
      
      With these changes the message queue user can make better trade offs
      between #messages and message size, in order to get everything to fit
      within the setrlimit(RLIMIT_MSGQUEUE) limit for that particular user.
      
      This patch also applies the values in
      
      	/proc/sys/fs/mqueue/msg_max
      	/proc/sys/fs/mqueue/msgsize_max
      
      as the defaults for the max #messages allowed and the max message size
      allowed, respectively, for those applications that do not supply these.
      Previously, the defaults were hardwired to 10 and 8192, respectively.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NJoe Korty <joe.korty@ccur.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Manfred Spraul <manfred@colorfullife.com>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b231cca4
  15. 27 7月, 2008 2 次提交
  16. 26 7月, 2008 1 次提交
  17. 06 6月, 2008 1 次提交
  18. 04 5月, 2008 1 次提交
  19. 19 4月, 2008 2 次提交
  20. 09 2月, 2008 2 次提交
  21. 30 11月, 2007 1 次提交
  22. 07 11月, 2007 1 次提交