Re: [PATCH] Add RNG support to AF_ALG (v2)

2011-01-21 Thread Neil Horman
On Fri, Jan 21, 2011 at 11:35:17PM +1100, Herbert Xu wrote: > On Fri, Jan 21, 2011 at 07:09:50AM -0500, Neil Horman wrote: > > > > I take your point, but I'm not certain I agree that we are duplicating an > > existing user interface. A cursory glance would say that we are, but > > /dev/random and

Re: [PATCH] Add RNG support to AF_ALG (v2)

2011-01-21 Thread Herbert Xu
On Fri, Jan 21, 2011 at 07:09:50AM -0500, Neil Horman wrote: > > I take your point, but I'm not certain I agree that we are duplicating an > existing user interface. A cursory glance would say that we are, but > /dev/random and /dev/urandom really just provide access to the kernels entropy > pools

Re: [PATCH] Add RNG support to AF_ALG (v2)

2011-01-21 Thread Neil Horman
On Fri, Jan 21, 2011 at 05:00:05PM +1100, Herbert Xu wrote: > On Thu, Jan 20, 2011 at 06:34:40PM -0500, Neil Horman wrote: > > > > Herbert, Sorry to bug you about this, but are you still planning on pulling > > this > > now that Linus has the infrastructure scheduled for 2.6.38? > > I think it's

Re: [PATCH] Add RNG support to AF_ALG (v2)

2011-01-20 Thread Herbert Xu
On Thu, Jan 20, 2011 at 06:34:40PM -0500, Neil Horman wrote: > > Herbert, Sorry to bug you about this, but are you still planning on pulling > this > now that Linus has the infrastructure scheduled for 2.6.38? I think it's best if we leave this out for now, unless we can come up with some way of

Re: [PATCH] Add RNG support to AF_ALG (v2)

2011-01-20 Thread Neil Horman
On Mon, Dec 13, 2010 at 04:25:14PM -0500, Neil Horman wrote: > Change notes: > Changed rng_rcvmsg to allocate a fixed size maximum temp block to store rng > data > when recvmsg is called. This should prevent malicious DoS from user space by > tring to receive obscene amounts of random data in one

[PATCH] Add RNG support to AF_ALG (v2)

2010-12-13 Thread Neil Horman
Change notes: Changed rng_rcvmsg to allocate a fixed size maximum temp block to store rng data when recvmsg is called. This should prevent malicious DoS from user space by tring to receive obscene amounts of random data in one call. Instead now we loop using the same block of data and copy it inc

Re: [PATCH] Add RNG support to AF_ALG

2010-12-13 Thread Miloslav Trmac
- "Neil Horman" wrote: > On Mon, Dec 13, 2010 at 12:24:34PM -0500, Miloslav Trmac wrote: > > - "Neil Horman" wrote: > > > +static int rng_recvmsg(struct kiocb *unused, struct socket > *sock, > > > + struct msghdr *msg, size_t len, int flags) > > > +{ > > > + struct sock *

Re: [PATCH] Add RNG support to AF_ALG

2010-12-13 Thread Neil Horman
On Mon, Dec 13, 2010 at 12:24:34PM -0500, Miloslav Trmac wrote: > - "Neil Horman" 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

Re: [PATCH] Add RNG support to AF_ALG

2010-12-13 Thread Miloslav Trmac
- "Neil Horman" 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; > +

[PATCH] Add RNG support to AF_ALG

2010-12-13 Thread Neil Horman
This patch enhances the AF_ALG protocol family to include support for random number generator algorithms. With this enhancment, users of the AF_ALG protocol can now bind sockets to instances of the various RNG algorithms available to the kernel. For those RNG's that support it, instances can be r