Skip to contentSkip to conversation

A-MSDU deaggregation support

DISCUSSION Johannes Berg 3 participants 12 messages Sep 10, 2007 – Sep 28, 2007

lore
Share & tools
lore
#0 lore raw

Hey,

I just looked at the deaggregation code for unrelated reasons and thought about it a bit more; shouldn't there be some sort of checks that the 802.11 rules about identical addresses are adhered to to avoid having rogue packets pretending to come from somewhere else enter the networking stack? This can usually be avoided by using RSNA, but this code allows one to easily circumvent this which makes us look pretty bad.

Makes you wonder why they included full 802.3 framing in the subframes...

johannes

#1 lore raw
Quoted 10 lines · Johannes Berg

Hey,

I just looked at the deaggregation code for unrelated reasons and thought about it a bit more; shouldn't there be some sort of checks that the 802.11 rules about identical addresses are adhered to to avoid having rogue packets pretending to come from somewhere else enter the networking stack? This can usually be avoided by using RSNA, but this code allows one to easily circumvent this which makes us look pretty bad.

Quoted 3 lines

Makes you wonder why they included full 802.3 framing in the subframes...

There is difference between receiving and destination address. AP is receiving address but not the destination. If station sends packets to multiple stations it still go through one AP (receiving address). The only restriction is that all the packets in A-MSDU belongs to one TID stream.

There is actually different problem with the A-MSDU deaggregation and this is EPOL filtering. One of the packets might belong to EAPOL handshake

Tomas

Quoted 3 lines

johannes

#2 lore raw
Quoted 5 lines · Tomas Winkler

There is difference between receiving and destination address. AP is receiving address but not the destination. If station sends packets to multiple stations it still go through one AP (receiving address). The only restriction is that all the packets in A-MSDU belongs to one TID stream.

Good point. However, shouldn't we be checking the SA/TA?

Quoted 3 lines

There is actually different problem with the A-MSDU deaggregation and this is EPOL filtering. One of the packets might belong to EAPOL handshake

Good point as well. Also, there's still the headroom reservation thing I haven't really walked through.

But I would like to ask you to not work on this at this time, I'm going to make some larger changes in this area that may end up doing deaggregation in a loop and pushing the remaining packets through some more rx handling.

Michael had the idea to introduce a type of interface that would see all frames not destined for other interfaces including those eapol packets etc. to run the userspace mlme (wpa_supplicant or hostapd) on such an interface to avoid copying all data packets. This will most likely require framing the packet to 802.3 before it is cloned for each interface (currently we copy for each interface!), and hence the deaggregation would be done along with reframing regular packets, eapol/802.1X filtering would move behind that.

johannes

#3 lore raw
In reply to Tomas Winkler
Quoted 3 lines · Tomas Winkler

There is actually different problem with the A-MSDU deaggregation and this is EPOL filtering. One of the packets might belong to EAPOL handshake

Why do we filter those anyway? What's wrong with having them show up on the regular 802.3 framed interface all the time? Isn't that how 802.1X was basically designed?

johannes

#4 lore raw
Quoted 10 lines · Johannes Berg
Quoted 3 lines · Tomas Winkler

There is actually different problem with the A-MSDU deaggregation and this is EPOL filtering. One of the packets might belong to EAPOL handshake

Why do we filter those anyway? What's wrong with having them show up on the regular 802.3 framed interface all the time? Isn't that how 802.1X was basically designed?

EAPOL frames should not be filtered out. Everything else should be filtered out except EAPOL frames till the port is open.

The problem is the order of the handlers. First you need to deaggregated the frame then filtered out non EAPLOL frames if the port is not open.

Tomas

Quoted 3 lines

johannes

#5 lore raw
Quoted 2 lines · Tomas Winkler

EAPOL frames should not be filtered out. Everything else should be filtered out except EAPOL frames till the port is open.

Right now though, when we're an AP, we're sending EAPOL frames to the mgmt interface instead of the regular 802.3 interface. This quite sucks wrt. deagg. But it's also very weird, look at ieee80211_rx_h_802_1x_pae. It sends
* eapol frames for non-STA interfaces that are for us -> mgmt iface
* non-eapol frames from unauthorized STAs -> bitbucket
* everything else -> the regular 802.3 interface

Right afterwards, unencrypted non-EAPOL frames are dropped.

So any STA can actually send EAPOL frames with an arbitrary destination MAC address except our own into our 802.3 interface. Hence, it looks like the first case above is only for having eapol on mgmt iface.

The only problem I see with not doing this is that hostapd will have to listen for EAPOL frames on all VLAN interfaces but I suppose that is doable.

Quoted 3 lines

The problem is the order of the handlers. First you need to deaggregated the frame then filtered out non EAPLOL frames if the port is not open.

Yeah, I know, I had a plan a while back, will see if I can implement it.

johannes

#6 lore raw
Quoted 15 lines · Johannes Berg
Quoted 2 lines · Tomas Winkler

EAPOL frames should not be filtered out. Everything else should be filtered out except EAPOL frames till the port is open.

Right now though, when we're an AP, we're sending EAPOL frames to the mgmt interface instead of the regular 802.3 interface. This quite sucks wrt. deagg. But it's also very weird, look at ieee80211_rx_h_802_1x_pae. It sends
* eapol frames for non-STA interfaces that are for us -> mgmt iface
* non-eapol frames from unauthorized STAs -> bitbucket
* everything else -> the regular 802.3 interface

Right afterwards, unencrypted non-EAPOL frames are dropped.

Quoted 8 lines

So any STA can actually send EAPOL frames with an arbitrary destination MAC address except our own into our 802.3 interface. Hence, it looks like the first case above is only for having eapol on mgmt iface.

The only problem I see with not doing this is that hostapd will have to listen for EAPOL frames on all VLAN interfaces but I suppose that is doable.

I wonder of port control is done for ethernet. 1X is not WLAN invention. I'll try to dig it.

Quoted 6 lines
Quoted 3 lines

The problem is the order of the handlers. First you need to deaggregated the frame then filtered out non EAPLOL frames if the port is not open.

Yeah, I know, I had a plan a while back, will see if I can implement it.

Hope to get there as well in near future.

Quoted 3 lines

johannes

#7 lore raw
Quoted 6 lines · Tomas Winkler
Quoted 4 lines

The only problem I see with not doing this is that hostapd will have to listen for EAPOL frames on all VLAN interfaces but I suppose that is doable.

I wonder of port control is done for ethernet. 1X is not WLAN invention. I'll try to dig it.

I haven't ever seen it, but I'm not sure.

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

The problem is the order of the handlers. First you need to deaggregated the frame then filtered out non EAPLOL frames if the port is not open.

Yeah, I know, I had a plan a while back, will see if I can implement it..

Hope to get there as well in near future.

Ok, let me know what you plan to do. John has pushed the deagg patch into the "dungeon" branch so it's still there for reference.

johannes

#8 lore raw
Quoted 10 lines · Johannes Berg
Quoted 6 lines · Tomas Winkler
Quoted 4 lines

The only problem I see with not doing this is that hostapd will have to listen for EAPOL frames on all VLAN interfaces but I suppose that is doable.

I wonder of port control is done for ethernet. 1X is not WLAN invention. I'll try to dig it.

I haven't ever seen it, but I'm not sure.

I'm sure.

Quoted 11 lines
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

The problem is the order of the handlers. First you need to deaggregated the frame then filtered out non EAPLOL frames if the port is not open.

Yeah, I know, I had a plan a while back, will see if I can implement it.

Hope to get there as well in near future.

Ok, let me know what you plan to do. John has pushed the deagg patch into the "dungeon" branch so it's still there for reference.

Oh... another victim. Getting lost in current patch movement... Looks like most of the decision are happening somewhere else...

Quoted 3 lines

johannes

#9 lore raw
Quoted 6 lines · Tomas Winkler
Quoted 4 lines
Quoted 2 lines

I wonder of port control is done for ethernet. 1X is not WLAN invention. I'll try to dig it.

I haven't ever seen it, but I'm not sure.

I'm sure.

Oh, I know about 802.1X, sorry, meant that I haven't seen port control done in Linux.

Quoted 5 lines
Quoted 2 lines

Ok, let me know what you plan to do. John has pushed the deagg patch into the "dungeon" branch so it's still there for reference.

Oh... another victim. Getting lost in current patch movement... Looks like most of the decision are happening somewhere else...

That particular patch definitely had problems like the missing skb_reserve. Right now I'm thinking we should do PAE stuff after converting to 802.3 and do deaggregation at the same time as converting to 802.3 because that's basically what it is. But if you want to look at it I'll go back to making hostapd work.

johannes

#10 lore raw
In reply to Johannes Berg
Quoted 3 lines · Johannes Berg

So any STA can actually send EAPOL frames with an arbitrary destination MAC address except our own into our 802.3 interface. Hence, it looks like the first case above is only for having eapol on mgmt iface.

EAPOL ethertype is not supposed to be bridged, so it would be perfectly fine dropping these wherever it is most convenient to do.

Quoted 3 lines

The only problem I see with not doing this is that hostapd will have to listen for EAPOL frames on all VLAN interfaces but I suppose that is doable.

That's fine. This should be doable with just one packet socket that is not bound to any interface or alternatively with multiple sockets (one per interface). I wouldn't be too concerned about the extra cost here as long as the other EAPOL related silliness (e.g., the difference in encryption of re-keying packets in 802.1X with dynamic WEP vs. WPA).

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA
#11 lore raw
Quoted 8 lines · Jouni Malinen
Quoted 3 lines · Johannes Berg

So any STA can actually send EAPOL frames with an arbitrary destination MAC address except our own into our 802.3 interface. Hence, it looks like the first case above is only for having eapol on mgmt iface.

EAPOL ethertype is not supposed to be bridged, so it would be perfectly fine dropping these wherever it is most convenient to do.

Not sure I understand. If it's not supposed to be bridged then I hope the bridging code knows about this. Otherwise, we can fix it. But I don't understand the second part of your sentence, I was actually proposing not doing anything special to EAPOL packets at all except accepting them unencrypted.

Quoted 7 lines
Quoted 3 lines

The only problem I see with not doing this is that hostapd will have to listen for EAPOL frames on all VLAN interfaces but I suppose that is doable.

That's fine. This should be doable with just one packet socket that is not bound to any interface or alternatively with multiple sockets (one per interface).

Good point.

Quoted 3 lines

I wouldn't be too concerned about the extra cost here as
long as the other EAPOL related silliness (e.g., the difference in encryption of re-keying packets in 802.1X with dynamic WEP vs. WPA).

That sentence seems unfinished?

johannes