~ubuntu-kernel/ubuntu/+source/linux/+git/saucy:grouper

Last commit made on 2013-10-07
Get this branch:
git clone -b grouper https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/saucy
Members of Ubuntu Kernel Repositories can upload to this branch. Log in for directions.

Branch merges

Branch information

Recent commits

506872a... by Andy Whitcroft

UBUNTU: Ubuntu-grouper-3.1.10-6.25

Signed-off-by: Andy Whitcroft <email address hidden>

cd58fc1... by John Johansen

UBUNTU: SAUCE: apparmor: fix bad lock balance when introspecting policy

BugLink: http://bugs.launchpad.net/bugs/1235977

The profile introspection seq file has a locking bug when policy is viewed
from a virtual root (task in a policy namespace, introspection from the
real root is not affected).

The test for root
    while (parent) {
is correct for the real root, but incorrect for tasks in a policy namespace.
This allows the task to walk backup the policy tree past its virtual root
causing it to be unlocked before the virtual root should be in the p_stop
fn.

This results in the following lockdep back trace:
[ 78.479744] [ BUG: bad unlock balance detected! ]
[ 78.479792] 3.11.0-11-generic #17 Not tainted
[ 78.479838] -------------------------------------
[ 78.479885] grep/2223 is trying to release lock (&ns->lock) at:
[ 78.479952] [<ffffffff817bf3be>] mutex_unlock+0xe/0x10
[ 78.480002] but there are no more locks to release!
[ 78.480037]
[ 78.480037] other info that might help us debug this:
[ 78.480037] 1 lock held by grep/2223:
[ 78.480037] #0: (&p->lock){+.+.+.}, at: [<ffffffff812111bd>] seq_read+0x3d/0x3d0
[ 78.480037]
[ 78.480037] stack backtrace:
[ 78.480037] CPU: 0 PID: 2223 Comm: grep Not tainted 3.11.0-11-generic #17
[ 78.480037] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 78.480037] ffffffff817bf3be ffff880007763d60 ffffffff817b97ef ffff8800189d2190
[ 78.480037] ffff880007763d88 ffffffff810e1c6e ffff88001f044730 ffff8800189d2190
[ 78.480037] ffffffff817bf3be ffff880007763e00 ffffffff810e5bd6 0000000724fe56b7
[ 78.480037] Call Trace:
[ 78.480037] [<ffffffff817bf3be>] ? mutex_unlock+0xe/0x10
[ 78.480037] [<ffffffff817b97ef>] dump_stack+0x54/0x74
[ 78.480037] [<ffffffff810e1c6e>] print_unlock_imbalance_bug+0xee/0x100
[ 78.480037] [<ffffffff817bf3be>] ? mutex_unlock+0xe/0x10
[ 78.480037] [<ffffffff810e5bd6>] lock_release_non_nested+0x226/0x300
[ 78.480037] [<ffffffff817bf2fe>] ? __mutex_unlock_slowpath+0xce/0x180
[ 78.480037] [<ffffffff817bf3be>] ? mutex_unlock+0xe/0x10
[ 78.480037] [<ffffffff810e5d5c>] lock_release+0xac/0x310
[ 78.480037] [<ffffffff817bf2b3>] __mutex_unlock_slowpath+0x83/0x180
[ 78.480037] [<ffffffff817bf3be>] mutex_unlock+0xe/0x10
[ 78.480037] [<ffffffff81376c91>] p_stop+0x51/0x90
[ 78.480037] [<ffffffff81211408>] seq_read+0x288/0x3d0
[ 78.480037] [<ffffffff811e9d9e>] vfs_read+0x9e/0x170
[ 78.480037] [<ffffffff811ea8cc>] SyS_read+0x4c/0xa0
[ 78.480037] [<ffffffff817ccc9d>] system_call_fastpath+0x1a/0x1f

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Andy Whitcroft <email address hidden>

b10d9c1... by John Johansen

UBUNTU: SAUCE: apparmor: fix memleak of replacedby struct

BugLink: http://bugs.launchpad.net/bugs/1235973

This fixes the following kmemleak trace:
unreferenced object 0xffff8800245476d8 (size 16):
  comm "apparmor_parser", pid 14163, jiffies 4295196456 (age 3312.192s)
  hex dump (first 16 bytes):
    01 00 00 00 00 00 00 00 30 00 89 3d 00 88 ff ff ........0..=....
  backtrace:
    [<ffffffff817a99ae>] kmemleak_alloc+0x4e/0xb0
    [<ffffffff811c98b6>] kmem_cache_alloc_trace+0xe6/0x260
    [<ffffffff81386d97>] aa_alloc_replacedby+0x27/0x80
    [<ffffffff8137f1fc>] aa_replace_profiles+0x48c/0xd80
    [<ffffffff813769ea>] profile_load+0x3a/0x60
    [<ffffffff811e9f2d>] vfs_write+0xbd/0x1e0
    [<ffffffff811ea96c>] SyS_write+0x4c/0xa0
    [<ffffffff817cccdd>] system_call_fastpath+0x1a/0x1f
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Andy Whitcroft <email address hidden>

57adb61... by John Johansen

UBUNTU: SAUCE: apparmor: fix memleak of the profile hash

BugLink: http://bugs.launchpad.net/bugs/1235523

This fixes the following kmemleak trace:
unreferenced object 0xffff8801e8c35680 (size 32):
  comm "apparmor_parser", pid 691, jiffies 4294895667 (age 13230.876s)
  hex dump (first 32 bytes):
    e0 d3 4e b5 ac 6d f4 ed 3f cb ee 48 1c fd 40 cf ..N..m..?..H..@.
    5b cc e9 93 00 00 00 00 00 00 00 00 00 00 00 00 [...............
  backtrace:
    [<ffffffff817a97ee>] kmemleak_alloc+0x4e/0xb0
    [<ffffffff811ca9f3>] __kmalloc+0x103/0x290
    [<ffffffff8138acbc>] aa_calc_profile_hash+0x6c/0x150
    [<ffffffff8138074d>] aa_unpack+0x39d/0xd50
    [<ffffffff8137eced>] aa_replace_profiles+0x3d/0xd80
    [<ffffffff81376937>] profile_replace+0x37/0x50
    [<ffffffff811e9f2d>] vfs_write+0xbd/0x1e0
    [<ffffffff811ea96c>] SyS_write+0x4c/0xa0
    [<ffffffff817ccb1d>] system_call_fastpath+0x1a/0x1f
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Andy Whitcroft <email address hidden>

e73b452... by John Johansen

UBUNTU: SAUCE: apparmor: allocate path lookup buffers during init

BugLink: http://bugs.launchpad.net/bugs/1208988
dependency of: fix unix domain sockets to be mediated on connection
               needed to fix sleep in atomic context

Dynamically allocating buffers to store the path lookup slows mediation
down, and may require being able to sleep or accept failure of buffer
allocation. Handling fd inheritance during committing_creds, and unix
domain sockets can't fail nor can it sleep to do an allocation, so it
requires having preallocated buffers.

So add support for preallocated buffers and convert everything that
can be to use them.

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Andy Whitcroft <email address hidden>

759e356... by John Johansen

UBUNTU: SAUCE: apparmor: fix unix domain sockets to be mediated on connection

BugLink: http://bugs.launchpad.net/bugs/1208988

Signed-off-by: John Johansen <email address hidden>
[<email address hidden>: backported to 3.0 kernels.]
Signed-off-by: Andy Whitcroft <email address hidden>

bf4ba99... by Andy Whitcroft

UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andy Whitcroft <email address hidden>

8b11c33... by Tim Gardner

UBUNTU: Ubuntu-grouper-3.1.10-6.24

Signed-off-by: Tim Gardner <email address hidden>

dd12554... by Lennart Poettering <email address hidden>

prctl: add PR_{SET,GET}_CHILD_SUBREAPER to allow simple process supervision

BugLink: http://bugs.launchpad.net/bugs/1218415

Userspace service managers/supervisors need to track their started
services. Many services daemonize by double-forking and get implicitly
re-parented to PID 1. The service manager will no longer be able to
receive the SIGCHLD signals for them, and is no longer in charge of
reaping the children with wait(). All information about the children is
lost at the moment PID 1 cleans up the re-parented processes.

With this prctl, a service manager process can mark itself as a sort of
'sub-init', able to stay as the parent for all orphaned processes
created by the started services. All SIGCHLD signals will be delivered
to the service manager.

Receiving SIGCHLD and doing wait() is in cases of a service-manager much
preferred over any possible asynchronous notification about specific
PIDs, because the service manager has full access to the child process
data in /proc and the PID can not be re-used until the wait(), the
service-manager itself is in charge of, has happened.

As a side effect, the relevant parent PID information does not get lost
by a double-fork, which results in a more elaborate process tree and
'ps' output:

before:
  # ps afx
  253 ? Ss 0:00 /bin/dbus-daemon --system --nofork
  294 ? Sl 0:00 /usr/libexec/polkit-1/polkitd
  328 ? S 0:00 /usr/sbin/modem-manager
  608 ? Sl 0:00 /usr/libexec/colord
  658 ? Sl 0:00 /usr/libexec/upowerd
  819 ? Sl 0:00 /usr/libexec/imsettings-daemon
  916 ? Sl 0:00 /usr/libexec/udisks-daemon
  917 ? S 0:00 \_ udisks-daemon: not polling any devices

after:
  # ps afx
  294 ? Ss 0:00 /bin/dbus-daemon --system --nofork
  426 ? Sl 0:00 \_ /usr/libexec/polkit-1/polkitd
  449 ? S 0:00 \_ /usr/sbin/modem-manager
  635 ? Sl 0:00 \_ /usr/libexec/colord
  705 ? Sl 0:00 \_ /usr/libexec/upowerd
  959 ? Sl 0:00 \_ /usr/libexec/udisks-daemon
  960 ? S 0:00 | \_ udisks-daemon: not polling any devices
  977 ? Sl 0:00 \_ /usr/libexec/packagekitd

This prctl is orthogonal to PID namespaces. PID namespaces are isolated
from each other, while a service management process usually requires the
services to live in the same namespace, to be able to talk to each
other.

Users of this will be the systemd per-user instance, which provides
init-like functionality for the user's login session and D-Bus, which
activates bus services on-demand. Both need init-like capabilities to
be able to properly keep track of the services they start.

Many thanks to Oleg for several rounds of review and insights.

[<email address hidden>: fix comment layout and spelling]
[<email address hidden>: add lengthy code comment from Oleg]
Reviewed-by: Oleg Nesterov <email address hidden>
Signed-off-by: Lennart Poettering <email address hidden>
Signed-off-by: Kay Sievers <email address hidden>
Acked-by: Valdis Kletnieks <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
(back ported from commit ebec18a6d3aa1e7d84aab16225e87fd25170ec2b)

Conflicts:

 include/linux/prctl.h
 kernel/sys.c

Signed-off-by: Tim Gardner <email address hidden>

969f760... by Tim Gardner

UBUNTU: Ubuntu-grouper-3.1.10-6.23

Signed-off-by: Tim Gardner <email address hidden>