mac80211: add skb length sanity checking
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 23 Mar 2009 16:28:40 +0000 (17:28 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Sat, 28 Mar 2009 00:13:22 +0000 (20:13 -0400)
commita220858d30604902f650074bfac5a7598bc97ea4
tree3a4ad6d80713953598f6f872103291e69cf1ac6b
parentb1720231ca07dee3382980f3b25e6581bd2e54e9
mac80211: add skb length sanity checking

We just found a bug in zd1211rw where it would reject
packets in the ->tx() method but leave them modified,
which would cause retransmit attempts with completely
bogus skbs, eventually leading to a panic due to not
having enough headroom in those.

This patch adds a sanity check to mac80211 to catch
such driver mistakes; in this case we warn and drop
the skb.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/tx.c