30 Mar, 2012

1 commit


23 Mar, 2012

1 commit

  • Merge first batch of patches from Andrew Morton:
    "A few misc things and all the MM queue"

    * emailed from Andrew Morton : (92 commits)
    memcg: avoid THP split in task migration
    thp: add HPAGE_PMD_* definitions for !CONFIG_TRANSPARENT_HUGEPAGE
    memcg: clean up existing move charge code
    mm/memcontrol.c: remove unnecessary 'break' in mem_cgroup_read()
    mm/memcontrol.c: remove redundant BUG_ON() in mem_cgroup_usage_unregister_event()
    mm/memcontrol.c: s/stealed/stolen/
    memcg: fix performance of mem_cgroup_begin_update_page_stat()
    memcg: remove PCG_FILE_MAPPED
    memcg: use new logic for page stat accounting
    memcg: remove PCG_MOVE_LOCK flag from page_cgroup
    memcg: simplify move_account() check
    memcg: remove EXPORT_SYMBOL(mem_cgroup_update_page_stat)
    memcg: kill dead prev_priority stubs
    memcg: remove PCG_CACHE page_cgroup flag
    memcg: let css_get_next() rely upon rcu_read_lock()
    cgroup: revert ss_id_lock to spinlock
    idr: make idr_get_next() good for rcu_read_lock()
    memcg: remove unnecessary thp check in page stat accounting
    memcg: remove redundant returns
    memcg: enum lru_list lru
    ...

    Linus Torvalds
     

22 Mar, 2012

2 commits

  • When calling shmget() with SHM_HUGETLB, shmget aligns the request size to
    PAGE_SIZE, but this is not sufficient.

    Modify hugetlb_file_setup() to align requests to the huge page size, and
    to accept an address argument so that all alignment checks can be
    performed in hugetlb_file_setup(), rather than in its callers. Change
    newseg() and mmap_pgoff() to match the new prototype and eliminate a now
    redundant alignment check.

    [akpm@linux-foundation.org: fix build]
    Signed-off-by: Steven Truelove
    Cc: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven Truelove
     
  • Pull vfs pile 1 from Al Viro:
    "This is _not_ all; in particular, Miklos' and Jan's stuff is not there
    yet."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits)
    ext4: initialization of ext4_li_mtx needs to be done earlier
    debugfs-related mode_t whack-a-mole
    hfsplus: add an ioctl to bless files
    hfsplus: change finder_info to u32
    hfsplus: initialise userflags
    qnx4: new helper - try_extent()
    qnx4: get rid of qnx4_bread/qnx4_getblk
    take removal of PF_FORKNOEXEC to flush_old_exec()
    trim includes in inode.c
    um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it
    um: embed ->stub_pages[] into mmu_context
    gadgetfs: list_for_each_safe() misuse
    ocfs2: fix leaks on failure exits in module_init
    ecryptfs: make register_filesystem() the last potential failure exit
    ntfs: forgets to unregister sysctls on register_filesystem() failure
    logfs: missing cleanup on register_filesystem() failure
    jfs: mising cleanup on register_filesystem() failure
    make configfs_pin_fs() return root dentry on success
    configfs: configfs_create_dir() has parent dentry in dentry->d_parent
    configfs: sanitize configfs_create()
    ...

    Linus Torvalds
     

21 Mar, 2012

1 commit


16 Mar, 2012

