[apparmor] [PATCH 06/16] apparmor: fix disconnected bind mnts reconnection

Seth Arnold seth.arnold at canonical.com
Wed Apr 27 03:33:24 UTC 2016


On Wed, Apr 20, 2016 at 11:52:48PM -0700, John Johansen wrote:
> Bind mounts can fail to be properly reconnected when PATH_CONNECT is
> specified. Ensure that when PATH_CONNECT is specified the path has
> a root.
> 
> BugLink: http://bugs.launchpad.net/bugs/1319984
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> ---
>  security/apparmor/path.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/security/apparmor/path.c b/security/apparmor/path.c
> index 71e0e3a..bb2f2c6 100644
> --- a/security/apparmor/path.c
> +++ b/security/apparmor/path.c
> @@ -141,7 +141,10 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
>  			error = -EACCES;
>  			if (*res == '/')
>  				*name = res + 1;
> -		}
> +		} else if (*res != '/')
> +			/* CONNECT_PATH with missing root */
> +			error = prepend(name, *name - buf, "/", 1);
> +
>  	}
>  
>  out:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160426/73c27aa4/attachment.pgp>


More information about the AppArmor mailing list