aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-10-25 18:36:40 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-26 16:52:42 -0400
commit9b395bc3be1cebf0144a127c7e67d56dbdac0930 (patch)
tree9cbe0d8566b890f43cd8d9f884f8b78104775f29 /include
parent4a4f1a5808c8bb0b72a4f6e5904c53fb8c9cd966 (diff)
mac80211: verify that skb data is present
A number of places in the mesh code don't check that the frame data is present and in the skb header when trying to access. Add those checks and the necessary pskb_may_pull() calls. This prevents accessing data that doesn't actually exist. To do this, export ieee80211_get_mesh_hdrlen() to be able to use it in mac80211. Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f8cd4cf3fad8..7d5b6000378b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2652,6 +2652,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
2652unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); 2652unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);
2653 2653
2654/** 2654/**
2655 * ieee80211_get_mesh_hdrlen - get mesh extension header length
2656 * @meshhdr: the mesh extension header, only the flags field
2657 * (first byte) will be accessed
2658 * Returns the length of the extension header, which is always at
2659 * least 6 bytes and at most 18 if address 5 and 6 are present.
2660 */
2661unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr);
2662
2663/**
2655 * DOC: Data path helpers 2664 * DOC: Data path helpers
2656 * 2665 *
2657 * In addition to generic utilities, cfg80211 also offers 2666 * In addition to generic utilities, cfg80211 also offers