netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] problem with BPF in PF_PACKET sockets, introduced in linux-2.6.19
@ 2007-01-04 15:47 Raivis Bucis
  2007-01-24 23:21 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Raivis Bucis @ 2007-01-04 15:47 UTC (permalink / raw)
  To: netdev; +Cc: waltje, gw4pts

Hello,

I believe I have found a bug in PF_PACKET socket filtering (introduced in 
linux-2.6.19). If BPF returns values larger than 0x80000000u, run_filter in 
af_packet.c considers that as error instead of simply accepting packet in its 
full length. sk_filter does not have this problem.

Raivis Bucis

Index: linux-2.6.19/net/packet/af_packet.c
===================================================================
--- linux-2.6.19/net/packet/af_packet.c
+++ linux-2.6.19/net/packet/af_packet.c
@@ -447,6 +447,8 @@
                        err = -EPERM;
                else if (*snaplen > err)
                        *snaplen = err;
+               else
+                       err = *snaplen;
        }
        rcu_read_unlock_bh();
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-25 23:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-04 15:47 [BUG] problem with BPF in PF_PACKET sockets, introduced in linux-2.6.19 Raivis Bucis
2007-01-24 23:21 ` David Miller
2007-01-25 13:22   ` Alexey Kuznetsov
2007-01-25 23:53     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).