Skip to contentSkip to conversation

aircrack-ng: security bump to version 1.2-rc1

PATCH New Gustavo Zacarias 2 participants 6 messages Nov 11, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aircrack-ng: security bump to version 1.2-rc1

Fixes:
CVE-2014-8321 - gps_tracer stack overflow CVE-2014-8322 - tcp_test length parameter inconsistency CVE-2014-8323 - buddy-ng missing check in data format CVE-2014-8324 - net_get missing check for invalid values

Previous CVE patch dropped since the fix is upstream. Also add hash file.

---
 ...pkg-config-to-find-libpcre-it-s-more-cros.patch | 39 +++++++++++++++++
 ...se-LIBPCAP-for-required-libpcap-libraries.patch | 33 +++++++++++++++
 package/aircrack-ng/Config.in                      |  3 ++
 .../aircrack-ng/aircrack-ng-01-CVE-2010-1159.patch | 24 -----------
 package/aircrack-ng/aircrack-ng.hash               |  3 ++
 package/aircrack-ng/aircrack-ng.mk                 | 49 +++++++++++++++-------
 6 files changed, 113 insertions(+), 38 deletions(-)
 create mode 100644 package/aircrack-ng/0001-Makefile-use-pkg-config-to-find-libpcre-it-s-more-cros.patch
 create mode 100644 package/aircrack-ng/0002-Optionally-use-LIBPCAP-for-required-libpcap-libraries.patch
 delete mode 100644 package/aircrack-ng/aircrack-ng-01-CVE-2010-1159.patch
 create mode 100644 package/aircrack-ng/aircrack-ng.hash
package/aircrack-ng/0001-Makefile-use-pkg-config-to-find-libpcre-it-s-more-cros.patch new file +39 -0
new file mode 100644
index 0000000..733e0c0
@@ -0,0 +1,39 @@
+From 98149c7664e99cc8ce9c9b1abf2fa90d9cd68e0d Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <[email protected]>
+Date: Wed, 5 Nov 2014 09:38:12 -0300
+Subject: [PATCH] Makefile: use pkg-config to find libpcre, it's more
+ cross-compile friendly
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+---
+Status: Upstream http://trac.aircrack-ng.org/ticket/1526
+
+diff --git a/common.mak b/common.mak
+index 6e5694b..d875708 100644
+--- a/common.mak
++++ b/common.mak
+@@ -39,7 +39,7 @@ PCRE            = true
+ endif
+ 
+ ifeq ($(PCRE), true)
+-COMMON_CFLAGS += $(shell pcre-config --cflags) -DHAVE_PCRE
++COMMON_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpcre) -DHAVE_PCRE
+ endif
+ 
+ ifeq ($(OSNAME), cygwin)
+diff --git a/src/Makefile b/src/Makefile
+index f9217f9..14350b6 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -16,7 +16,7 @@ BINFILES        = aircrack-ng$(EXE) airdecap-ng$(EXE) packetforge-ng$(EXE) \
+ 
+ LIBPCRE		=
+ ifeq ($(PCRE), true)
+-	LIBPCRE	= $(shell pcre-config --libs)
++	LIBPCRE = $(shell $(PKG_CONFIG) --libs libpcre)
+ endif
+ 
+ ifneq ($(OSNAME), cygwin) #There is yet no libpcap support for windows, so we skip the crawler
+-- 
+2.0.4
+
package/aircrack-ng/0002-Optionally-use-LIBPCAP-for-required-libpcap-libraries.patch new file +33 -0
new file mode 100644
index 0000000..c92bb8d
@@ -0,0 +1,33 @@
+From 1abf7a6aad3d7931de2c01b578f62986b75de2f5 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <[email protected]>
+Date: Tue, 11 Nov 2014 16:23:42 -0300
+Subject: [PATCH] Optionally use LIBPCAP for required libpcap libraries
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+---
+Status: Reported http://trac.aircrack-ng.org/ticket/1528
+
+diff --git a/src/Makefile b/src/Makefile
+index 14350b6..7bd4271 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -23,6 +23,7 @@ ifneq ($(OSNAME), cygwin) #There is yet no libpcap support for windows, so we sk
+ 	HAVE_PCAP	= $(shell ld -lpcap 2> /dev/null && echo yes)
+ 	ifeq ($(HAVE_PCAP), yes) #cannot link with -lpcap, skip crawler
+ 		BINFILES	+= besside-ng-crawler$(EXE)
++		LIBPCAP		= -lpcap
+ 	endif
+ endif
+ 
+@@ -168,7 +169,7 @@ besside-ng$(EXE): $(OBJS_BS) $(LIBOSD)
+ 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_BS) -o $(@) $(LIBS) $(LIBSSL) -lz $(LIBPCRE)
+ 
+ besside-ng-crawler$(EXE): $(OBJS_BC)
+-	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_BC) -o $(@) -lpcap
++	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_BC) -o $(@) $(LIBPCAP)
+ 
+ makeivs-ng$(EXE): $(OBJS_MI)
+ 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_MI) -o $(@) $(LDFLAGS)
+-- 
+2.0.4
+
package/aircrack-ng/Config.in +3 -0
index 314184f..001316d 100644
@@ -2,6 +2,9 @@ config BR2_PACKAGE_AIRCRACK_NG
 	bool "aircrack-ng"
 	depends on BR2_LARGEFILE
 	depends on BR2_USE_MMU # uses fork()
+	# libnl has issues when linking statically
+	# they need fixing in libnl itself
+	select BR2_PACKAGE_LIBNL if !BR2_PREFER_STATIC_LIB
 	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_IW # runtime
 	depends on BR2_TOOLCHAIN_HAS_THREADS
package/aircrack-ng/aircrack-ng-01-CVE-2010-1159.patch deleted +0 -24
deleted file mode 100644
index 634a01e..0000000
@@ -1,24 +0,0 @@
-Fix for buffer overflow CVE-2010-1159.
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
-
---- a/src/airodump-ng.c
-+++ b/src/airodump-ng.c
-@@ -2126,7 +2126,7 @@
-                     st_cur->wpa.eapol_size = ( h80211[z + 2] << 8 )
-                             +   h80211[z + 3] + 4;
- 
--                    if ((int)pkh.len - z < st_cur->wpa.eapol_size  || st_cur->wpa.eapol_size == 0)
-+                    if (caplen - z < st_cur->wpa.eapol_size  || st_cur->wpa.eapol_size == 0 || caplen - z < 81 + 16 || st_cur->wpa.eapol_size > 256)
- 					{
- 						// Ignore the packet trying to crash us.
-                     	goto write_packet;
-@@ -2158,7 +2158,7 @@
-                     st_cur->wpa.eapol_size = ( h80211[z + 2] << 8 )
-                             +   h80211[z + 3] + 4;
- 
--                    if ((int)pkh.len - z < st_cur->wpa.eapol_size  || st_cur->wpa.eapol_size == 0)
-+		    if (caplen - z < st_cur->wpa.eapol_size  || st_cur->wpa.eapol_size == 0 || caplen - z < 81 + 16 || st_cur->wpa.eapol_size > 256)
- 					{
- 						// Ignore the packet trying to crash us.
-                     	goto write_packet;
package/aircrack-ng/aircrack-ng.hash new file +3 -0
new file mode 100644
index 0000000..1ed27fc
@@ -0,0 +1,3 @@
+# From http://www.aircrack-ng.org/downloads.html
+sha1	b5ff7d0fffb72095311bbe8824ab98aaac62db8f	aircrack-ng-1.2-rc1.tar.gz
+md5	c2f8648c92f7e46051c86c618d4fb0d5	aircrack-ng-1.2-rc1.tar.gz
package/aircrack-ng/aircrack-ng.mk +35 -14

68 lines not on this page · raw message

Signature · 1 line
2.0.4
#1 lore raw

PATCH 1/1 aircrack-ng: security bump to version 1.2-rc1

Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Fixes:
CVE-2014-8321 - gps_tracer stack overflow CVE-2014-8322 - tcp_test length parameter inconsistency CVE-2014-8323 - buddy-ng missing check in data format CVE-2014-8324 - net_get missing check for invalid values

Previous CVE patch dropped since the fix is upstream. Also add hash file.

---

package/aircrack-ng/Config.in +0 -0
index 314184f..001316d 100644

package/aircrack-ng/Config.in config BR2_PACKAGE_AIRCRACK_NG · line 7

Quoted 6 lines
package/aircrack-ng/Config.in +3 -0
@@ -2,6 +2,9 @@ config BR2_PACKAGE_AIRCRACK_NG
 	bool "aircrack-ng"
 	depends on BR2_LARGEFILE
 	depends on BR2_USE_MMU # uses fork()
+	# libnl has issues when linking statically
+	# they need fixing in libnl itself
+	select BR2_PACKAGE_LIBNL if !BR2_PREFER_STATIC_LIB

So libnl isn't really a hard dependency? Why do we then force it for !static?

Quoted 15 lines
package/aircrack-ng/Config.in +0 -0
 	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_IW # runtime
 	depends on BR2_TOOLCHAIN_HAS_THREADS
package/aircrack-ng/aircrack-ng.mk +1 -1
@@ -4,33 +4,54 @@
 #
 ################################################################################
 
-AIRCRACK_NG_VERSION = 1.1
+AIRCRACK_NG_VERSION = 1.2-rc1
 AIRCRACK_NG_SITE = http://download.aircrack-ng.org
 AIRCRACK_NG_LICENSE = GPLv2+
 AIRCRACK_NG_LICENSE_FILES = LICENSE

package/aircrack-ng/aircrack-ng.mk line 15

Quoted 10 lines
package/aircrack-ng/aircrack-ng.mk +4 -5
-AIRCRACK_NG_DEPENDENCIES = openssl
+AIRCRACK_NG_DEPENDENCIES = openssl host-pkgconf
 
-ifeq ($(BR2_PACKAGE_SQLITE),y)
-	AIRCRACK_NG_MAKE_OPTS = sqlite=true
-	AIRCRACK_NG_MAKE_OPTS += \
-		LIBSQL="-lsqlite3$(if $(BR2_PREFER_STATIC_LIB), -lpthread)"
+# Account for libz for openssl, and libpthread in static
+AIRCRACK_NG_LDFLAGS = $(TARGET_LDFLAGS) -lz \
+	$(if $(BR2_PREFER_STATIC_LIB),-lpthread)

Shouldn't the -lz part also be inside the PREFER_STATIC_LIB conditional? Or does aircrach-ng use zlib directly? (if so, it should select it and add it to _DEPENDENCIES)

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 aircrack-ng: security bump to version 1.2-rc1

Quoted 6 lines · Peter Korsgaard

package/aircrack-ng/Config.in config BR2_PACKAGE_AIRCRACK_NG · line 7

Quoted 3 lines
package/aircrack-ng/Config.in +3 -0
+	# libnl has issues when linking statically
+	# they need fixing in libnl itself
+	select BR2_PACKAGE_LIBNL if !BR2_PREFER_STATIC_LIB

So libnl isn't really a hard dependency? Why do we then force it for !static?

This one is torny i must confess :)
libnl isn't a hard dep, but it's recommended for functionality. And also it's brought in by iw anyway, so generally it will always be available, i'm just accounting for it in proper terms (documenting the brokeness for static).
It wasn't used in the previous release directly.

Quoted 18 lines
Quoted 17 lines
package/aircrack-ng/Config.in +0 -0
 	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_IW # runtime
 	depends on BR2_TOOLCHAIN_HAS_THREADS
package/aircrack-ng/aircrack-ng.mk +2 -2
@@ -4,33 +4,54 @@
 #
 ################################################################################
 
-AIRCRACK_NG_VERSION = 1.1
+AIRCRACK_NG_VERSION = 1.2-rc1
 AIRCRACK_NG_SITE = http://download.aircrack-ng.org
 AIRCRACK_NG_LICENSE = GPLv2+
 AIRCRACK_NG_LICENSE_FILES = LICENSE
-AIRCRACK_NG_DEPENDENCIES = openssl
+AIRCRACK_NG_DEPENDENCIES = openssl host-pkgconf
Quoted 11 lines

package/aircrack-ng/aircrack-ng.mk line 15

Quoted 7 lines
package/aircrack-ng/aircrack-ng.mk +3 -4
-ifeq ($(BR2_PACKAGE_SQLITE),y)
-	AIRCRACK_NG_MAKE_OPTS = sqlite=true
-	AIRCRACK_NG_MAKE_OPTS += \
-		LIBSQL="-lsqlite3$(if $(BR2_PREFER_STATIC_LIB), -lpthread)"
+# Account for libz for openssl, and libpthread in static
+AIRCRACK_NG_LDFLAGS = $(TARGET_LDFLAGS) -lz \
+	$(if $(BR2_PREFER_STATIC_LIB),-lpthread)

Shouldn't the -lz part also be inside the PREFER_STATIC_LIB conditional? Or does aircrach-ng use zlib directly? (if so, it should select it and add it to _DEPENDENCIES)

This is from the previous version, so i don't have a hand in it other than adding the comment.
Looking at the code it's used directly by wesside-ng so we have a missing zlib select (no problem seen because openssl pulls it in). And it's not accounted for in any docs.
I'll stick the select in.

Frankly getting aircrack-ng to get to build on static cleanly was very messy (see patches, hacks) and work still needs to be done in libnl-land. I prioritized the security bump over static hence dropped the libnl feature in the process, it was a compromise until i sort the libnl bits out. Regards.

#3 lore raw

PATCH 1/1 aircrack-ng: security bump to version 1.2-rc1

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Hi,

Quoted 8 lines · Peter Korsgaard
Quoted 6 lines

package/aircrack-ng/Config.in config BR2_PACKAGE_AIRCRACK_NG · line 7

Quoted 3 lines
package/aircrack-ng/Config.in +3 -0
+	# libnl has issues when linking statically
+	# they need fixing in libnl itself
+	select BR2_PACKAGE_LIBNL if !BR2_PREFER_STATIC_LIB

So libnl isn't really a hard dependency? Why do we then force it for !static?

Quoted 6 lines

This one is torny i must confess :)
libnl isn't a hard dep, but it's recommended for functionality. And also it's brought in by iw anyway, so generally it will always be available, i'm just accounting for it in proper terms (documenting the brokeness for static).
It wasn't used in the previous release directly.

