fix information leak in wireless extensions on 64-bit platforms
Subsystems (3)
Johannes Berg
maintainerPATCH 1/1 fix information leak in wireless extensions on 64-bit platforms
Wireless extensions on 64-bit platforms leak information from the kernel stack due to padding in structs that is copied. This affects any wireless event stream including scan results and so hence is available to unprivileged users.
This patch is a quick fix for this that simply zeroes out the padding in the structs before copying them until Jean comes up with the promised better fix, at which time he can revert this one along with his new patch.
--- include/net/iw_handler.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
include/net/iw_handler.h +20 -0
@@ -484,6 +484,9 @@ iwe_stream_add_event(char * stream, /* struct iw_event *iwe, /* Payload */ int event_len) /* Real size of payload */ { + /* clear padding */ + memset((char*)iwe + 4, 0, IW_EV_LCP_LEN - 4); +/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len;
@@ -505,6 +508,10 @@ iwe_stream_add_point(char * stream, /* char * extra) /* More payload */ {int event_len =IW_EV_POINT_LEN + iwe->u.data.length; + +/* clear padding */ +memset ((char *)iwe +4 ,0 ,IW_EV_LCP_LEN -4 ); +/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len;
@@ -531,6 +538,9 @@ iwe_stream_add_value(char * event, /* E struct iw_event *iwe, /* Payload */ int event_len) /* Real size of payload */ { + /* clear padding */ + memset((char*)iwe + 4, 0, IW_EV_LCP_LEN - 4); +/* Don't duplicate LCP */ event_len -=IW_EV_LCP_LEN ;
@@ -558,6 +568,9 @@ iwe_stream_check_add_event(char * stream int event_len, /* Size of payload */ int * perr) /* Error report */ { + /* clear padding */ + memset((char*)iwe + 4, 0, IW_EV_LCP_LEN - 4); +/* Check if it's possible, set error if not */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len;
@@ -582,6 +595,10 @@ iwe_stream_check_add_point(char * stream int * perr) /* Error report */ {int event_len =IW_EV_POINT_LEN + iwe->u.data.length; + +/* clear padding */ +memset ((char *)iwe +4 ,0 ,IW_EV_LCP_LEN -4 ); +/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len;
@@ -611,6 +628,9 @@ iwe_stream_check_add_value(char * event, int event_len, /* Size of payload */ int * perr) /* Error report */ { + /* clear padding */ + memset((char*)iwe + 4, 0, IW_EV_LCP_LEN - 4); +/* Don't duplicate LCP */ event_len -=IW_EV_LCP_LEN ;
Johannes Berg
maintainerQuoted 4 lines · Johannes Berg
Wireless extensions on 64-bit platforms leak information from the kernel stack due to padding in structs that is copied. This affects any wireless event stream including scan results and so hence is available to unprivileged users.
Ignore this patch, I see Jean just posted one as well :)
johannes
Quoted 9 lines · Johannes Berg
Quoted 4 lines · Johannes Berg
Wireless extensions on 64-bit platforms leak information from the kernel stack due to padding in structs that is copied. This affects any wireless event stream including scan results and so hence is available to unprivileged users.
Ignore this patch, I see Jean just posted one as well :)
johannes
Yes, sorry for the delay, I wanted to make sure I had all the
parts fully fleshed out.
Thanks !
Jean
Johannes Berg
maintainerQuoted 2 lines · Jean Tourrilhes
Yes, sorry for the delay, I wanted to make sure I had all the
parts fully fleshed out.
:)
Could you maybe send yours to stable too? Both of them I guess. Or do you want us (John I guess) to do that?
johannes
Quoted 11 lines · Johannes Berg
Quoted 2 lines · Jean Tourrilhes
Yes, sorry for the delay, I wanted to make sure I had all the
parts fully fleshed out.:)
Could you maybe send yours to stable too? Both of them I guess. Or do you want us (John I guess) to do that?
johannes
It seems that the lifetime of each stable branch is measured
in weeks (apart from 2.6.16), and being an old timer, gaining a few weeks does not seem to me to be worth the trouble. It's not like the bug is entirely new.
I'm personally more concerned about distro. If getting it into
stable would make it go into a distro release, then I would see more value. It seems that it's too late for the next release of Debian or Fedora, and I don't know if any distro is going to be based on this stable branch.
The last thing is that I could not test those stuff myself,
and the testing done for me was limited. I would be more confident if you were to give it a good beating before we push that into stable, because you know what to test.
Those are only my opinions. John is the man, so I let him
decide. John, if you feel like pushing it, please do it.
Have fun... Jean
Quoted 13 lines · Jean Tourrilhes
Quoted 11 lines · Johannes Berg
Quoted 2 lines · Jean Tourrilhes
Yes, sorry for the delay, I wanted to make sure I had all the
parts fully fleshed out.:)
Could you maybe send yours to stable too? Both of them I guess. Or do you want us (John I guess) to do that?
johannes
Quoted 9 lines
It seems that the lifetime of each stable branch is measured
in weeks (apart from 2.6.16), and being an old timer, gaining a few weeks does not seem to me to be worth the trouble. It's not like the bug is entirely new.
I'm personally more concerned about distro. If getting it into
stable would make it go into a distro release, then I would see more value. It seems that it's too late for the next release of Debian or Fedora, and I don't know if any distro is going to be based on this stable branch.
Lots of distros watch the stable branches to see what they need to pick up for their kernel releases.
So please don't just ignore them, lots of people depend on them, even outside of the distros.
thanks,
greg k-h
Quoted 2 lines · Jean Tourrilhes
value. It seems that it's too late for the next release of Debian or Fedora,
Wtf? It's too late for a security fix?
How can it be too late for a security fix?
Signature · 1 line
Greetings Michael.
Quoted 6 lines · Michael Buesch
Quoted 2 lines · Jean Tourrilhes
value. It seems that it's too late for the next release of Debian or Fedora,
Wtf? It's too late for a security fix?
How can it be too late for a security fix?
Note that I was making a prediction. We'll see if I'm right.
Let's not make blanket statements like this about security,
security is all about level of risk, there are various level of "security issues" and you need to assign the proper level to this one.
One one hand of the scale you have issues that allow remote
penetration. Those require immediate attention.
On the other end of the scale you have random information
leaks. Those are clearly important, but clearly not in the same category. They don't allow remote penetration. They don't allow priviledge escalation. They don't allow denial of service. The 4 bytes leaked are comming from mostly random allocated buffers. The potential of exploitation is very limited.
Both the Debian release and Fedora release are well into their
respective freeze. In particular, the Debian kernel is frozen and won't change until release. With the amount of issues and open bugs those kernel packagers have, everything is prioritised, and many things in their queue tend to be ignored.
The priority those maintainers will assign to this issue will
mostly go along the lines outlined above. Risk of changes and potential regression versus risk of attack.
This is why I made this prediction.
Quoted 1 line
Greetings Michael.
Jean
Quoted 2 lines · * Jean Tourrilhes ([email protected]) wrote:
It seems that the lifetime of each stable branch is measured
in weeks (apart from 2.6.16),
That's not accurate (apart from the fact that months are made of weeks ;-)
~2.5 months
2.6.15.1 Jan 15 2006 2.6.15.7 Mar 28 2006
[skipping 2.6.16 since it's still going]
~2 months
2.6.17.1 Aug 22 2006
2.6.17.14 Oct 13 2006
~3 months
2.6.18.1 Oct 14 2006
2.6.18.8 Feb 23 2007
~3 months
2.6.19.1 Dec 11 2006
2.6.19.7 Mar 3 2007
And to reiterate the sentiments of others. Security relevant bugs are always of interest to the stable team as well as distros.
Quoted 4 lines
The last thing is that I could not test those stuff myself,
and the testing done for me was limited. I would be more confident if you were to give it a good beating before we push that into stable, because you know what to test.
That's useful info. Have you had any luck (it looks pretty straight forward)?
thanks,
-chris
Quoted 9 lines · Chris Wright
Quoted 4 lines · * Jean Tourrilhes ([email protected]) wrote:
The last thing is that I could not test those stuff myself,
and the testing done for me was limited. I would be more confident if you were to give it a good beating before we push that into stable, because you know what to test.That's useful info. Have you had any luck (it looks pretty straight forward)?
Let's be more clear. I tested properly on 32 bits. But, 32
bits is not where there is issue, this issue is specific to 64 bits. I don't have a 64 bits platfor. It seems that few people doing wireless have access to 64 bits platform (actually, it seems most of them don't have access to SMP either), otherwise this would have been found many years ago.
Johannes is one of the few having access to 64 bits stuff.
Quoted 2 lines
thanks,
-chris
Have fun... Jean
Johannes Berg
maintainerQuoted 7 lines · Jean Tourrilhes
Let's be more clear. I tested properly on 32 bits. But, 32
bits is not where there is issue, this issue is specific to 64 bits. I don't have a 64 bits platfor. It seems that few people doing wireless have access to 64 bits platform (actually, it seems most of them don't have access to SMP either), otherwise this would have been found many years ago.
Johannes is one of the few having access to 64 bits stuff.
Few, heh. I'll give it a try next week. (actually, I don't have wireless on the 64-bit quad powermac but I can always plug in USB things)
johannes
Quoted 11 lines · Jean Tourrilhes
Quoted 9 lines · Chris Wright
Quoted 4 lines · * Jean Tourrilhes ([email protected]) wrote:
The last thing is that I could not test those stuff myself,
and the testing done for me was limited. I would be more confident if you were to give it a good beating before we push that into stable, because you know what to test.That's useful info. Have you had any luck (it looks pretty straight forward)?
Quoted 7 lines
Let's be more clear. I tested properly on 32 bits. But, 32
bits is not where there is issue, this issue is specific to 64 bits. I don't have a 64 bits platfor. It seems that few people doing wireless have access to 64 bits platform (actually, it seems most of them don't have access to SMP either), otherwise this would have been found many years ago.
Johannes is one of the few having access to 64 bits stuff.
I finally have an USB ZD stick now, too. So I can test stuff, too. Should I test this somehow?
Signature · 1 line
Greetings Michael.
Johannes Berg
maintainerQuoted 2 lines · Michael Buesch
I finally have an USB ZD stick now, too. So I can test stuff, too. Should I test this somehow?
If you can, build libiw and wireless tools 32-bit programs and enable the debug dump of the actual message (see one of my original mails), then run them with scanning. You'll get a wrong message and some zeroes where in my example the padding was not zeroed.
johannes
Quoted 4 lines · Michael Buesch
On Friday 23 March 2007 21:00, Jean Tourrilhes wrote:
I finally have an USB ZD stick now, too. So I can test stuff, too. Should I test this somehow?
Ok, here it goes.
Pick the latest version of wtools. You may want to compile it
static to avoid the need to install it.
To test the wpa patch, you need 32 bit userspace on 64 bit
kernel, and you need to try :
'iwlist genie'
To test the leak patch, you need a 64 kernel and any
userspace. You need two changes to enable the debugging code.
1) Put '#define DEBUG 1' on top of iwlib.c.
2) Change '#if 0' to '#if 1' line 783 of iwlist.c, at the
bottom of print_scanning_info().
Compile everything.
If you do a 'iwlist scan', it should dump the full content of
the stream. The first 4 bytes is the header (length + type). The next 4 bytes on 64 bits should be all zero.
This is what I don't want to see :
[19:00:1B:8B:50:8A:35:E0:09:00:01:00:50:8A:35:F0:47:6F:6C:6F:73:4E:65:74:7A
This is what I want to see :
[19:00:1B:8B:00:00:00:00:09:00:01:00:50:8A:35:F0:47:6F:6C:6F:73:4E:65:74:7A
Note that du to endian considerations you may have some of
your bytes swapped.
Quoted 1 line
Greetings Michael.
Good luck...
Jean
Quoted 10 lines · Jean Tourrilhes
Quoted 4 lines · Michael Buesch
On Friday 23 March 2007 21:00, Jean Tourrilhes wrote:
I finally have an USB ZD stick now, too. So I can test stuff, too. Should I test this somehow?
Ok, here it goes.
Pick the latest version of wtools. You may want to compile it
static to avoid the need to install it.
Quoted 5 lines
To test the wpa patch, you need 32 bit userspace on 64 bit
kernel, and you need to try :
'iwlist genie'To test the leak patch, you need a 64 kernel and any
Ok, so the most important question: Where to get the latest versions of these patches? :)
I kind of lost track of what was agreed on and what's latest, etc.. Some link to the mail?
Quoted 22 lines
userspace. You need two changes to enable the debugging code.
1) Put '#define DEBUG 1' on top ofiwlib.c.
2) Change '#if 0' to '#if 1' line 783 ofiwlist.c, at the
bottom ofprint_scanning_info().
Compile everything.
If you do a 'iwlist scan', it should dump the full content of
the stream. The first 4 bytes is the header (length + type). The next 4 bytes on 64 bits should be all zero.
This is what I don't want to see :
[19:00:1B:8B:50:8A:35:E0:09:00:01:00:50:8A:35:F0:47:6F:6C:6F:73:4E:65:74:7A
This is what I want to see :
[19:00:1B:8B:00:00:00:00:09:00:01:00:50:8A:35:F0:47:6F:6C:6F:73:4E:65:74:7A
Note that du to endian considerations you may have some of
your bytes swapped.Quoted 1 line
Greetings Michael.
Good luck...
Jean
Signature · 1 line
Greetings Michael.
Quoted 8 lines · Michael Buesch
Quoted 2 lines · Jean Tourrilhes
To test the leak patch, you need a 64 kernel and any
Ok, so the most important question: Where to get the latest versions of these patches? :)
I kind of lost track of what was agreed on and what's latest, etc.. Some link to the mail?
I should send less e-mail to the mailing list so they are
easier to find :
http://marc.info/?l=linux-netdev&m=117460953806538&w=2 http://marc.info/?l=linux-netdev&m=117460988706771&w=2 You will find the same patch attached to this e-mail. Jean
fs/compat_ioctl.c renamed from fs/compat_ioctl.j1.c +9 -0
@@ -2553,11 +2553,15 @@ HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctlHANDLE_IOCTL (I2C_SMBUS , do_i2c_smbus_ioctl) /* wireless */ HANDLE_IOCTL(SIOCGIWRANGE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWPRIV, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWSTATS, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWSPY, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWSPY, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWTHRSPY, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWTHRSPY, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWMLME, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWAPLIST, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWSCAN, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWSCAN, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWESSID, do_wireless_ioctl)HANDLE_IOCTL (SIOCGIWESSID , do_wireless_ioctl)
@@ -2565,6 +2569,11 @@ HANDLE_IOCTL(SIOCSIWNICKN, do_wireless_i HANDLE_IOCTL(SIOCGIWNICKN, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWGENIE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWGENIE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWENCODEEXT, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWENCODEEXT, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWPMKSA, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIFBR, old_bridge_ioctl) HANDLE_IOCTL(SIOCGIFBR, old_bridge_ioctl)HANDLE_IOCTL (RTC_IRQP_READ32 , rtc_ioctl)
include/linux/wireless.h renamed from include/linux/wireless.j1.h +18 -3
@@ -1,10 +1,10 @@/* * This file define a set of standard wireless extensions * -* Version : 21 14.3.06 +* Version : 22 16.3.07 * * Authors : Jean Tourrilhes - HPL - <[email protected]> -* Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. +* Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. */ #ifndef _LINUX_WIRELESS_H
@@ -85,7 +85,7 @@* (there is some stuff that will be added in the future...) * I just plan to increment with each new version. */ -#define WIRELESS_EXT 21 +#define WIRELESS_EXT 22/* * Changes :
@@ -221,6 +221,10 @@* - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers * - Power/Retry relative values no longer * 100000 * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI +* +* V21 to V22 +* ---------- +* - Prevent leaking of kernel space in stream on 64 bits. */ /**************************** CONSTANTS ****************************/
@@ -1085,4 +1089,15 @@ struct iw_event#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ IW_EV_POINT_OFF) +/* Size of the Event prefix when packed in stream */ +#define IW_EV_LCP_PK_LEN (4) +/* Size of the various events when packed in stream */ +#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) +#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) +#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) +#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) +#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) +#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) +#define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4) +#endif /* _LINUX_WIRELESS_H */
include/net/iw_handler.h renamed from include/net/iw_handler.j1.h +21 -9
@@ -1,10 +1,10 @@/* * This file define the new driver API for Wireless Extensions * -* Version : 7 18.3.05 +* Version : 8 16.3.07 * * Authors : Jean Tourrilhes - HPL - <[email protected]> -* Copyright (c) 2001-2006 Jean Tourrilhes, All Rights Reserved. +* Copyright (c) 2001-2007 Jean Tourrilhes, All Rights Reserved. */ #ifndef _IW_HANDLER_H
@@ -207,7 +207,7 @@* will be needed... * I just plan to increment with each new version. */ -#define IW_HANDLER_VERSION 7 +#define IW_HANDLER_VERSION 8/* * Changes :
@@ -239,6 +239,10 @@* - Remove (struct iw_point *)->pointer from events and streams * - Remove spy_offset from struct iw_handler_def * - Add "check" version of event macros for ieee802.11 stack +* +* V7 to V8 +* ---------- +* - Prevent leaking of kernel space in stream on 64 bits. */ /**************************** CONSTANTS ****************************/
@@ -500,7 +504,11 @@ iwe_stream_add_event(char * stream, /*/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe, event_len); +/* Beware of alignement issues on 64 bits */ +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN ); +memcpy (stream +IW_EV_LCP_LEN , + ((char *) iwe) +IW_EV_LCP_LEN , + event_len -IW_EV_LCP_LEN ); stream += event_len; }return stream;
@@ -521,10 +529,10 @@ iwe_stream_add_point(char * stream, /*/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe,IW_EV_LCP_LEN ); +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_LCP_LEN , ((char *) iwe) +IW_EV_LCP_LEN +IW_EV_POINT_OFF , -IW_EV_POINT_LEN -IW_EV_LCP_LEN ); +IW_EV_POINT_PK_LEN -IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_POINT_LEN , extra, iwe->u.data.length); stream += event_len; }
@@ -574,7 +582,11 @@ iwe_stream_check_add_event(char * stream/* Check if it's possible, set error if not */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe, event_len); +/* Beware of alignement issues on 64 bits */ +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN ); +memcpy (stream +IW_EV_LCP_LEN , + ((char *) iwe) +IW_EV_LCP_LEN , + event_len -IW_EV_LCP_LEN ); stream += event_len; }else *perr = -E2BIG ;
@@ -598,10 +610,10 @@ iwe_stream_check_add_point(char * stream/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe,IW_EV_LCP_LEN ); +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_LCP_LEN , ((char *) iwe) +IW_EV_LCP_LEN +IW_EV_POINT_OFF , -IW_EV_POINT_LEN -IW_EV_LCP_LEN ); +IW_EV_POINT_PK_LEN -IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_POINT_LEN , extra, iwe->u.data.length); stream += event_len; }else
net/core/rtnetlink.c renamed from net/core/rtnetlink.j1.c +2 -1
@@ -621,7 +621,8 @@ static int rtnl_getlink(struct sk_buff *if (err <0 ) goto errout; - iw += IW_EV_POINT_OFF; +/* Payload is at an offset in buffer */ + iw = iw_buf + IW_EV_POINT_OFF; }#endif /* CONFIG_NET_WIRELESS_RTNETLINK */
net/core/wireless.c renamed from net/core/wireless.j1.c +50 -32
216 lines not on this page · raw message
Quoted 7 lines · Johannes Berg
Quoted 4 lines · Johannes Berg
Wireless extensions on 64-bit platforms leak information from the kernel stack due to padding in structs that is copied. This affects any wireless event stream including scan results and so hence is available to unprivileged users.
Ignore this patch, I see Jean just posted one as well :)
Hmmm...I seem to have missed it. Perhaps I was too quick w/ the 'd' this morning? :-)
Jean, could you bounce me another copy?
Thanks,
John
Signature · 2 lines
John W. Linville [email protected]
Quoted 11 lines · John W. Linville
Quoted 7 lines · Johannes Berg
Quoted 4 lines · Johannes Berg
Wireless extensions on 64-bit platforms leak information from the kernel stack due to padding in structs that is copied. This affects any wireless event stream including scan results and so hence is available to unprivileged users.
Ignore this patch, I see Jean just posted one as well :)
Hmmm...I seem to have missed it. Perhaps I was too quick w/ the 'd' this morning? :-)
You too are getting far too much spam ?
Quoted 1 line
Jean, could you bounce me another copy?
No problem. Original e-mails here, patches attached : http://marc.info/?l=linux-netdev&m=117460953806538&w=2 http://marc.info/?l=linux-netdev&m=117460988706771&w=2 Note that you decide if you want this in stable as well...
Quoted 3 lines
Thanks,
John
Have fun... Jean
fs/compat_ioctl.c renamed from fs/compat_ioctl.j1.c +9 -0
@@ -2553,11 +2553,15 @@ HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctlHANDLE_IOCTL (I2C_SMBUS , do_i2c_smbus_ioctl) /* wireless */ HANDLE_IOCTL(SIOCGIWRANGE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWPRIV, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWSTATS, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWSPY, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWSPY, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWTHRSPY, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWTHRSPY, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWMLME, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWAPLIST, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWSCAN, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWSCAN, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWESSID, do_wireless_ioctl)HANDLE_IOCTL (SIOCGIWESSID , do_wireless_ioctl)
@@ -2565,6 +2569,11 @@ HANDLE_IOCTL(SIOCSIWNICKN, do_wireless_i HANDLE_IOCTL(SIOCGIWNICKN, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWGENIE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWGENIE, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWENCODEEXT, do_wireless_ioctl) +HANDLE_IOCTL(SIOCGIWENCODEEXT, do_wireless_ioctl) +HANDLE_IOCTL(SIOCSIWPMKSA, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIFBR, old_bridge_ioctl) HANDLE_IOCTL(SIOCGIFBR, old_bridge_ioctl)HANDLE_IOCTL (RTC_IRQP_READ32 , rtc_ioctl)
include/linux/wireless.h renamed from include/linux/wireless.j1.h +18 -3
@@ -1,10 +1,10 @@/* * This file define a set of standard wireless extensions * -* Version : 21 14.3.06 +* Version : 22 16.3.07 * * Authors : Jean Tourrilhes - HPL - <[email protected]> -* Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. +* Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. */ #ifndef _LINUX_WIRELESS_H
@@ -85,7 +85,7 @@* (there is some stuff that will be added in the future...) * I just plan to increment with each new version. */ -#define WIRELESS_EXT 21 +#define WIRELESS_EXT 22/* * Changes :
@@ -221,6 +221,10 @@* - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers * - Power/Retry relative values no longer * 100000 * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI +* +* V21 to V22 +* ---------- +* - Prevent leaking of kernel space in stream on 64 bits. */ /**************************** CONSTANTS ****************************/
@@ -1085,4 +1089,15 @@ struct iw_event#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ IW_EV_POINT_OFF) +/* Size of the Event prefix when packed in stream */ +#define IW_EV_LCP_PK_LEN (4) +/* Size of the various events when packed in stream */ +#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) +#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) +#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) +#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) +#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) +#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) +#define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4) +#endif /* _LINUX_WIRELESS_H */
include/net/iw_handler.h renamed from include/net/iw_handler.j1.h +21 -9
@@ -1,10 +1,10 @@/* * This file define the new driver API for Wireless Extensions * -* Version : 7 18.3.05 +* Version : 8 16.3.07 * * Authors : Jean Tourrilhes - HPL - <[email protected]> -* Copyright (c) 2001-2006 Jean Tourrilhes, All Rights Reserved. +* Copyright (c) 2001-2007 Jean Tourrilhes, All Rights Reserved. */ #ifndef _IW_HANDLER_H
@@ -207,7 +207,7 @@* will be needed... * I just plan to increment with each new version. */ -#define IW_HANDLER_VERSION 7 +#define IW_HANDLER_VERSION 8/* * Changes :
@@ -239,6 +239,10 @@* - Remove (struct iw_point *)->pointer from events and streams * - Remove spy_offset from struct iw_handler_def * - Add "check" version of event macros for ieee802.11 stack +* +* V7 to V8 +* ---------- +* - Prevent leaking of kernel space in stream on 64 bits. */ /**************************** CONSTANTS ****************************/
@@ -500,7 +504,11 @@ iwe_stream_add_event(char * stream, /*/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe, event_len); +/* Beware of alignement issues on 64 bits */ +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN ); +memcpy (stream +IW_EV_LCP_LEN , + ((char *) iwe) +IW_EV_LCP_LEN , + event_len -IW_EV_LCP_LEN ); stream += event_len; }return stream;
@@ -521,10 +529,10 @@ iwe_stream_add_point(char * stream, /*/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe,IW_EV_LCP_LEN ); +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_LCP_LEN , ((char *) iwe) +IW_EV_LCP_LEN +IW_EV_POINT_OFF , -IW_EV_POINT_LEN -IW_EV_LCP_LEN ); +IW_EV_POINT_PK_LEN -IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_POINT_LEN , extra, iwe->u.data.length); stream += event_len; }
@@ -574,7 +582,11 @@ iwe_stream_check_add_event(char * stream/* Check if it's possible, set error if not */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe, event_len); +/* Beware of alignement issues on 64 bits */ +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN ); +memcpy (stream +IW_EV_LCP_LEN , + ((char *) iwe) +IW_EV_LCP_LEN , + event_len -IW_EV_LCP_LEN ); stream += event_len; }else *perr = -E2BIG ;
@@ -598,10 +610,10 @@ iwe_stream_check_add_point(char * stream/* Check if it's possible */ if (likely ((stream + event_len) < ends)) { iwe->len = event_len; -memcpy (stream, (char *) iwe,IW_EV_LCP_LEN ); +memcpy (stream, (char *) iwe,IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_LCP_LEN , ((char *) iwe) +IW_EV_LCP_LEN +IW_EV_POINT_OFF , -IW_EV_POINT_LEN -IW_EV_LCP_LEN ); +IW_EV_POINT_PK_LEN -IW_EV_LCP_PK_LEN );memcpy (stream +IW_EV_POINT_LEN , extra, iwe->u.data.length); stream += event_len; }else
net/core/rtnetlink.c renamed from net/core/rtnetlink.j1.c +2 -1
@@ -621,7 +621,8 @@ static int rtnl_getlink(struct sk_buff *if (err <0 ) goto errout; - iw += IW_EV_POINT_OFF; +/* Payload is at an offset in buffer */ + iw = iw_buf + IW_EV_POINT_OFF; }#endif /* CONFIG_NET_WIRELESS_RTNETLINK */
net/core/wireless.c renamed from net/core/wireless.j1.c +50 -32
216 lines not on this page · raw message