summaryrefslogtreecommitdiffstats
path: root/abs/core/ndiswrapper
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/ndiswrapper')
-rw-r--r--abs/core/ndiswrapper/PKGBUILD32
-rw-r--r--abs/core/ndiswrapper/kernel-2.6.27.patch116
-rw-r--r--abs/core/ndiswrapper/ndiswrapper-CVE-2008-4395.patch86
-rw-r--r--abs/core/ndiswrapper/ndiswrapper.install6
4 files changed, 224 insertions, 16 deletions
diff --git a/abs/core/ndiswrapper/PKGBUILD b/abs/core/ndiswrapper/PKGBUILD
index 927dc8c..d0c9886 100644
--- a/abs/core/ndiswrapper/PKGBUILD
+++ b/abs/core/ndiswrapper/PKGBUILD
@@ -1,29 +1,35 @@
-#$Id: PKGBUILD 7906 2008-08-05 07:01:51Z tpowa $
+#$Id: PKGBUILD 22488 2008-12-26 22:47:09Z tpowa $
#Maintainer: Tobias Powalowski <tpowa@archlinux.org>
pkgname=ndiswrapper
-_kernver=2.6.26-ARCH
+_kernver=2.6.28-LinHES
pkgver=1.53
-pkgrel=1
+pkgrel=6
pkgdesc="Module for NDIS (Windows Network Drivers) drivers supplied by vendors. For stock arch 2.6 kernel."
license=('GPL')
arch=(i686 x86_64)
url="http://ndiswrapper.sourceforge.net"
install="ndiswrapper.install"
-depends=("ndiswrapper-utils=$pkgver" 'kernel26>=2.6.26-1' 'kernel26<2.6.27')
-source=(http://downloads.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-$pkgver.tar.gz)
+depends=("ndiswrapper-utils=$pkgver" 'kernel26>=2.6.28' 'kernel26<2.6.29')
+source=(http://downloads.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-$pkgver.tar.gz
+ kernel-2.6.27.patch
+ ndiswrapper-CVE-2008-4395.patch)
+md5sums=('393c6e6ab0803963148e18538601cdec'
+ 'cd09562c4afdbd20a0237a5e6d976b31'
+ 'b35e548a0c9eb1395f6f7b434a258ddf')
build()
{
- cd $startdir/src/ndiswrapper-$pkgver/driver
- make KVERS=$_kernver
- make DESTDIR=$startdir/pkg KVERS=$_kernver install || return 1
- rm $startdir/pkg/lib/modules/$_kernver/modules.* #wtf?
+ cd $srcdir/ndiswrapper-$pkgver/driver
+ patch -Np1 -i ../../kernel-2.6.27.patch || return 1
+ patch -Np3 -i ../../ndiswrapper-CVE-2008-4395.patch || return 1
+ make KVERS=$_kernver || return 1
+ make DESTDIR=$pkgdir KVERS=$_kernver install || return 1
+ rm $pkgdir/lib/modules/$_kernver/modules.* #wtf?
sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" $startdir/*.install
# move it to correct kernel directory
- mkdir -p $startdir/pkg/lib/modules/$_kernver/kernel/drivers/net/wireless/ndiswrapper
- mv $startdir/pkg/lib/modules/$_kernver/misc/* $startdir/pkg/lib/modules/$_kernver/kernel/drivers/net/wireless/ndiswrapper/
- rm -r $startdir/pkg/lib/modules/$_kernver/misc/
+ mkdir -p $pkgdir/lib/modules/$_kernver/kernel/drivers/net/wireless/ndiswrapper
+ mv $pkgdir/lib/modules/$_kernver/misc/* $pkgdir/lib/modules/$_kernver/kernel/drivers/net/wireless/ndiswrapper/
+ rm -r $pkgdir/lib/modules/$_kernver/misc/
}
-md5sums=('393c6e6ab0803963148e18538601cdec')
diff --git a/abs/core/ndiswrapper/kernel-2.6.27.patch b/abs/core/ndiswrapper/kernel-2.6.27.patch
new file mode 100644
index 0000000..522dfe9
--- /dev/null
+++ b/abs/core/ndiswrapper/kernel-2.6.27.patch
@@ -0,0 +1,116 @@
+diff -aur driver.old/iw_ndis.c driver/iw_ndis.c
+--- driver.old/iw_ndis.c 2008-08-04 21:10:16.000000000 +0200
++++ driver/iw_ndis.c 2008-08-04 21:30:12.000000000 +0200
+@@ -1015,7 +1015,7 @@
+ return 0;
+ }
+
+-static char *ndis_translate_scan(struct net_device *dev, char *event,
++static char *ndis_translate_scan(struct net_device *dev, struct iw_request_info *info, char *event,
+ char *end_buf, void *item)
+ {
+ struct iw_event iwe;
+@@ -1034,7 +1034,7 @@
+ iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
+ iwe.len = IW_EV_ADDR_LEN;
+ memcpy(iwe.u.ap_addr.sa_data, bssid->mac, ETH_ALEN);
+- event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_ADDR_LEN);
++ event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_ADDR_LEN);
+
+ /* add essid */
+ memset(&iwe, 0, sizeof(iwe));
+@@ -1044,13 +1044,13 @@
+ iwe.u.data.length = IW_ESSID_MAX_SIZE;
+ iwe.u.data.flags = 1;
+ iwe.len = IW_EV_POINT_LEN + iwe.u.data.length;
+- event = iwe_stream_add_point(event, end_buf, &iwe, bssid->ssid.essid);
++ event = iwe_stream_add_point(info, event, end_buf, &iwe, bssid->ssid.essid);
+
+ /* add protocol name */
+ memset(&iwe, 0, sizeof(iwe));
+ iwe.cmd = SIOCGIWNAME;
+ strncpy(iwe.u.name, network_type_to_name(bssid->net_type), IFNAMSIZ);
+- event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_CHAR_LEN);
++ event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_CHAR_LEN);
+
+ /* add mode */
+ memset(&iwe, 0, sizeof(iwe));
+@@ -1061,7 +1061,7 @@
+ iwe.u.mode = IW_MODE_INFRA;
+ else // if (bssid->mode == Ndis802_11AutoUnknown)
+ iwe.u.mode = IW_MODE_AUTO;
+- event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_UINT_LEN);
++ event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_UINT_LEN);
+
+ /* add freq */
+ memset(&iwe, 0, sizeof(iwe));
+@@ -1076,7 +1076,7 @@
+ /* convert from kHz to Hz */
+ iwe.u.freq.e += 3;
+ iwe.len = IW_EV_FREQ_LEN;
+- event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_FREQ_LEN);
++ event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_FREQ_LEN);
+
+ /* add qual */
+ memset(&iwe, 0, sizeof(iwe));
+@@ -1090,7 +1090,7 @@
+ iwe.u.qual.noise = WL_NOISE;
+ iwe.u.qual.qual = i;
+ iwe.len = IW_EV_QUAL_LEN;
+- event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_QUAL_LEN);
++ event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_QUAL_LEN);
+
+ /* add key info */
+ memset(&iwe, 0, sizeof(iwe));
+@@ -1101,7 +1101,7 @@
+ iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
+ iwe.u.data.length = 0;
+ iwe.len = IW_EV_POINT_LEN;
+- event = iwe_stream_add_point(event, end_buf, &iwe, bssid->ssid.essid);
++ event = iwe_stream_add_point(info, event, end_buf, &iwe, bssid->ssid.essid);
+
+ /* add rate */
+ memset(&iwe, 0, sizeof(iwe));
+@@ -1115,7 +1115,7 @@
+ if (bssid->rates[i] & 0x7f) {
+ iwe.u.bitrate.value = ((bssid->rates[i] & 0x7f) *
+ 500000);
+- current_val = iwe_stream_add_value(event, current_val,
++ current_val = iwe_stream_add_value(info, event, current_val,
+ end_buf, &iwe,
+ IW_EV_PARAM_LEN);
+ }
+@@ -1128,13 +1128,13 @@
+ iwe.cmd = IWEVCUSTOM;
+ sprintf(buf, "bcn_int=%d", bssid->config.beacon_period);
+ iwe.u.data.length = strlen(buf);
+- event = iwe_stream_add_point(event, end_buf, &iwe, buf);
++ event = iwe_stream_add_point(info, event, end_buf, &iwe, buf);
+
+ memset(&iwe, 0, sizeof(iwe));
+ iwe.cmd = IWEVCUSTOM;
+ sprintf(buf, "atim=%u", bssid->config.atim_window);
+ iwe.u.data.length = strlen(buf);
+- event = iwe_stream_add_point(event, end_buf, &iwe, buf);
++ event = iwe_stream_add_point(info, event, end_buf, &iwe, buf);
+
+ TRACE2("%d, %u", bssid->length, (unsigned int)sizeof(*bssid));
+ if (bssid->length > sizeof(*bssid)) {
+@@ -1155,7 +1155,7 @@
+ memset(&iwe, 0, sizeof(iwe));
+ iwe.cmd = IWEVGENIE;
+ iwe.u.data.length = ielen;
+- event = iwe_stream_add_point(event, end_buf,
++ event = iwe_stream_add_point(info, event, end_buf,
+ &iwe, iep);
+ }
+ iep += ielen;
+@@ -1236,7 +1236,7 @@
+ TRACE2("%d", bssid_list->num_items);
+ cur_item = &bssid_list->bssid[0];
+ for (i = 0; i < bssid_list->num_items; i++) {
+- event = ndis_translate_scan(dev, event,
++ event = ndis_translate_scan(dev, info, event,
+ extra + IW_SCAN_MAX_DATA, cur_item);
+ cur_item = (struct ndis_wlan_bssid *)((char *)cur_item +
+ cur_item->length);
diff --git a/abs/core/ndiswrapper/ndiswrapper-CVE-2008-4395.patch b/abs/core/ndiswrapper/ndiswrapper-CVE-2008-4395.patch
new file mode 100644
index 0000000..53682e0
--- /dev/null
+++ b/abs/core/ndiswrapper/ndiswrapper-CVE-2008-4395.patch
@@ -0,0 +1,86 @@
+diff --git a/ubuntu/ndiswrapper/iw_ndis.c b/ubuntu/ndiswrapper/iw_ndis.c
+index b114ef6..01d3751 100644
+--- a/ubuntu/ndiswrapper/iw_ndis.c
++++ b/ubuntu/ndiswrapper/iw_ndis.c
+@@ -47,12 +47,7 @@ int set_essid(struct ndis_device *wnd, const char *ssid, int ssid_len)
+ req.length = ssid_len;
+ if (ssid_len)
+ memcpy(&req.essid, ssid, ssid_len);
+- DBG_BLOCK(2) {
+- char buf[NDIS_ESSID_MAX_SIZE+1];
+- memcpy(buf, ssid, ssid_len);
+- buf[ssid_len] = 0;
+- TRACE2("ssid = '%s'", buf);
+- }
++ TRACE2("ssid = '%.*s'", ssid_len, ssid);
+
+ res = mp_set(wnd, OID_802_11_SSID, &req, sizeof(req));
+ if (res) {
+@@ -125,7 +120,6 @@ static int iw_get_essid(struct net_device *dev, struct iw_request_info *info,
+ EXIT2(return -EOPNOTSUPP);
+ }
+ memcpy(extra, req.essid, req.length);
+- extra[req.length] = 0;
+ if (req.length > 0)
+ wrqu->essid.flags = 1;
+ else
+@@ -1000,7 +994,7 @@ static int iw_set_nick(struct net_device *dev, struct iw_request_info *info,
+
+ if (wrqu->data.length > IW_ESSID_MAX_SIZE || wrqu->data.length <= 0)
+ return -EINVAL;
+- memset(wnd->nick, 0, sizeof(wnd->nick));
++ wnd->nick_len = wrqu->data.length;
+ memcpy(wnd->nick, extra, wrqu->data.length);
+ return 0;
+ }
+@@ -1010,7 +1004,7 @@ static int iw_get_nick(struct net_device *dev, struct iw_request_info *info,
+ {
+ struct ndis_device *wnd = netdev_priv(dev);
+
+- wrqu->data.length = strlen(wnd->nick);
++ wrqu->data.length = wnd->nick_len;
+ memcpy(extra, wnd->nick, wrqu->data.length);
+ return 0;
+ }
+diff --git a/ubuntu/ndiswrapper/ndis.h b/ubuntu/ndiswrapper/ndis.h
+index 27ba99e..65d6b0b 100644
+--- a/ubuntu/ndiswrapper/ndis.h
++++ b/ubuntu/ndiswrapper/ndis.h
+@@ -878,6 +878,7 @@ struct ndis_device {
+ unsigned long scan_timestamp;
+ struct encr_info encr_info;
+ char nick[IW_ESSID_MAX_SIZE];
++ size_t nick_len;
+ struct ndis_essid essid;
+ struct auth_encr_capa capa;
+ enum ndis_infrastructure_mode infrastructure_mode;
+diff --git a/ubuntu/ndiswrapper/proc.c b/ubuntu/ndiswrapper/proc.c
+index fd5f433..6feff23 100644
+--- a/ubuntu/ndiswrapper/proc.c
++++ b/ubuntu/ndiswrapper/proc.c
+@@ -97,10 +97,8 @@ static int procfs_read_ndis_encr(char *page, char **start, off_t off,
+ p += sprintf(p, "\n");
+
+ res = mp_query(wnd, OID_802_11_SSID, &essid, sizeof(essid));
+- if (!res) {
+- essid.essid[essid.length] = '\0';
+- p += sprintf(p, "essid=%s\n", essid.essid);
+- }
++ if (!res)
++ p += sprintf(p, "essid=%.*s\n", essid.length, essid.essid);
+ res = mp_query_int(wnd, OID_802_11_ENCRYPTION_STATUS, &encr_status);
+ if (!res) {
+ typeof(&wnd->encr_info.keys[0]) tx_key;
+diff --git a/ubuntu/ndiswrapper/wrapndis.c b/ubuntu/ndiswrapper/wrapndis.c
+index f6e5d46..35ef1cd 100644
+--- a/ubuntu/ndiswrapper/wrapndis.c
++++ b/ubuntu/ndiswrapper/wrapndis.c
+@@ -2028,7 +2028,7 @@ static wstdcall NTSTATUS NdisAddDevice(struct driver_object *drv_obj,
+ wnd->attributes = 0;
+ wnd->dma_map_count = 0;
+ wnd->dma_map_addr = NULL;
+- wnd->nick[0] = 0;
++ wnd->nick_len = 0;
+ init_timer(&wnd->hangcheck_timer);
+ wnd->scan_timestamp = 0;
+ init_timer(&wnd->iw_stats_timer);
diff --git a/abs/core/ndiswrapper/ndiswrapper.install b/abs/core/ndiswrapper/ndiswrapper.install
index 696f2d4..e173d14 100644
--- a/abs/core/ndiswrapper/ndiswrapper.install
+++ b/abs/core/ndiswrapper/ndiswrapper.install
@@ -2,7 +2,7 @@
post_install()
{
ndiswrapper -m
- KERNEL_VERSION='2.6.26-ARCH'
+ KERNEL_VERSION='2.6.28-LinHES'
depmod -ae -v $KERNEL_VERSION > /dev/null 2>&1
}
@@ -11,14 +11,14 @@ post_install()
post_upgrade()
{
ndiswrapper -m
- KERNEL_VERSION='2.6.26-ARCH'
+ KERNEL_VERSION='2.6.28-LinHES'
depmod -ae -v $KERNEL_VERSION > /dev/null 2>&1
}
# arg 1: the old package version
post_remove()
{
- KERNEL_VERSION='2.6.26-ARCH'
+ KERNEL_VERSION='2.6.28-LinHES'
depmod -ae -v $KERNEL_VERSION > /dev/null 2>&1
}