Ok. It would be good with a short notice about it in the commit message.

Quoted 12 lines
Quoted 11 lines

package/aircrack-ng/aircrack-ng.mk line 15

Quoted 7 lines
package/aircrack-ng/aircrack-ng.mk +3 -4
-ifeq ($(BR2_PACKAGE_SQLITE),y)
-	AIRCRACK_NG_MAKE_OPTS = sqlite=true
-	AIRCRACK_NG_MAKE_OPTS += \
-		LIBSQL="-lsqlite3$(if $(BR2_PREFER_STATIC_LIB), -lpthread)"
+# Account for libz for openssl, and libpthread in static
+AIRCRACK_NG_LDFLAGS = $(TARGET_LDFLAGS) -lz \
+	$(if $(BR2_PREFER_STATIC_LIB),-lpthread)

Shouldn't the -lz part also be inside the PREFER_STATIC_LIB conditional? Or does aircrach-ng use zlib directly? (if so, it should select it and add it to _DEPENDENCIES)

Quoted 6 lines

This is from the previous version, so i don't have a hand in it other than adding the comment.
Looking at the code it's used directly by wesside-ng so we have a missing zlib select (no problem seen because openssl pulls it in). And it's not accounted for in any docs.
I'll stick the select in.

Ok, thanks.

