summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-wireless/ndiswrapper')
-rw-r--r--net-wireless/ndiswrapper/ChangeLog8
-rw-r--r--net-wireless/ndiswrapper/files/ndiswrapper-CVE-2008-4395.patch86
-rw-r--r--net-wireless/ndiswrapper/ndiswrapper-1.53-r1.ebuild124
3 files changed, 217 insertions, 1 deletions
diff --git a/net-wireless/ndiswrapper/ChangeLog b/net-wireless/ndiswrapper/ChangeLog
index 35b6ca3931c7..c45f19ff509e 100644
--- a/net-wireless/ndiswrapper/ChangeLog
+++ b/net-wireless/ndiswrapper/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-wireless/ndiswrapper
# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-wireless/ndiswrapper/ChangeLog,v 1.102 2008/05/30 10:33:36 peper Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/ndiswrapper/ChangeLog,v 1.103 2008/10/27 12:52:56 peper Exp $
+
+*ndiswrapper-1.53-r1 (27 Oct 2008)
+
+ 27 Oct 2008; Piotr Jaroszyński <peper@gentoo.org>
+ +files/ndiswrapper-CVE-2008-4395.patch, +ndiswrapper-1.53-r1.ebuild:
+ Add 1.53-r1 straight to x86. Security bug #239371.
*ndiswrapper-1.53 (30 May 2008)
diff --git a/net-wireless/ndiswrapper/files/ndiswrapper-CVE-2008-4395.patch b/net-wireless/ndiswrapper/files/ndiswrapper-CVE-2008-4395.patch
new file mode 100644
index 000000000000..53682e0e629a
--- /dev/null
+++ b/net-wireless/ndiswrapper/files/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/net-wireless/ndiswrapper/ndiswrapper-1.53-r1.ebuild b/net-wireless/ndiswrapper/ndiswrapper-1.53-r1.ebuild
new file mode 100644
index 000000000000..c19a45ba3da5
--- /dev/null
+++ b/net-wireless/ndiswrapper/ndiswrapper-1.53-r1.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/ndiswrapper/ndiswrapper-1.53-r1.ebuild,v 1.1 2008/10/27 12:52:56 peper Exp $
+
+inherit linux-mod
+
+MY_P=${PN}-${PV/_/}
+
+DESCRIPTION="Wrapper for using Windows drivers for some wireless cards"
+HOMEPAGE="http://ndiswrapper.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 x86"
+IUSE="debug usb"
+
+DEPEND="sys-apps/pciutils"
+RDEPEND="${DEPEND}
+ net-wireless/wireless-tools"
+
+CONFIG_CHECK="WIRELESS_EXT"
+
+S=${WORKDIR}/${MY_P}
+
+MODULE_NAMES="ndiswrapper(misc:${S}/driver)"
+BUILD_TARGETS="all"
+MODULESD_NDISWRAPPER_ALIASES=("wlan0 ndiswrapper")
+
+ERROR_USB="You need to enable USB support in your kernel
+to use usb support in ndiswrapper."
+
+pkg_setup() {
+ echo
+ einfo "See http://www.gentoo.org/doc/en/gentoo-kernel.xml"
+ einfo "for a list of supported kernels."
+ echo
+
+ use usb && CONFIG_CHECK="${CONFIG_CHECK} USB"
+ linux-mod_pkg_setup
+}
+
+src_unpack() {
+ unpack ${A}
+ convert_to_m "${S}/driver/Makefile"
+
+ cd "${S}/driver"
+ epatch "${FILESDIR}/ndiswrapper-CVE-2008-4395.patch"
+}
+
+src_compile() {
+ local params
+
+ # Enable verbose debugging information
+ if use debug; then
+ params="DEBUG=3"
+ use usb && params="${params} USB_DEBUG=1"
+ fi
+
+ cd utils
+ emake || die "Compile of utils failed!"
+
+ use usb || params="DISABLE_USB=1"
+
+ # Does not like parallel builds
+ # http://bugs.gentoo.org/show_bug.cgi?id=154213
+ # KBUILD value can't be quoted
+ # http://bugs.gentoo.org/show_bug.cgi?id=156319
+ BUILD_PARAMS="KSRC=${KV_DIR} KVERS=${KV_FULL} KBUILD=${KV_OUT_DIR} ${params} -j1"
+ linux-mod_src_compile
+}
+
+src_install() {
+ dodoc AUTHORS ChangeLog INSTALL README
+ doman ndiswrapper.8 || die
+
+ keepdir /etc/ndiswrapper
+
+ linux-mod_src_install
+
+ cd utils
+ emake DESTDIR="${D}" install || die "emake install failed"
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ echo
+ elog "NDISwrapper requires .inf and .sys files from a Windows(tm) driver"
+ elog "to function. Download these to /root for example, then"
+ elog "run 'ndiswrapper -i /root/foo.inf'. After that you can delete them."
+ elog "They will be copied to /etc/ndiswrapper/."
+ elog "Once done, please run 'update-modules'."
+ elog
+
+ elog "Please look at ${HOMEPAGE}"
+ elog "for the FAQ, HowTos, tips, configuration, and installation"
+ elog "information."
+ elog
+
+ local i=$(lspci -n | egrep 'Class (0280|0200):' | cut -d' ' -f4)
+ if [[ -n "${i}" ]] ; then
+ elog "Possible hardware: ${i}"
+ elog
+ fi
+
+ elog "NDISwrapper devs need support (_hardware_, cash)."
+ elog "Don't hesitate if you can help."
+ elog "See ${HOMEPAGE} for details."
+ echo
+
+ if [[ ${ROOT} == "/" ]]; then
+
+ einfo "Attempting to automatically reinstall any Windows drivers"
+ einfo "you might already have."
+ echo
+
+ local driver
+ for driver in $(ls /etc/ndiswrapper) ; do
+ einfo "Driver: ${driver}"
+ mv "/etc/ndiswrapper/${driver}" "${T}"
+ ndiswrapper -i "${T}/${driver}/${driver}.inf"
+ done
+ fi
+}