Re: [PATCH] crypto: fix a memory leak in rsa-kcs1pad's encryption mode

2018-09-27 Thread Herbert Xu
On Mon, Sep 17, 2018 at 08:24:32PM +0300, Dan Aloni wrote: > The encryption mode of pkcs1pad never uses out_sg and out_buf, so > there's no need to allocate the buffer, which presently is not even > being freed. > > CC: Herbert Xu > CC: linux-crypto@vger.kernel.org > CC: "David S. Miller" > Sign

Re: [PATCH] crypto: fix a memory leak in rsa-kcs1pad's encryption mode

2018-09-17 Thread Tadeusz Struk
On 9/17/18 3:04 PM, Dan Aloni wrote: > That's also true, but what I still don't understand is how > pkcs1pad_decrypt_complete() would be called when a higher layer calls to > *encrypt* in roughly this API call sequence: > >ak_tfm = crypto_alloc_akcipher("pkcs1pad(rsa,sha256)", 0, 0); >

Re: [PATCH] crypto: fix a memory leak in rsa-kcs1pad's encryption mode

2018-09-17 Thread Dan Aloni
On Mon, Sep 17, 2018 at 02:39:46PM -0700, Tadeusz Struk wrote: > On 9/17/18 1:28 PM, Dan Aloni wrote: > > On Mon, Sep 17, 2018 at 12:52:44PM -0700, Tadeusz Struk wrote: > >> On 9/17/18 10:24 AM, Dan Aloni wrote: > >>> The encryption mode of pkcs1pad never uses out_sg and out_buf, so > >>> there's n

Re: [PATCH] crypto: fix a memory leak in rsa-kcs1pad's encryption mode

2018-09-17 Thread Tadeusz Struk
On 9/17/18 1:28 PM, Dan Aloni wrote: > On Mon, Sep 17, 2018 at 12:52:44PM -0700, Tadeusz Struk wrote: >> On 9/17/18 10:24 AM, Dan Aloni wrote: >>> The encryption mode of pkcs1pad never uses out_sg and out_buf, so >>> there's no need to allocate the buffer, which presently is not even >>> being free

Re: [PATCH] crypto: fix a memory leak in rsa-kcs1pad's encryption mode

2018-09-17 Thread Dan Aloni
On Mon, Sep 17, 2018 at 12:52:44PM -0700, Tadeusz Struk wrote: > On 9/17/18 10:24 AM, Dan Aloni wrote: > > The encryption mode of pkcs1pad never uses out_sg and out_buf, so > > there's no need to allocate the buffer, which presently is not even > > being freed. > > It is used and freed in pkcs1pad

Re: [PATCH] crypto: fix a memory leak in rsa-kcs1pad's encryption mode

2018-09-17 Thread Tadeusz Struk
On 9/17/18 10:24 AM, Dan Aloni wrote: > The encryption mode of pkcs1pad never uses out_sg and out_buf, so > there's no need to allocate the buffer, which presently is not even > being freed. It is used and freed in pkcs1pad_decrypt_complete(). -- Tadeusz

[PATCH] crypto: fix a memory leak in rsa-kcs1pad's encryption mode

2018-09-17 Thread Dan Aloni
The encryption mode of pkcs1pad never uses out_sg and out_buf, so there's no need to allocate the buffer, which presently is not even being freed. CC: Herbert Xu CC: linux-crypto@vger.kernel.org CC: "David S. Miller" Signed-off-by: Dan Aloni --- crypto/rsa-pkcs1pad.c | 9 - 1 file chan