[packages/iwd] crash fix for hw with handshake offload; rel 2

atler atler at pld-linux.org
Wed Jan 26 19:21:36 CET 2022


commit 55328eb122da8305cfc4e512a89e4e91de4ae2b2
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Jan 26 19:08:14 2022 +0100

    crash fix for hw with handshake offload; rel 2

 handshake_offload_crash.patch | 66 +++++++++++++++++++++++++++++++++++++++++++
 iwd.spec                      |  4 ++-
 2 files changed, 69 insertions(+), 1 deletion(-)
---
diff --git a/iwd.spec b/iwd.spec
index 1cd0fbb..6bea37a 100644
--- a/iwd.spec
+++ b/iwd.spec
@@ -2,11 +2,12 @@ Summary:	iwd - wireless daemon for Linux
 Summary(pl.UTF-8):	iwd - demon sieci bezprzewodowej dla Linuksa
 Name:		iwd
 Version:	1.22
-Release:	1
+Release:	2
 License:	LGPL v2.1+
 Group:		Networking/Daemons
 Source0:	https://www.kernel.org/pub/linux/network/wireless/%{name}-%{version}.tar.xz
 # Source0-md5:	612dd43cf9bbaa0c11ccfa2ccdd6d3d7
+Patch0:		handshake_offload_crash.patch
 URL:		https://git.kernel.org/pub/scm/network/wireless/iwd.git
 BuildRequires:	autoconf >= 2.60
 BuildRequires:	automake
@@ -32,6 +33,7 @@ Demon sieci bezprzewodowej dla Linuksa.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__libtoolize}
diff --git a/handshake_offload_crash.patch b/handshake_offload_crash.patch
new file mode 100644
index 0000000..d351728
--- /dev/null
+++ b/handshake_offload_crash.patch
@@ -0,0 +1,66 @@
+From: James Prestwood <prestwoj at gmail.com>
+To: iwd at lists.01.org
+Cc: James Prestwood <prestwoj at gmail.com>
+Subject: [PATCH] handshake: use _hs directly in handshake_event
+Date: Wed, 26 Jan 2022 09:41:00 -0800
+Message-Id: <20220126174100.3162606-1-prestwoj at gmail.com>
+X-Mailer: git-send-email 2.31.1
+MIME-Version: 1.0
+Message-ID-Hash: NMNRINAVG2TIZ5OC2HCAUVNIA43MR46D
+X-Message-ID-Hash: NMNRINAVG2TIZ5OC2HCAUVNIA43MR46D
+X-MailFrom: prestwoj at gmail.com
+X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header
+X-Mailman-Version: 3.1.1
+Precedence: list
+List-Id: <iwd.lists.01.org>
+Archived-At: <https://lists.01.org/hyperkitty/list/iwd@lists.01.org/message/NMNRINAVG2TIZ5OC2HCAUVNIA43MR46D/>
+List-Archive: <https://lists.01.org/hyperkitty/list/iwd@lists.01.org/>
+List-Help: <mailto:iwd-request at lists.01.org?subject=help>
+List-Post: <mailto:iwd at lists.01.org>
+List-Subscribe: <mailto:iwd-join at lists.01.org>
+List-Unsubscribe: <mailto:iwd-leave at lists.01.org>
+Content-Type: text/plain; charset="us-ascii"
+Content-Transfer-Encoding: 7bit
+X-TUID: mq6DYmslPL7v
+Content-Length: 1343
+
+Certain platforms/compilers were having issues with using the 'hs'
+local in this macro (likely has something to do with the caller
+also using a local 'hs' variable name). This caused a crash on these
+platforms. Using the macro argument _hs directly fixes the crash.
+---
+ src/handshake.h | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/src/handshake.h b/src/handshake.h
+index 34d4829d..7136087a 100644
+--- a/src/handshake.h
++++ b/src/handshake.h
+@@ -166,19 +166,18 @@ struct handshake_state {
+ 
+ #define handshake_event(_hs, event, ...)	\
+ 	(__extension__ ({	\
+-		struct handshake_state *hs = (_hs);	\
+ 		bool freed = false;	\
+ 	\
+-		if (hs->event_func && !hs->in_event) {	\
+-			hs->in_event = true;	\
+-			hs->event_func(hs, event, hs->user_data,	\
++		if ((_hs)->event_func && !(_hs)->in_event) {	\
++			(_hs)->in_event = true;	\
++			(_hs)->event_func((_hs), event, (_hs)->user_data,	\
+ 					##__VA_ARGS__); \
+ 	\
+-			if (!hs->in_event) {	\
+-				handshake_state_free(hs);	\
++			if (!(_hs)->in_event) {	\
++				handshake_state_free((_hs));	\
+ 				freed = true;	\
+ 			} else	\
+-				hs->in_event = false;	\
++				(_hs)->in_event = false;	\
+ 		}	\
+ 		freed;	\
+ 	}))
+-- 
+2.31.1
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/iwd.git/commitdiff/55328eb122da8305cfc4e512a89e4e91de4ae2b2



More information about the pld-cvs-commit mailing list