Subject: Re: [PATCH 3/7] NetLabel: CIPSOv4 engine

From: Paul Moore <[email-masked]>
Date: Sat, 15 Jul 2006 11:09:29 -0400

On Saturday 15 July 2006 9:08 am, James Morris wrote:
> On Fri, 14 Jul 2006, [email-masked] wrote:
> > +struct sk_buff *cipso_v4_doi_dump_all(const size_t headroom)
> > +{
> > +	struct sk_buff *skb;
> > +	unsigned char *buf;
> > +	struct cipso_v4_doi *iter;
> > +	u32 doi_cnt = 0;
> > +	ssize_t buf_len;
> > +
> > +	/* XXX - In both cases, this is kinda ugly as we have to go through
> > +	   the list once to determine how large of a buffer we need,
> > +	   drop the locks, allocate the buffer, grab the locks, and
> > +	   finally fill the buffer.  The problem is that there is that
> > +	   open window where the table could grow and we will end up
> > +	   short on space. */
>
> This needs to be fixed.

The reasoning behind this was because I wanted to try and avoid holding the 
rcu_read_lock() while allocating memory.  I'll just change the allocation to 
GFP_ATOMIC and keep the rcu lock.

> Currently, it seems that you just bail if this happens.

-- 
paul moore
linux security @ hp