[pkg-fso-commits] [SCM] linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko branch, stable, updated. upstream/20080903.git2ea34171-31-g9706327

Andy Green agreen at pads.home.warmcat.com
Tue Nov 11 21:39:13 UTC 2008


The following commit has been merged in the stable branch:
commit 89e2c1f006e4d5936a8e0edec74d64b71063e3c1
Author: Werner Almesberger <werner at openmoko.org>
Date:   Tue Sep 16 08:54:07 2008 +0100

    ar6k-essid-one-and-32.patch
    
    This patch allows ESSID with length 1, which were rejected because the
    stack assumed iwconfig used a different format in the ioctl's payload.
    
    It also refuses ESSIDs longer than 31 bytes, because there is some
    buffer overrun issue buried somewhere else in the stack. In principle,
    32 bytes should be fine.
    
    Open issue:
    - where is the 32 bytes overrun ?
    
    Signed-off-by: Werner Almesberger <werner at openmoko.org>

diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c b/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
index ede8e62..56ceb2e 100644
--- a/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
+++ b/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
@@ -264,12 +264,11 @@ ar6000_ioctl_siwessid(struct net_device *dev,
     }
 
     /*
-     * iwconfig passes a null terminated string with length including this
-     * so we need to account for this
+     * iwconfig passes a string with length excluding any trailing NUL.
+     * FIXME: we should be able to set an ESSID of 32 bytes, yet things fall
+     * over badly if we do. So we limit the ESSID to 31 bytes.
      */
-    if (data->flags && (!data->length || (data->length == 1) ||
-        ((data->length - 1) > sizeof(ar->arSsid))))
-    {
+    if (data->flags && (!data->length || data->length >= sizeof(ar->arSsid))) {
         /*
          * ssid is invalid
          */

-- 
linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko



More information about the pkg-fso-commits mailing list