netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ixgbevf: suspicious skb->pkt_type check
@ 2013-12-19 18:08 Florian Fainelli
  2013-12-19 20:35 ` John Fastabend
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2013-12-19 18:08 UTC (permalink / raw)
  To: netdev, e1000-devel, jeffrey.t.kirsher, John Fastabend

Hi John,

In commit 815cccbf ("ixgbe: add setlink, getlink support to ixgbe and
ixgbevf") this line was added:


+               if ((skb->pkt_type & (PACKET_BROADCAST | PACKET_MULTICAST)) &&
+                   !(compare_ether_addr(adapter->netdev->dev_addr,
+                                       eth_hdr(skb)->h_source))) {

This looks suspicious to me since skb->pkt_type is not a bitmask, but
holds only one value at a time,  and with this check you would also
match any value which has the lower two bits set, so PACKET_OTHERHOST,
PACKET_LOOPBACK and PACKET_FASTROUTE are also matching the first part
of the check.
-- 
Florian

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

end of thread, other threads:[~2013-12-19 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 18:08 ixgbevf: suspicious skb->pkt_type check Florian Fainelli
2013-12-19 20:35 ` John Fastabend

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).