Commit dbcabfda authored by John Johansen's avatar John Johansen Committed by Tim Gardner

Revert "UBUNTU: SAUCE: apparmor: fix sleep from invalid context"

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

This reverts commit f970350049bdb24c3b3bdf4ef8c162833c4f2dd8.
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent b78947f7
...@@ -381,16 +381,16 @@ int aa_bind_mount(struct aa_label *label, struct path *path, ...@@ -381,16 +381,16 @@ int aa_bind_mount(struct aa_label *label, struct path *path,
flags &= MS_REC | MS_BIND; flags &= MS_REC | MS_BIND;
error = kern_path(dev_name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &old_path);
if (error)
goto error;
get_buffers(buffer, old_buffer); get_buffers(buffer, old_buffer);
error = aa_path_name(path, path_flags(labels_profile(label), path), buffer, &name, error = aa_path_name(path, path_flags(labels_profile(label), path), buffer, &name,
&info, labels_profile(label)->disconnected); &info, labels_profile(label)->disconnected);
if (error) if (error)
goto error; goto error;
error = kern_path(dev_name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &old_path);
if (error)
goto error;
error = aa_path_name(&old_path, path_flags(labels_profile(label), error = aa_path_name(&old_path, path_flags(labels_profile(label),
&old_path), &old_path),
old_buffer, &old_name, &info, old_buffer, &old_name, &info,
...@@ -463,10 +463,6 @@ int aa_move_mount(struct aa_label *label, struct path *path, ...@@ -463,10 +463,6 @@ int aa_move_mount(struct aa_label *label, struct path *path,
if (!orig_name || !*orig_name) if (!orig_name || !*orig_name)
return -EINVAL; return -EINVAL;
error = kern_path(orig_name, LOOKUP_FOLLOW, &old_path);
if (error)
goto error;
get_buffers(buffer, old_buffer); get_buffers(buffer, old_buffer);
error = aa_path_name(path, path_flags(labels_profile(label), path), error = aa_path_name(path, path_flags(labels_profile(label), path),
buffer, &name, &info, buffer, &name, &info,
...@@ -474,6 +470,10 @@ int aa_move_mount(struct aa_label *label, struct path *path, ...@@ -474,6 +470,10 @@ int aa_move_mount(struct aa_label *label, struct path *path,
if (error) if (error)
goto error; goto error;
error = kern_path(orig_name, LOOKUP_FOLLOW, &old_path);
if (error)
goto error;
error = aa_path_name(&old_path, path_flags(labels_profile(label), error = aa_path_name(&old_path, path_flags(labels_profile(label),
&old_path), &old_path),
old_buffer, &old_name, &info, old_buffer, &old_name, &info,
...@@ -508,20 +508,22 @@ int aa_new_mount(struct aa_label *label, const char *orig_dev_name, ...@@ -508,20 +508,22 @@ int aa_new_mount(struct aa_label *label, const char *orig_dev_name,
const char *name = NULL, *dev_name = NULL, *info = NULL; const char *name = NULL, *dev_name = NULL, *info = NULL;
bool binary = true; bool binary = true;
int error; int error;
int requires_dev;
struct file_system_type *fstype;
struct path dev_path;
dev_name = orig_dev_name; dev_name = orig_dev_name;
get_buffers(buffer, dev_buffer);
if (type) { if (type) {
fstype = get_fs_type(type); int requires_dev;
struct file_system_type *fstype = get_fs_type(type);
if (!fstype) if (!fstype)
return -ENODEV; return -ENODEV;
binary = fstype->fs_flags & FS_BINARY_MOUNTDATA; binary = fstype->fs_flags & FS_BINARY_MOUNTDATA;
requires_dev = fstype->fs_flags & FS_REQUIRES_DEV; requires_dev = fstype->fs_flags & FS_REQUIRES_DEV;
put_filesystem(fstype); put_filesystem(fstype);
if (requires_dev) { if (requires_dev) {
struct path dev_path;
if (!dev_name || !*dev_name) { if (!dev_name || !*dev_name) {
error = -ENOENT; error = -ENOENT;
goto out; goto out;
...@@ -530,19 +532,16 @@ int aa_new_mount(struct aa_label *label, const char *orig_dev_name, ...@@ -530,19 +532,16 @@ int aa_new_mount(struct aa_label *label, const char *orig_dev_name,
error = kern_path(dev_name, LOOKUP_FOLLOW, &dev_path); error = kern_path(dev_name, LOOKUP_FOLLOW, &dev_path);
if (error) if (error)
goto error; goto error;
}
}
get_buffers(buffer, dev_buffer); error = aa_path_name(&dev_path,
if (type) { path_flags(labels_profile(label),
error = aa_path_name(&dev_path, &dev_path),
path_flags(labels_profile(label), dev_buffer, &dev_name, &info,
&dev_path), labels_profile(label)->disconnected);
dev_buffer, &dev_name, &info, path_put(&dev_path);
labels_profile(label)->disconnected); if (error)
path_put(&dev_path); goto error;
if (error) }
goto error;
} }
error = aa_path_name(path, path_flags(labels_profile(label), path), error = aa_path_name(path, path_flags(labels_profile(label), path),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment