Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F96064222
D30665.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D30665.diff
View Options
diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c
--- a/sys/net80211/ieee80211_adhoc.c
+++ b/sys/net80211/ieee80211_adhoc.c
@@ -571,7 +571,10 @@
IEEE80211_NODE_STAT(ni, rx_decap);
goto err;
}
- eh = mtod(m, struct ether_header *);
+ if (!(qos & IEEE80211_QOS_AMSDU))
+ eh = mtod(m, struct ether_header *);
+ else
+ eh = NULL;
if (!ieee80211_node_is_authorized(ni)) {
/*
* Deny any non-PAE frames received prior to
@@ -581,11 +584,13 @@
* the port is not marked authorized by the
* authenticator until the handshake has completed.
*/
- if (eh->ether_type != htons(ETHERTYPE_PAE)) {
+ if (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE)) {
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
- eh->ether_shost, "data",
- "unauthorized port: ether type 0x%x len %u",
- eh->ether_type, m->m_pkthdr.len);
+ ni->ni_macaddr, "data", "unauthorized or "
+ "unknown port: ether type 0x%x len %u",
+ eh == NULL ? -1 : eh->ether_type,
+ m->m_pkthdr.len);
vap->iv_stats.is_rx_unauth++;
IEEE80211_NODE_STAT(ni, rx_unauth);
goto err;
@@ -598,7 +603,8 @@
if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
(is_hw_decrypted == 0) &&
- eh->ether_type != htons(ETHERTYPE_PAE)) {
+ (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE))) {
/*
* Drop unencrypted frames.
*/
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -757,7 +757,10 @@
IEEE80211_NODE_STAT(ni, rx_decap);
goto err;
}
- eh = mtod(m, struct ether_header *);
+ if (!(qos & IEEE80211_QOS_AMSDU))
+ eh = mtod(m, struct ether_header *);
+ else
+ eh = NULL;
if (!ieee80211_node_is_authorized(ni)) {
/*
* Deny any non-PAE frames received prior to
@@ -767,11 +770,13 @@
* the port is not marked authorized by the
* authenticator until the handshake has completed.
*/
- if (eh->ether_type != htons(ETHERTYPE_PAE)) {
+ if (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE)) {
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
- eh->ether_shost, "data",
- "unauthorized port: ether type 0x%x len %u",
- eh->ether_type, m->m_pkthdr.len);
+ ni->ni_macaddr, "data", "unauthorized or "
+ "unknown port: ether type 0x%x len %u",
+ eh == NULL ? -1 : eh->ether_type,
+ m->m_pkthdr.len);
vap->iv_stats.is_rx_unauth++;
IEEE80211_NODE_STAT(ni, rx_unauth);
goto err;
@@ -784,7 +789,8 @@
if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
(is_hw_decrypted == 0) &&
- eh->ether_type != htons(ETHERTYPE_PAE)) {
+ (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE))) {
/*
* Drop unencrypted frames.
*/
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c
--- a/sys/net80211/ieee80211_sta.c
+++ b/sys/net80211/ieee80211_sta.c
@@ -840,7 +840,10 @@
IEEE80211_NODE_STAT(ni, rx_decap);
goto err;
}
- eh = mtod(m, struct ether_header *);
+ if (!(qos & IEEE80211_QOS_AMSDU))
+ eh = mtod(m, struct ether_header *);
+ else
+ eh = NULL;
if (!ieee80211_node_is_authorized(ni)) {
/*
* Deny any non-PAE frames received prior to
@@ -850,11 +853,13 @@
* the port is not marked authorized by the
* authenticator until the handshake has completed.
*/
- if (eh->ether_type != htons(ETHERTYPE_PAE)) {
+ if (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE)) {
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
- eh->ether_shost, "data",
- "unauthorized port: ether type 0x%x len %u",
- eh->ether_type, m->m_pkthdr.len);
+ ni->ni_macaddr, "data", "unauthorized or "
+ "unknown port: ether type 0x%x len %u",
+ eh == NULL ? -1 : eh->ether_type,
+ m->m_pkthdr.len);
vap->iv_stats.is_rx_unauth++;
IEEE80211_NODE_STAT(ni, rx_unauth);
goto err;
@@ -867,7 +872,8 @@
if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
(is_hw_decrypted == 0) &&
- eh->ether_type != htons(ETHERTYPE_PAE)) {
+ (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE))) {
/*
* Drop unencrypted frames.
*/
diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c
--- a/sys/net80211/ieee80211_wds.c
+++ b/sys/net80211/ieee80211_wds.c
@@ -634,7 +634,10 @@
IEEE80211_NODE_STAT(ni, rx_decap);
goto err;
}
- eh = mtod(m, struct ether_header *);
+ if (!(qos & IEEE80211_QOS_AMSDU))
+ eh = mtod(m, struct ether_header *);
+ else
+ eh = NULL;
if (!ieee80211_node_is_authorized(ni)) {
/*
* Deny any non-PAE frames received prior to
@@ -644,11 +647,13 @@
* the port is not marked authorized by the
* authenticator until the handshake has completed.
*/
- if (eh->ether_type != htons(ETHERTYPE_PAE)) {
+ if (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE)) {
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
- eh->ether_shost, "data",
- "unauthorized port: ether type 0x%x len %u",
- eh->ether_type, m->m_pkthdr.len);
+ ni->ni_macaddr, "data", "unauthorized or "
+ "unknown port: ether type 0x%x len %u",
+ eh == NULL ? -1 : eh->ether_type,
+ m->m_pkthdr.len);
vap->iv_stats.is_rx_unauth++;
IEEE80211_NODE_STAT(ni, rx_unauth);
goto err;
@@ -661,7 +666,8 @@
if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
(is_hw_decrypted == 0) &&
- eh->ether_type != htons(ETHERTYPE_PAE)) {
+ (eh == NULL ||
+ eh->ether_type != htons(ETHERTYPE_PAE))) {
/*
* Drop unencrypted frames.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 24, 1:27 PM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12666484
Default Alt Text
D30665.diff (5 KB)
Attached To
Mode
D30665: net80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames
Attached
Detach File
Event Timeline
Log In to Comment