[apparmor] [PATCH 13/36] apparmor: fix the locking etc. in the new policy interface
Seth Arnold
seth.arnold at canonical.com
Sat May 11 01:38:01 UTC 2013
On Wed, May 01, 2013 at 02:30:58PM -0700, John Johansen wrote:
> Signed-off-by: John Johansen <john.johansen at canonical.com>
Acked-by: Seth Arnold <seth.arnold at canonical.com>
> ---
> security/apparmor/apparmorfs.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index b079cea..bfc8015 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -413,8 +413,11 @@ void __aa_fs_namespace_rmdir(struct aa_namespace *ns)
> list_for_each_entry(child, &ns->base.profiles, base.list)
> __aa_fs_profile_rmdir(child);
>
> - list_for_each_entry(sub, &ns->sub_ns, base.list)
> + list_for_each_entry(sub, &ns->sub_ns, base.list) {
> + mutex_lock(&sub->lock);
> __aa_fs_namespace_rmdir(sub);
> + mutex_unlock(&sub->lock);
> + }
>
> for (i = AAFS_NS_SIZEOF - 1; i >= 0 ; --i) {
> securityfs_remove(ns->dents[i]);
> @@ -455,7 +458,9 @@ int __aa_fs_namespace_mkdir(struct aa_namespace *ns, struct dentry *parent,
> }
>
> list_for_each_entry(sub, &ns->sub_ns, base.list) {
> + mutex_lock(&sub->lock);
> error = __aa_fs_namespace_mkdir(sub, ns_subns_dir(ns), NULL);
> + mutex_unlock(&sub->lock);
> if (error)
> goto fail2;
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130510/947cdb26/attachment.pgp>
More information about the AppArmor
mailing list