Re: [GIT]: Networking (WEXT events and 64/32 compat)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jouni Malinen
Date: Wednesday, September 17, 2008 - 12:11 pm

On Mon, Sep 08, 2008 at 09:05:25PM -0700, Jouni Malinen wrote:

I was able to test this with a 64/32-bit setup and confirmed that both
IWEVCUSTOM and the new IWEVASSOCREQIE/IWEVASSOCRESPIE are indeed failing
when using 32-bit binary in userspace (and work with 64-bit). The length
field is parsed incorrectly for all these events.

wpa_supplicant has code for rejecting IWEVCUSTOM events that have too
large a value in the length field. However, same validation is not done
for IWEVASSOCREQIE/IWEVASSOCRESPIE (i.e., wpa_supplicant relies on
kernel providing the correct value for the length field). As the end
result, the new IWEVASSOCREQIE/IWEVASSOCRESPIE events will trigger a
segmentation fault in wpa_supplicant when the buffer is being read way
beyond its end.

I'll make wpa_supplicant validate the length field for all WEXT events
to avoid the crash. This was enough to make association work with the
reverted mac80211 patch since the values from these association info
events are not critical for many use cases.

Since we cannot fix the kernel code to handle the WEXT events for all
cases (e.g., 64-bit kernel and mix of 32-bit and 64-bit userspace
apps), I could consider adding a workaround in wpa_supplicant to handle
the 64-bit data being received in 32-bit app.. However, that would not
fix problems for anyone using older versions of wpa_supplicant.

Would it be acceptable to ever enable use of IWEVASSOCREQIE /
IWEVSSOCRESPIE in kernel if the workaround were available in new
wpa_supplicant versions? Or should we try to add a new WEXT event
type that uses fixed size for the length field and then replace the old
IWEVCUSTOM with the new type since IWEVCUSTOM does not work with
64/32-bit case (wpa_supplicant just knows how to avoid processing that
bogus event data)?

-- 
Jouni Malinen                                            PGP id EFC895FA
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT]: Networking, David Miller, (Wed Aug 27, 4:46 pm)
Re: [GIT]: Networking, Alex Williamson, (Fri Sep 5, 8:08 am)
Re: [GIT]: Networking, Linus Torvalds, (Fri Sep 5, 10:45 am)
Re: [GIT]: Networking, John W. Linville, (Fri Sep 5, 11:17 am)
Re: [GIT]: Networking, Jouni Malinen, (Mon Sep 8, 7:44 pm)
Re: [GIT]: Networking, David Miller, (Mon Sep 8, 7:46 pm)
Re: [GIT]: Networking, Jouni Malinen, (Mon Sep 8, 7:55 pm)
Re: [GIT]: Networking, Jouni Malinen, (Mon Sep 8, 8:06 pm)
Re: [GIT]: Networking, Alex Williamson, (Mon Sep 8, 8:08 pm)
Re: [GIT]: Networking, David Miller, (Mon Sep 8, 8:43 pm)
Re: [GIT]: Networking, Jouni Malinen, (Mon Sep 8, 9:05 pm)
Re: [GIT]: Networking, David Miller, (Mon Sep 8, 9:15 pm)
Re: [GIT]: Networking, Jouni Malinen, (Mon Sep 8, 10:34 pm)
Re: [GIT]: Networking (WEXT events and 64/32 compat), Jouni Malinen, (Wed Sep 17, 12:11 pm)
Re: [GIT]: Networking (WEXT events and 64/32 compat), David Miller, (Wed Sep 17, 1:11 pm)
Re: [GIT]: Networking (WEXT events and 64/32 compat), John W. Linville, (Thu Sep 18, 6:41 am)
Re: [GIT]: Networking (WEXT events and 64/32 compat), Jouni Malinen, (Thu Sep 18, 3:13 pm)