Re: [PATCH 1/1] digsig: Fix memory leakage in digsig_verify_rsa()

From: Kasatkin, Dmitry
Date: Wed Jan 30 2013 - 03:40:03 EST


On Fri, Jan 25, 2013 at 4:54 PM, Dmitry Kasatkin
<dmitry.kasatkin@xxxxxxxxx> wrote:
> From: YOSHIFUJI Hideaki <yoshfuji@xxxxxxxxxxxxxx>
>
> digsig_verify_rsa() does not free kmalloc'ed buffer returned by
> mpi_get_buffer().
>
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@xxxxxxxxxxxxxx>
> Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@xxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> ---
> lib/digsig.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/lib/digsig.c b/lib/digsig.c
> index 8c0e629..dc2be7e 100644
> --- a/lib/digsig.c
> +++ b/lib/digsig.c
> @@ -162,6 +162,8 @@ static int digsig_verify_rsa(struct key *key,
> memset(out1, 0, head);
> memcpy(out1 + head, p, l);
>
> + kfree(p);
> +
> err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len);
> if (err)
> goto err;
> --
> 1.7.10.4
>

James, can you please apply this patch.

- Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/