Subject: Re: RFC: New BGF 'LOOP' instruction

From: Paul LeoNerd Evans <[email-masked]>
Date: Tue, 3 Aug 2010 08:04:27 +0100

On Mon, Aug 02, 2010 at 10:13:41PM -0700, David Miller wrote:
> > Any comments on this, while I proceed? Barring any major complaints,
> > I'll have a hack at some code and present a patch in due course...
> 
> We're not adding loop instructions, it's just asking for trouble
> since any user can attach BPF filters to a socket and it's just
> way too easy to make a loop endless.
> 
> There's a reason no loop primitives were added to the original
> BPF specification, perhaps you should take a look at what their
> reasoning was.

Yes. I am very aware of that.

Please read carefully my suggestion. These loops cannot be made endless
- they will be bounded by, at most, the number of bytes in the packet
buffer. The loop is required to increment X at least 1 at every
iteration, and will not allow it to continue past the end of the packet.
This puts a strict bound on the runtime of the loop.

-- 
Paul "LeoNerd" Evans

[email-masked]
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/