summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--debian/changelog27
-rw-r--r--debian/control6
-rw-r--r--debian/copyright62
-rw-r--r--debian/patches/0004-loader.h-Only-include-kernel-header-when-building-ke.patch25
-rw-r--r--debian/patches/0005-Use-netif_trans_update-for-kernels-4.7.patch28
-rw-r--r--debian/patches/Support-kernel-4.0.patch41
-rw-r--r--debian/patches/Support-kernel-4.2.patch22
-rw-r--r--debian/patches/kernel-3.14.patch63
-rw-r--r--debian/patches/series5
-rwxr-xr-xdebian/rules3
-rw-r--r--driver/crt.c2
-rw-r--r--driver/loader.h4
-rw-r--r--driver/ndis.c4
-rw-r--r--driver/ndiswrapper.h2
-rw-r--r--driver/ntoskernel.h13
-rw-r--r--ndiswrapper.spec2
17 files changed, 131 insertions, 182 deletions
diff --git a/ChangeLog b/ChangeLog
index 9975104..e4bbc35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Version 1.60 2016-05-01
+=======================
+* Support for Linux kernel up to 4.5
+
Version 1.59 2013-11-28
=======================
* Support for Linux kernels from 2.6.13 to 3.12
diff --git a/debian/changelog b/debian/changelog
index 7e102b9..8d1400f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,30 @@
+ndiswrapper (1.60-3) unstable; urgency=medium
+
+ * Use netif_trans_update() for kernels >= 4.7 (Closes: #837329) (LP: #1625089)
+
+ -- Julian Andres Klode <jak@debian.org> Thu, 22 Sep 2016 11:01:46 +0200
+
+ndiswrapper (1.60-2) unstable; urgency=medium
+
+ [ Julian Andres Klode ]
+ * Fix FTBFS of userspace stuff by not using kernel variables
+ * Build with full hardening enabled
+
+ [ Reiner Herrmann ]
+ * make the build reproducible (Closes: #803583)
+
+ -- Julian Andres Klode <jak@debian.org> Thu, 30 Jun 2016 13:56:14 +0200
+
+ndiswrapper (1.60-1) unstable; urgency=medium
+
+ * Imported Upstream version 1.60
+ * Drop kernel 3.14-4.2 support patches, fixed upstream
+ * Bump Standards-Version to 3.9.8
+ * Switch Vcs URIs to the safe https ones
+ * Fix copyright file format
+
+ -- Julian Andres Klode <jak@debian.org> Thu, 30 Jun 2016 12:27:47 +0200
+
ndiswrapper (1.59-6) unstable; urgency=medium
* Add support for Kernel 4.2.
diff --git a/debian/control b/debian/control
index 7a5624b..d648196 100644
--- a/debian/control
+++ b/debian/control
@@ -2,10 +2,10 @@ Source: ndiswrapper
Section: misc
Priority: optional
Maintainer: Julian Andres Klode <jak@debian.org>
-Standards-Version: 3.9.6
+Standards-Version: 3.9.8
Build-Depends: debhelper (>= 9), bzip2, dkms
-Vcs-Git: git://anonscm.debian.org/collab-maint/ndiswrapper.git
-Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/ndiswrapper.git/
+Vcs-Git: https://anonscm.debian.org/git/collab-maint/ndiswrapper.git
+Vcs-Browser: https://anonscm.debian.org/git/collab-maint/ndiswrapper.git
Homepage: http://ndiswrapper.sourceforge.net/
Package: ndiswrapper
diff --git a/debian/copyright b/debian/copyright
index e044be6..740ef54 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -4,56 +4,45 @@ Source: http://ndiswrapper.sourceforge.net/
Files: *
Copyright: © 2003-2006 Pontus Fuchs, Giridhar Pemmasani
License: GPL-2+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- .
- On Debian systems, the full text of the GPL can be found in
- /usr/share/common-licenses/GPL-2
Files: driver/usb.c driver/usb.h
Copyright: © 2004 Jan Kiszka
© 2005 Giridhar Pemmasani
License: GPL-2+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- .
- On Debian systems, the full text of the GPL can be found in
- /usr/share/common-licenses/GPL-2
Files: driver/win2lin_stubs.S
Copyright: © 2005 Karl Vogel, Giridhar Pemmasani
License: GPL-2+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- .
- On Debian systems, the full text of the GPL can be found in
- /usr/share/common-licenses/GPL-2
Files: driver/divdi3.c driver/longlong.h
Copyright: © 1989-2000 Free Software Foundation, Inc.
License: LGPL-2.1+
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- .
- On Debian systems, the full text of the LGPL can be found in
- /usr/share/common-licenses/LGPL-2.1
+Comment:
+ Actual notice text uses 'The GNU C Library' instead of 'Thjs library'.
Files: driver/pe_linker.h
Copyright: © 1996 Alexandre Julliard
License: LGPL-2.1+
- This file is an excerpt of winnt.h from WINE, which bears the
- following copyright:
- .
- Win32 definitions for Windows NT
+Comment:
+ This file is an excerpt of winnt.h from WINE
+
+Files: debian/*
+Copyright: © 2004 Erik Rigtorp <erkki@linux.nu>
+ © 2004-2006 Andres Salomon <dilinger@debian.org>
+ © 2006-2008 Kel Modderman <kel@otaku42.de>
+ © 2008-2015 Julian Andres Klode <jak@jak-linux.org>
+License: GPL-2+
+
+License: GPL-2+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
.
+ On Debian systems, the full text of the GPL can be found in
+ /usr/share/common-licenses/GPL-2
+
+License: LGPL-2.1+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -61,12 +50,3 @@ License: LGPL-2.1+
.
On Debian systems, the full text of the LGPL can be found in
/usr/share/common-licenses/LGPL-2.1
-
-
-Files: debian/*
-Copyright: © 2004 Erik Rigtorp <erkki@linux.nu>
- © 2004-2006 Andres Salomon <dilinger@debian.org>
- © 2006-2008 Kel Modderman <kel@otaku42.de>
- © 2008-2015 Julian Andres Klode <jak@jak-linux.org>
-License: GPL-2+
- The packaging is licensed under the same license as the software, see above.
diff --git a/debian/patches/0004-loader.h-Only-include-kernel-header-when-building-ke.patch b/debian/patches/0004-loader.h-Only-include-kernel-header-when-building-ke.patch
new file mode 100644
index 0000000..7ab1068
--- /dev/null
+++ b/debian/patches/0004-loader.h-Only-include-kernel-header-when-building-ke.patch
@@ -0,0 +1,25 @@
+From: Julian Andres Klode <jak@debian.org>
+Date: Thu, 30 Jun 2016 13:48:08 +0200
+Subject: loader.h: Only include kernel header when building kernel stuff
+
+This fixes the FTBFS on the user stuff.
+---
+ driver/loader.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/driver/loader.h b/driver/loader.h
+index 1ea5e0c..734d491 100644
+--- a/driver/loader.h
++++ b/driver/loader.h
+@@ -16,9 +16,11 @@
+ #ifndef _LOADER_H_
+ #define _LOADER_H_
+
++#ifdef __KERNEL__
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(4,0,0)
+ #include <linux/vmalloc.h>
+ #endif
++#endif
+
+ #include "ndiswrapper.h"
+
diff --git a/debian/patches/0005-Use-netif_trans_update-for-kernels-4.7.patch b/debian/patches/0005-Use-netif_trans_update-for-kernels-4.7.patch
new file mode 100644
index 0000000..82102eb
--- /dev/null
+++ b/debian/patches/0005-Use-netif_trans_update-for-kernels-4.7.patch
@@ -0,0 +1,28 @@
+From: Julian Andres Klode <jak@debian.org>
+Date: Thu, 22 Sep 2016 10:52:54 +0200
+Subject: Use netif_trans_update() for kernels >= 4.7
+
+This fixes building with kernels 4.7 and 4.8.
+
+Bug-Debian: https://bugs.debian.org/837329
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1625089
+---
+ driver/wrapndis.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/driver/wrapndis.c b/driver/wrapndis.c
+index 902ce94..870e4c2 100644
+--- a/driver/wrapndis.c
++++ b/driver/wrapndis.c
+@@ -704,7 +704,11 @@ static void tx_worker(struct work_struct *work)
+ n = wnd->max_tx_packets;
+ n = mp_tx_packets(wnd, wnd->tx_ring_start, n);
+ if (n) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
++ netif_trans_update(wnd->net_dev);
++#else
+ wnd->net_dev->trans_start = jiffies;
++#endif
+ wnd->tx_ring_start =
+ (wnd->tx_ring_start + n) % TX_RING_SIZE;
+ wnd->is_tx_ring_full = 0;
diff --git a/debian/patches/Support-kernel-4.0.patch b/debian/patches/Support-kernel-4.0.patch
deleted file mode 100644
index 97ef75d..0000000
--- a/debian/patches/Support-kernel-4.0.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: Julian Andres Klode <jak@debian.org>
-Date: Tue, 12 May 2015 17:11:11 +0200
-Subject: Support kernel 4.0
-
----
- driver/ndis.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/driver/ndis.c b/driver/ndis.c
-index 9ace34b..fafd2e7 100644
---- a/driver/ndis.c
-+++ b/driver/ndis.c
-@@ -25,6 +25,10 @@
- #define MAX_ALLOCATED_NDIS_PACKETS TX_RING_SIZE
- #define MAX_ALLOCATED_NDIS_BUFFERS TX_RING_SIZE
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
-+#define strncasecmp strnicmp
-+#endif
-+
- static struct work_struct ndis_work;
- static struct nt_list ndis_work_list;
- static spinlock_t ndis_work_list_lock;
-@@ -438,7 +442,7 @@ static int read_setting(struct nt_list *setting_list, char *keyname, int length,
- struct wrap_device_setting *setting;
- mutex_lock(&loader_mutex);
- nt_list_for_each_entry(setting, setting_list, list) {
-- if (strnicmp(keyname, setting->name, length) == 0) {
-+ if (strncasecmp(keyname, setting->name, length) == 0) {
- TRACE2("setting %s='%s'", keyname, setting->value);
- mutex_unlock(&loader_mutex);
- *param = ndis_encode_setting(setting, type);
-@@ -502,7 +506,7 @@ wstdcall void WIN_FUNC(NdisWriteConfiguration,4)
-
- mutex_lock(&loader_mutex);
- nt_list_for_each_entry(setting, &nmb->wnd->wd->settings, list) {
-- if (strnicmp(keyname, setting->name, ansi.length) == 0) {
-+ if (strncasecmp(keyname, setting->name, ansi.length) == 0) {
- mutex_unlock(&loader_mutex);
- if (ndis_decode_setting(setting, param))
- *status = NDIS_STATUS_FAILURE;
diff --git a/debian/patches/Support-kernel-4.2.patch b/debian/patches/Support-kernel-4.2.patch
deleted file mode 100644
index f29f9de..0000000
--- a/debian/patches/Support-kernel-4.2.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Tim Gardner <tim.gardner@canonical.com>
-Date: Thu, 6 Aug 2015 09:13:30 -0600
-Subject: Support kernel 4.2
-
----
- driver/ntoskernel.h | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/driver/ntoskernel.h b/driver/ntoskernel.h
-index 4b8166c..6b49594 100644
---- a/driver/ntoskernel.h
-+++ b/driver/ntoskernel.h
-@@ -46,6 +46,9 @@
- #include <linux/percpu.h>
- #include <linux/kthread.h>
- #include <linux/workqueue.h>
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
-+#include <linux/vmalloc.h>
-+#endif
-
- #if !defined(CONFIG_X86) && !defined(CONFIG_X86_64)
- #error "this module is for x86 or x86_64 architectures only"
diff --git a/debian/patches/kernel-3.14.patch b/debian/patches/kernel-3.14.patch
deleted file mode 100644
index c8055d1..0000000
--- a/debian/patches/kernel-3.14.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From: Julian Andres Klode <jak@debian.org>
-Date: Tue, 12 May 2015 17:03:29 +0200
-Subject: kernel-3.14
-
-This is a diff consisting of upstream revisions 3199, 3201, 3203.
-
-* Use prandom_seed() instead of net_srandom() on Linux 3.8+
-net_srandom() is going away.
-
-* Avoid preempt_enable_no_resched(), it's no longer available for modules
-Use preempt_enable() instead. This makes nt_spin_unlock_irqrestore()
-fully complementary to nt_spin_lock_irqsave().
-
-* Define reinit_completion() based on the kernel version
-Checking for INIT_COMPLETION was a temporary hack needed before Linux
-3.13-rc1 was released.
-
-The last patch might not be really related to kernel 3.14, but is included
-as well.
-
-Origin: upstream, http://sourceforge.net/p/ndiswrapper/code/
----
- driver/crt.c | 2 +-
- driver/ntoskernel.h | 5 ++---
- 2 files changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/driver/crt.c b/driver/crt.c
-index 3c212c4..38f2a1d 100644
---- a/driver/crt.c
-+++ b/driver/crt.c
-@@ -467,7 +467,7 @@ noregparm int WIN_FUNC(_win_memcmp,3)
- noregparm void WIN_FUNC(_win_srand,1)
- (UINT seed)
- {
-- net_srandom(seed);
-+ prandom_seed((__force u32)(seed));
- }
-
- noregparm int WIN_FUNC(rand,0)
-diff --git a/driver/ntoskernel.h b/driver/ntoskernel.h
-index 8da5401..4b8166c 100644
---- a/driver/ntoskernel.h
-+++ b/driver/ntoskernel.h
-@@ -347,7 +347,7 @@ static inline void netif_poll_disable(struct net_device *dev)
- #define netdev_notifier_info_to_dev(x) ((struct net_device *)(x))
- #endif
-
--#ifdef INIT_COMPLETION
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
- static inline void reinit_completion(struct completion *x)
- {
- INIT_COMPLETION(*x);
-@@ -797,9 +797,8 @@ do { \
- #define nt_spin_unlock_irqrestore(lock, flags) \
- do { \
- nt_spin_unlock(lock); \
-- preempt_enable_no_resched(); \
-+ preempt_enable(); \
- local_irq_restore(flags); \
-- preempt_check_resched(); \
- } while (0)
-
- static inline ULONG SPAN_PAGES(void *ptr, SIZE_T length)
diff --git a/debian/patches/series b/debian/patches/series
index 5298da4..d887bf9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,5 @@
Please-enabled-hardened-build-flags.patch
Use-KERNELRELEASE-as-target-kernel-version.patch
Hardcode-etc-modprobe.d-ndiswrapper.conf.patch
-kernel-3.14.patch
-Support-kernel-4.0.patch
-Support-kernel-4.2.patch
+0004-loader.h-Only-include-kernel-header-when-building-ke.patch
+0005-Use-netif_trans_update-for-kernels-4.7.patch
diff --git a/debian/rules b/debian/rules
index b1ab151..b725f93 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,6 @@
#!/usr/bin/make -f
BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+export DEB_BUILD_MAINT_OPTIONS := hardening=+all
%:
dh $@ --with=dkms --sourcedirectory=utils
@@ -8,7 +9,7 @@ override_dh_install:
dh_install
set -e; if [ -e debian/ndiswrapper-source/usr/src/modules ]; then \
cd debian/ndiswrapper-source/usr/src/; \
- tar cjf ndiswrapper.tar.bz2 --mtime="$(BUILD_DATE)" modules; \
+ tar cjf ndiswrapper.tar.bz2 --mtime="$(BUILD_DATE)" --mode=go=rX,u+rw,a-s modules; \
rm -r modules; \
fi
diff --git a/driver/crt.c b/driver/crt.c
index 3c212c4..b3336b5 100644
--- a/driver/crt.c
+++ b/driver/crt.c
@@ -467,7 +467,7 @@ noregparm int WIN_FUNC(_win_memcmp,3)
noregparm void WIN_FUNC(_win_srand,1)
(UINT seed)
{
- net_srandom(seed);
+ prandom_seed(seed);
}
noregparm int WIN_FUNC(rand,0)
diff --git a/driver/loader.h b/driver/loader.h
index 7c3b3b0..1ea5e0c 100644
--- a/driver/loader.h
+++ b/driver/loader.h
@@ -16,6 +16,10 @@
#ifndef _LOADER_H_
#define _LOADER_H_
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,0,0)
+#include <linux/vmalloc.h>
+#endif
+
#include "ndiswrapper.h"
#ifndef __KERNEL__
diff --git a/driver/ndis.c b/driver/ndis.c
index 9ace34b..c1913a0 100644
--- a/driver/ndis.c
+++ b/driver/ndis.c
@@ -438,7 +438,7 @@ static int read_setting(struct nt_list *setting_list, char *keyname, int length,
struct wrap_device_setting *setting;
mutex_lock(&loader_mutex);
nt_list_for_each_entry(setting, setting_list, list) {
- if (strnicmp(keyname, setting->name, length) == 0) {
+ if (strncasecmp(keyname, setting->name, length) == 0) {
TRACE2("setting %s='%s'", keyname, setting->value);
mutex_unlock(&loader_mutex);
*param = ndis_encode_setting(setting, type);
@@ -502,7 +502,7 @@ wstdcall void WIN_FUNC(NdisWriteConfiguration,4)
mutex_lock(&loader_mutex);
nt_list_for_each_entry(setting, &nmb->wnd->wd->settings, list) {
- if (strnicmp(keyname, setting->name, ansi.length) == 0) {
+ if (strncasecmp(keyname, setting->name, ansi.length) == 0) {
mutex_unlock(&loader_mutex);
if (ndis_decode_setting(setting, param))
*status = NDIS_STATUS_FAILURE;
diff --git a/driver/ndiswrapper.h b/driver/ndiswrapper.h
index 8f1aef9..cc7e9bd 100644
--- a/driver/ndiswrapper.h
+++ b/driver/ndiswrapper.h
@@ -16,7 +16,7 @@
#ifndef _NDISWRAPPER_H_
#define _NDISWRAPPER_H_
-#define DRIVER_VERSION "1.59"
+#define DRIVER_VERSION "1.60"
#define UTILS_VERSION "1.9"
#define DRIVER_NAME "ndiswrapper"
diff --git a/driver/ntoskernel.h b/driver/ntoskernel.h
index 8da5401..7713a78 100644
--- a/driver/ntoskernel.h
+++ b/driver/ntoskernel.h
@@ -347,13 +347,21 @@ static inline void netif_poll_disable(struct net_device *dev)
#define netdev_notifier_info_to_dev(x) ((struct net_device *)(x))
#endif
-#ifdef INIT_COMPLETION
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
static inline void reinit_completion(struct completion *x)
{
INIT_COMPLETION(*x);
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
+#define prandom_seed(seed) net_srandom(seed)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+#define strncasecmp strnicmp
+#endif
+
/* TICK is 100ns */
#define TICKSPERSEC 10000000
#define TICKSPERMSEC 10000
@@ -797,9 +805,8 @@ do { \
#define nt_spin_unlock_irqrestore(lock, flags) \
do { \
nt_spin_unlock(lock); \
- preempt_enable_no_resched(); \
+ preempt_enable(); \
local_irq_restore(flags); \
- preempt_check_resched(); \
} while (0)
static inline ULONG SPAN_PAGES(void *ptr, SIZE_T length)
diff --git a/ndiswrapper.spec b/ndiswrapper.spec
index 3098adf..4f51d2c 100644
--- a/ndiswrapper.spec
+++ b/ndiswrapper.spec
@@ -1,5 +1,5 @@
# Define ndiswrapper_version only if it is not already defined.
-%{!?ndiswrapper_version: %define ndiswrapper_version 1.59}
+%{!?ndiswrapper_version: %define ndiswrapper_version 1.60}
%{!?ndiswrapper_release: %define ndiswrapper_release 1}
# Define kernel version if not already defined