Quoted 5 lines

Frankly getting aircrack-ng to get to build on static cleanly was very messy (see patches, hacks) and work still needs to be done in libnl-land. I prioritized the security bump over static hence dropped the libnl feature in the process, it was a compromise until i sort the libnl bits out. Regards.

I don't think we need to spend a lot of effort on building something like this statically if upstream doesn't really support it. I wouldn't have any problems with making it depend on !STATIC.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 aircrack-ng: security bump to version 1.2-rc1

Quoted 3 lines · Peter Korsgaard

I don't think we need to spend a lot of effort on building something like this statically if upstream doesn't really support it. I wouldn't have any problems with making it depend on !STATIC.

aircrack-ng upstream has been receptive of my patch(es) so far and the problem lies with libnl*.pc to be precise which doesn't define Libs.private at all even though it uses libm and libpthread for example. I just need some time and will to fix that in a proper way. On aircrack's side it uses pkg-config so it's mostly clean. Regards.

#5 lore raw

PATCH 1/1 aircrack-ng: security bump to version 1.2-rc1

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Quoted 3 lines · Peter Korsgaard

I don't think we need to spend a lot of effort on building something like this statically if upstream doesn't really support it. I wouldn't have any problems with making it depend on !STATIC.

Quoted 5 lines

aircrack-ng upstream has been receptive of my patch(es) so far and the problem lies with libnl*.pc to be precise which doesn't define Libs.private at all even though it uses libm and libpthread for example. I just need some time and will to fix that in a proper way. On aircrack's side it uses pkg-config so it's mostly clean.

Ok.

Signature · 1 line
Bye, Peter Korsgaard