Re: [PATCH v2 1/3] KEYS: fix cred refcount leak in request_key_auth_new()

2017-09-25 Thread David Howells
Eric Biggers wrote: > + rka = kzalloc(sizeof(*rka), GFP_KERNEL); > + if (!rka) > + goto error_free_rka; But you haven't allocated an rka if you're in the error path. I'll fix that to jump over the release. David

[PATCH v2 1/3] KEYS: fix cred refcount leak in request_key_auth_new()

2017-09-21 Thread Eric Biggers
From: Eric Biggers In request_key_auth_new(), if key_alloc() or key_instantiate_and_link() were to fail, we would leak a reference to the 'struct cred'. Currently this can only happen if key_alloc() fails to allocate memory. But it still should be fixed, as it is a more severe bug waiting to ha