]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
UBUNTU: SAUCE: apparmor: fix replacement race in reading rawdata
authorJohn Johansen <john.johansen@canonical.com>
Sat, 12 Nov 2016 05:44:20 +0000 (21:44 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
commit7e6d84642e4909fc161ff5cceea14e24835ace6e
tree334be064cd917e0846bed605d8ea5fa3e4728f32
parent1c1bc45a7253ca43eb4617f63674741fe5178f04
UBUNTU: SAUCE: apparmor: fix replacement race in reading rawdata

The reading of rawdata is subject to a replacement race when the
rawdata is read in chunks smaller than the data size.

For each read the profile proxy is rechecked for the newest profile;
Which means if a profile is replaced between reads later chunks will
contain data from the new version of the profile while the earlier
reads will contain data from the previous version. This can result in
data that is inconsistent and corrupt.

Instead of rechecking for the current profile at each read. Get the
current profile at the time of the open and use the rawdata of the
profile for the lifetime that the file handle is open.

BugLink: http://bugs.launchpad.net/bugs/1638996
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
security/apparmor/apparmorfs.c