1 commit

  • When using the "compat" APIs, architectures will generally want to
    be able to make direct syscalls to msgsnd(), shmctl(), etc., and
    in the kernel we would want them to be handled directly by
    compat_sys_xxx() functions, as is true for other compat syscalls.

    However, for historical reasons, several of the existing compat IPC
    syscalls do not do this. semctl() expects a pointer to the fourth
    argument, instead of the fourth argument itself. msgsnd(), msgrcv()
    and shmat() expect arguments in different order.

    This change adds an ARCH_WANT_OLD_COMPAT_IPC config option that can be
    set to preserve this behavior for ports that use it (x86, sparc, powerpc,
    s390, and mips). No actual semantics are changed for those architectures,
    and there is only a minimal amount of code refactoring in ipc/compat.c.

    Newer architectures like tile (and perhaps future architectures such
    as arm64 and unicore64) should not select this option, and thus can
    avoid having any IPC-specific code at all in their architecture-specific
    compat layer. In the same vein, if this option is not selected, IPC_64
    mode is assumed, since that's what the headers expect.

    The workaround code in "tile" for msgsnd() and msgrcv() is removed
    with this change; it also fixes the bug that shmat() and semctl() were
    not being properly handled.

    Reviewed-by: Arnd Bergmann
    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

14 Feb, 2012

1 commit


24 Jan, 2012

