[apparmor] [PATCH] Initialize common_audit_data

Seth Arnold seth.arnold at canonical.com
Mon May 2 21:56:16 UTC 2016


On Mon, May 02, 2016 at 12:23:33PM -0500, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn at suse.com>
> 
> We need to initialize common_audit_data so that no garbage comes
> in the structure. This fixes the following crash:

> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com>

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

Looks good to me, of course John can take it or leave it as he wishes.

Thanks

> diff --git a/security/apparmor/file.c b/security/apparmor/file.c
> index 913f377..6d4898c 100644
> --- a/security/apparmor/file.c
> +++ b/security/apparmor/file.c
> @@ -108,10 +108,11 @@ int aa_audit_file(struct aa_profile *profile, struct file_perms *perms,
>  		  const char *target, kuid_t ouid, const char *info, int error)
>  {
>  	int type = AUDIT_APPARMOR_AUTO;
> -	struct common_audit_data sa;
>  	struct apparmor_audit_data aad = {0,};
> -	sa.type = LSM_AUDIT_DATA_NONE;
> -	sa.aad = &aad;
> +	struct common_audit_data sa = {
> +		.type = LSM_AUDIT_DATA_NONE,
> +		.aad = &aad
> +	};
>  	aad.op = op,
>  	aad.fs.request = request;
>  	aad.name = name;
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160502/bf3fed73/attachment.pgp>


More information about the AppArmor mailing list