[PATCH 46/58] LSM: Use lsm_context in release_secctx hooks

Kees Cook keescook at chromium.org
Sun Jun 2 02:27:43 UTC 2019


On Fri, May 31, 2019 at 04:10:08PM -0700, Casey Schaufler wrote:
> -void apparmor_release_secctx(char *secdata, u32 seclen)
> +void apparmor_release_secctx(struct lsm_context *cp)
>  {
> -	kfree(secdata);
> +	kfree(cp->context);
>  }

Maybe better to have common helper?

void lsm_context_clear(struct lsm_context *cp)
{
    kfree(cp->context);
    cp->context = NULL;
    cp->len = 0;
}

-- 
Kees Cook



More information about the Linux-security-module-archive mailing list