3 commits

  • Commit cc39c6a9bbde ("mm: account skipped entries to avoid looping in
    find_get_pages") correctly fixed an infinite loop; but left a problem
    that find_get_pages() on shmem would return 0 (appearing to callers to
    mean end of tree) when it meets a run of nr_pages swap entries.

    The only uses of find_get_pages() on shmem are via pagevec_lookup(),
    called from invalidate_mapping_pages(), and from shmctl SHM_UNLOCK's
    scan_mapping_unevictable_pages(). The first is already commented, and
    not worth worrying about; but the second can leave pages on the
    Unevictable list after an unusual sequence of swapping and locking.

    Fix that by using shmem_find_get_pages_and_swap() (then ignoring the
    swap) instead of pagevec_lookup().

    But I don't want to contaminate vmscan.c with shmem internals, nor
    shmem.c with LRU locking. So move scan_mapping_unevictable_pages() into
    shmem.c, renaming it shmem_unlock_mapping(); and rename
    check_move_unevictable_page() to check_move_unevictable_pages(), looping
    down an array of pages, oftentimes under the same lock.

    Leave out the "rotate unevictable list" block: that's a leftover from
    when this was used for /proc/sys/vm/scan_unevictable_pages, whose flawed
    handling involved looking at pages at tail of LRU.

    Was there significance to the sequence first ClearPageUnevictable, then
    test page_evictable, then SetPageUnevictable here? I think not, we're
    under LRU lock, and have no barriers between those.

    Signed-off-by: Hugh Dickins
    Reviewed-by: KOSAKI Motohiro
    Cc: Minchan Kim
    Cc: Rik van Riel
    Cc: Shaohua Li
    Cc: Eric Dumazet
    Cc: Johannes Weiner
    Cc: Michel Lespinasse
    Cc: [back to 3.1 but will need respins]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • scan_mapping_unevictable_pages() is used to make SysV SHM_LOCKed pages
    evictable again once the shared memory is unlocked. It does this with
    pagevec_lookup()s across the whole object (which might occupy most of
    memory), and takes 300ms to unlock 7GB here. A cond_resched() every
    PAGEVEC_SIZE pages would be good.

    However, KOSAKI-san points out that this is called under shmem.c's
    info->lock, and it's also under shm.c's shm_lock(), both spinlocks.
    There is no strong reason for that: we need to take these pages off the
    unevictable list soonish, but those locks are not required for it.

    So move the call to scan_mapping_unevictable_pages() from shmem.c's
    unlock handling up to shm.c's unlock handling. Remove the recently
    added barrier, not needed now we have spin_unlock() before the scan.

    Use get_file(), with subsequent fput(), to make sure we have a reference
    to mapping throughout scan_mapping_unevictable_pages(): that's something
    that was previously guaranteed by the shm_lock().

    Remove shmctl's lru_add_drain_all(): we don't fault in pages at SHM_LOCK
    time, and we lazily discover them to be Unevictable later, so it serves
    no purpose for SHM_LOCK; and serves no purpose for SHM_UNLOCK, since
    pages still on pagevec are not marked Unevictable.

    The original code avoided redundant rescans by checking VM_LOCKED flag
    at its level: now avoid them by checking shp's SHM_LOCKED.

    The original code called scan_mapping_unevictable_pages() on a locked
    area at shm_destroy() time: perhaps we once had accounting cross-checks
    which required that, but not now, so skip the overhead and just let
    inode eviction deal with them.

    Put check_move_unevictable_page() and scan_mapping_unevictable_pages()
    under CONFIG_SHMEM (with stub for the TINY case when ramfs is used),
    more as comment than to save space; comment them used for SHM_UNLOCK.

    Signed-off-by: Hugh Dickins
    Reviewed-by: KOSAKI Motohiro
    Cc: Minchan Kim
    Cc: Rik van Riel
    Cc: Shaohua Li
    Cc: Eric Dumazet
    Cc: Johannes Weiner
    Cc: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Because the current task is being used to get the limit, we can simply
    use rlimit() instead of task_rlimit().

    Signed-off-by: Davidlohr Bueso
    Acked-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davidlohr Bueso
     

11 Jan, 2012

1 commit

  • ipc/mqueue.c: for __SI_MESQ, convert the uid being sent to recipient's
    user namespace. (new, thanks Oleg)

    __send_signal: convert current's uid to the recipient's user namespace
    for any siginfo which is not SI_FROMKERNEL (patch from Oleg, thanks
    again :)

    do_notify_parent and do_notify_parent_cldstop: map task's uid to parent's
    user namespace

    ptrace_signal maps parent's uid into current's user namespace before
    including in signal to current. IIUC Oleg has argued that this shouldn't
    matter as the debugger will play with it, but it seems like not converting
    the value currently being set is misleading.

    Changelog:
    Sep 20: Inspired by Oleg's suggestion, define map_cred_ns() helper to
    simplify callers and help make clear what we are translating
    (which uid into which namespace). Passing the target task would
    make callers even easier to read, but we pass in user_ns because
    current_user_ns() != task_cred_xxx(current, user_ns).
    Sep 20: As recommended by Oleg, also put task_pid_vnr() under rcu_read_lock
    in ptrace_signal().
    Sep 23: In send_signal(), detect when (user) signal is coming from an
    ancestor or unrelated user namespace. Pass that on to __send_signal,
    which sets si_uid to 0 or overflowuid if needed.
    Oct 12: Base on Oleg's fixup_uid() patch. On top of that, handle all
    SI_FROMKERNEL cases at callers, because we can't assume sender is
    current in those cases.
    Nov 10: (mhelsley) rename fixup_uid to more meaningful usern_fixup_signal_uid
    Nov 10: (akpm) make the !CONFIG_USER_NS case clearer

    Signed-off-by: Serge Hallyn
    Cc: Oleg Nesterov
    Cc: Matt Helsley
    Cc: "Eric W. Biederman"
    From: Serge Hallyn
    Subject: __send_signal: pass q->info, not info, to userns_fixup_signal_uid (v2)

    Eric Biederman pointed out that passing info is a bug and could lead to a
    NULL pointer deref to boot.

    A collection of signal, securebits, filecaps, cap_bounds, and a few other
    ltp tests passed with this kernel.

    Changelog:
    Nov 18: previous patch missed a leading '&'

    Signed-off-by: Serge Hallyn
    Cc: "Eric W. Biederman"
    From: Dan Carpenter
    Subject: ipc/mqueue: lock() => unlock() typo

    There was a double lock typo introduced in b085f4bd6b21 "user namespace:
    make signal.c respect user namespaces"

    Signed-off-by: Dan Carpenter
    Cc: Oleg Nesterov
    Cc: Matt Helsley
    Cc: "Eric W. Biederman"
    Acked-by: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     

04 Jan, 2012

4 commits


09 Dec, 2011

1 commit


03 Nov, 2011

3 commits

  • include/linux/sem.h contains several structures that are only used within
    ipc/sem.c.

    The patch moves them into ipc/sem.c - there is no need to expose the
    structures to the whole kernel.

    No functional changes, only whitespace cleanups and 80-char per line
    fixes.

    Signed-off-by: Manfred Spraul
    Acked-by: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Mike Galbraith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Manfred Spraul
     
  • semtimedop() does not handle spurious wakeups, it returns -EINTR to user
    space. Most other schedule() users would just loop and not return to user
    space. The patch adds such a loop to semtimedop()

    Signed-off-by: Manfred Spraul
    Reported-by: Peter Zijlstra
    Acked-by: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Mike Galbraith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Manfred Spraul
     
  • sys_semtimedop() may return -EIDRM although the semaphore operation
    completed successfully:

    thread 1: thread 2:
    semtimedop(), sleeps
    semop():
    * acquires sem_lock()
    semtimedop() woken up due to timeout
    sem_lock() loops
    * notices that thread 2 could be completed.
    * performs the operations that thread 2 is sleeping on.
    * marks the semaphore operation as IN_WAKEUP
    * drops sem_lock(), does wakeup, sets return code to 0
    * thread delayed due to interrupt, whatever
    * returns to user space
    * thread still delayed
    semctl(IPC_RMID)
    * acquires sem_lock()
    * ipc_rmid(), ipcp->deleted=1
    * drops sem_lock()
    * thread finally continues - but seem_lock()
    now fails due to ipcp->deleted == 1
    * returns -EIDRM instead of 0

    The fix is trivial: Always use the return code in queue.status.

    In real world, the race probably doesn't matter:
    If the semaphore array is destroyed, the app is probably not interested
    if the last operation succeeded or was already cancelled.

    Signed-off-by: Manfred Spraul
    Cc: Thomas Gleixner
    Cc: Mike Galbraith
    Acked-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Manfred Spraul
     

01 Nov, 2011

1 commit

  • Fix the wrong use of schedule_hrtimeout_range_clock() in wq_sleep(),
    although it is harmless for the syscall mq_timed* now. It was introduced
    by 9ca7d8e ("mqueue: Convert message queue timeout to use hrtimers").

    Signed-off-by: Wanlong Gao
    Cc: Carsten Emde
    Cc: Thomas Gleixner
    Cc: Manfred Spraul
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wanlong Gao
     

05 Aug, 2011

1 commit

  • This isn't really critical any more, since other patches (commit
    298507d4d2cf: "shm: optimize exit_shm()") have caused us to not actually
    need to touch the rw_mutex unless there are actual shm segments
    associated with the namespace, but we really should do tne shm_init_ns()
    earlier than we do now.

    This, together with commit 288d5abec831 ("Boot up with usermodehelper
    disabled") will mean that we really do initialize the initial ipc
    namespace data structure before we run any tasks.

    Tested-by: Marc Zyngier
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

04 Aug, 2011

2 commits

  • We may optimistically check .in_use == 0 without holding the rw_mutex:
    it's the common case, and if it's zero, there certainly won't be any
    segments associated with us.

    After taking the lock, the idr_for_each() will do the right thing, so we
    could now drop the re-check inside the lock without any real cost. But
    it won't hurt.

    Signed-off-by: Vasiliy Kulikov
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     
  • Commit 4c677e2eefdb ("shm: optimize locking and ipc_namespace getting")
    introduced a copy-paste bug. Due to the bug cycle optimizations were
    disabled.

    Signed-off-by: Vasiliy Kulikov
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     

31 Jul, 2011

2 commits

  • shm_lock() does a lookup of shm segment in shm_ids(ns).ipcs_idr, which
    is redundant as we already know shmid_kernel address. An actual lock is
    also not required for reads until we really want to destroy the segment.

    exit_shm() and shm_destroy_orphaned() may avoid the loop by checking
    whether there is at least one segment in current ipc_namespace.

    The check of nsproxy and ipc_ns against NULL is redundant as exit_shm()
    is called from do_exit() before the call to exit_notify(), so the
    dereferencing current->nsproxy->ipc_ns is guaranteed to be safe.

    Reported-by: Oleg Nesterov
    Signed-off-by: Vasiliy Kulikov
    Acked-by: Serge Hallyn
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     
  • shm_try_destroy_orphaned() and shm_try_destroy_current() didn't handle
    the case of separate PID namespaces, but a single IPC namespace. If
    there are tasks with the same PID values using the same shmem object,
    the wrong destroy decision could be reached.

    On shm segment creation store the pointer to the creator task in
    shmid_kernel->shm_creator field and zero it on task exit. Then
    use the ->shm_creator insread of shm_cprid in both functions. As
    shmid_kernel object is already locked at this stage, no additional
    locking is needed.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Serge Hallyn
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     

27 Jul, 2011

3 commits

  • Add support for the shm_rmid_forced sysctl. If set to 1, all shared
    memory objects in current ipc namespace will be automatically forced to
    use IPC_RMID.

    The POSIX way of handling shmem allows one to create shm objects and
    call shmdt(), leaving shm object associated with no process, thus
    consuming memory not counted via rlimits.

    With shm_rmid_forced=1 the shared memory object is counted at least for
    one process, so OOM killer may effectively kill the fat process holding
    the shared memory.

    It obviously breaks POSIX - some programs relying on the feature would
    stop working. So set shm_rmid_forced=1 only if you're sure nobody uses
    "orphaned" memory. Use shm_rmid_forced=0 by default for compatability
    reasons.

    The feature was previously impemented in -ow as a configure option.

    [akpm@linux-foundation.org: fix documentation, per Randy]
    [akpm@linux-foundation.org: fix warning]
    [akpm@linux-foundation.org: readability/conventionality tweaks]
    [akpm@linux-foundation.org: fix shm_rmid_forced/shm_forced_rmid confusion, use standard comment layout]
    Signed-off-by: Vasiliy Kulikov
    Cc: Randy Dunlap
    Cc: "Eric W. Biederman"
    Cc: "Serge E. Hallyn"
    Cc: Daniel Lezcano
    Cc: Oleg Nesterov
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Cc: Alan Cox
    Cc: Solar Designer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     
  • We return ENOMEM from mqueue_get_inode even when we have enough memory.
    Namely in case the system rlimit of mqueue was reached. This error
    propagates to mq_queue and user sees the error unexpectedly. So fix
    this up to properly return EMFILE as described in the manpage:

    EMFILE The process already has the maximum number of files and
    message queues open.

    instead of:

    ENOMEM Insufficient memory.

    With the previous patch we just switch to ERR_PTR/PTR_ERR/IS_ERR error
    handling here.

    Signed-off-by: Jiri Slaby
    Cc: Manfred Spraul
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • If new_inode fails to allocate an inode we need only to return with
    NULL. But now we test the opposite and have all the work in a nested
    block. So do the opposite to save one indentation level (and remove
    unnecessary line breaks).

    This is only a preparation/cleanup for the next patch where we fix up
    return values from mqueue_get_inode.

    Signed-off-by: Jiri Slaby
    Cc: Manfred Spraul
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

26 Jul, 2011

1 commit

  • If a semaphore array is removed and in parallel a sleeping task is woken
    up (signal or timeout, does not matter), then the woken up task does not
    wait until wake_up_sem_queue_do() is completed. This will cause crashes,
    because wake_up_sem_queue_do() will read from a stale pointer.

    The fix is simple: Regardless of anything, always call get_queue_result().
    This function waits until wake_up_sem_queue_do() has finished it's task.

    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=27142

    Reported-by: Yuriy Yevtukhov
    Reported-by: Harald Laabs
    Signed-off-by: Manfred Spraul
    Acked-by: Eric Dumazet
    Cc: [2.6.35+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Manfred Spraul
     

23 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
    vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
    isofs: Remove global fs lock
    jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
    fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
    mm/truncate.c: fix build for CONFIG_BLOCK not enabled
    fs:update the NOTE of the file_operations structure
    Remove dead code in dget_parent()
    AFS: Fix silly characters in a comment
    switch d_add_ci() to d_splice_alias() in "found negative" case as well
    simplify gfs2_lookup()
    jfs_lookup(): don't bother with . or ..
    get rid of useless dget_parent() in btrfs rename() and link()
    get rid of useless dget_parent() in fs/btrfs/ioctl.c
    fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
    drivers: fix up various ->llseek() implementations
    fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
    Ext4: handle SEEK_HOLE/SEEK_DATA generically
    Btrfs: implement our own ->llseek
    fs: add SEEK_HOLE and SEEK_DATA flags
    reiserfs: make reiserfs default to barrier=flush
    ...

    Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
    shrinker callout for the inode cache, that clashed with the xfs code to
    start the periodic workers later.

    Linus Torvalds
     

21 Jul, 2011

3 commits

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     
  • The rcu callback ipc_immediate_free() just calls a kfree(),
    so we use kfree_rcu() instead of the call_rcu(ipc_immediate_free).

    Signed-off-by: Lai Jiangshan
    Signed-off-by: Paul E. McKenney
    Cc: Andrew Morton
    Reviewed-by: Josh Triplett

    Lai Jiangshan
     
  • The rcu callback free_un() just calls a kfree(),
    so we use kfree_rcu() instead of the call_rcu(free_un).

    Signed-off-by: Lai Jiangshan
    Signed-off-by: Paul E. McKenney
    Cc: Andrew Morton
    Cc: Manfred Spraul
    Reviewed-by: Josh Triplett

    Lai Jiangshan
     

27 May, 2011

1 commit

  • The type of vma->vm_flags is 'unsigned long'. Neither 'int' nor
    'unsigned int'. This patch fixes such misuse.

    Signed-off-by: KOSAKI Motohiro
    [ Changed to use a typedef - we'll extend it to cover more cases
    later, since there has been discussion about making it a 64-bit
    type.. - Linus ]
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     

11 May, 2011

1 commit


31 Mar, 2011

1 commit


28 Mar, 2011

1 commit

  • Fix ipc/util.c kernel-doc warnings:

    Warning(ipc/util.c:336): No description found for parameter 'ns'
    Warning(ipc/util.c:620): No description found for parameter 'ns'
    Warning(ipc/util.c:790): No description found for parameter 'ns'

    Signed-off-by: Randy Dunlap
    Reviewed-by: Jesper Juhl
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

26 Mar, 2011

1 commit

  • commit b515498 ("userns: add a user namespace owner of ipc ns") added a
    user namespace owner of ipc ns, but it also introduced a use after free in
    free_ipc_ns().

    Signed-off-by: Xiaotian Feng
    Acked-by: "Serge E. Hallyn"
    Acked-by: David Howells
    Cc: "Eric W. Biederman"
    Cc: Daniel Lezcano
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xiaotian Feng
     

24 Mar, 2011

2 commits

  • CAP_IPC_OWNER and CAP_IPC_LOCK can be checked against current_user_ns(),
    because the resource comes from current's own ipc namespace.

    setuid/setgid are to uids in own namespace, so again checks can be against
    current_user_ns().

    Changelog:
    Jan 11: Use task_ns_capable() in place of sched_capable().
    Jan 11: Use nsown_capable() as suggested by Bastian Blank.
    Jan 11: Clarify (hopefully) some logic in futex and sched.c
    Feb 15: use ns_capable for ipc, not nsown_capable
    Feb 23: let copy_ipcs handle setting ipc_ns->user_ns
    Feb 23: pass ns down rather than taking it from current

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Serge E. Hallyn
    Acked-by: "Eric W. Biederman"
    Acked-by: Daniel Lezcano
    Acked-by: David Howells
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     
  • Changelog:
    Feb 15: Don't set new ipc->user_ns if we didn't create a new
    ipc_ns.
    Feb 23: Move extern declaration to ipc_namespace.h, and group
    fwd declarations at top.

    Signed-off-by: Serge E. Hallyn
    Acked-by: "Eric W. Biederman"
    Acked-by: Daniel Lezcano
    Acked-by: David Howells
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn