3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 10:39:23 +01:00

eapol: authenticator: Drop unencrypted EAPoL frames

After the initial handshake, once the TK has been installed, all frames
coming to the AP should be encrypted.  However, it seems that some
kernel/driver combinations allow unencrypted EAPoL frames to be received
and forwarded to userspace.  This can lead to various attacks.

Some drivers can report whether the EAPoL frame has been received
unencrypted.  Use this information to drop unencrypted EAPoL frames
received after the initial handshake has been completed.
This commit is contained in:
Denis Kenzior 2022-05-10 16:03:54 -05:00
parent ccdea73df2
commit ee3a044b75

View File

@ -2547,6 +2547,11 @@ static void eapol_rx_auth_packet(uint16_t proto, const uint8_t *from,
if (proto != ETH_P_PAE || memcmp(from, sm->handshake->spa, 6)) if (proto != ETH_P_PAE || memcmp(from, sm->handshake->spa, 6))
return; return;
if (sm->handshake->ptk_complete && noencrypt) {
l_debug("Dropping unexpected unencrypted EAPoL frame");
return;
}
switch (frame->header.packet_type) { switch (frame->header.packet_type) {
case 0: /* EAPOL-EAP */ case 0: /* EAPOL-EAP */
if (!sm->eap) { if (!sm->eap) {