Re: [PATCH] Add RNG support to AF_ALG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- "Neil Horman" <nhorman@xxxxxxxxxxxxx> wrote:
> +static int rng_recvmsg(struct kiocb *unused, struct socket *sock,
> +			struct msghdr *msg, size_t len, int flags)
> +{
> +	struct sock *sk = sock->sk;
> +	struct alg_sock *ask = alg_sk(sk);
> +	struct rng_ctx *ctx = ask->private;
> +	int rc, i;
> +	u8 *data = kzalloc(len, GFP_KERNEL);
There probably should be an upper limit on the allocation - perhaps just always allocate a single page.

> +static void rng_release(void *private)
> +{
> +	struct rng_ctx *ctx = private;
> +	crypto_free_rng(ctx->ctx);
> +	kfree(ctx->seed);
Is a seed secret enough that it should be zeroed before freeing?  (Same in setkey, accept_parent).

     Mirek
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux