[apparmor] [PATCH V2] security/apparmor: fix matching on presence of extended attributes

Seth Arnold seth.arnold at canonical.com
Fri Dec 21 04:29:43 UTC 2018


On Thu, Dec 20, 2018 at 01:28:38PM -0800, Eric Chiang wrote:
> --- a/security/apparmor/policy_unpack.c
> +++ b/security/apparmor/policy_unpack.c
> @@ -535,6 +535,24 @@ static bool unpack_xattrs(struct aa_ext *e, struct aa_profile *profile)
>  			goto fail;
>  	}
>  
> +	if (unpack_nameX(e, AA_STRUCT, "xattr_keys")) {
> +		int i, size;
> +
> +		size = unpack_array(e, NULL);
> +		profile->xattr_keys_count = size;
> +		profile->xattr_keys = kcalloc(size, sizeof(char *), GFP_KERNEL);

Do we need to worry about a zero-size array here?

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20181220/65b9bca7/attachment.sig>


More information about the AppArmor mailing list