From 7c4f7fa0c720f9db95ad6743bcbabe6a17fb293c Mon Sep 17 00:00:00 2001 From: Davide Caratti Date: Mon, 18 Jun 2018 11:53:29 +0200 Subject: [PATCH] fix wrong encoding of NL80211_ATTR_SMPS_MODE https://bugzilla.redhat.com/show_bug.cgi?id=1570903 --- ...-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch | 38 +++++++++++++++++++ wpa_supplicant.spec | 9 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 rh1570903-nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch diff --git a/rh1570903-nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch b/rh1570903-nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch new file mode 100644 index 0000000..ad15b7c --- /dev/null +++ b/rh1570903-nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch @@ -0,0 +1,38 @@ +From a2426829ce426de82d2fa47071ca41ea81c43307 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jouni Malinen +Date: Fri, 1 Dec 2017 20:22:44 +0200 +Subject: [PATCH] nl80211: Fix NL80211_ATTR_SMPS_MODE encoding + +This nl80211 attribute uses NLA_U8 policy in cfg80211 and +hostapd/wpa_supplicant needs to use same size when writing the +attribute. + +This fixes AP mode regression triggered by kernel commit "net: netlink: +Update attr validation to require exact length for some types" in +v4.15-rc1 that resulted in the following debug log entry when trying to +enable beaconing: +nl80211: Beacon set failed: -34 (Numerical result out of range) + +Fixes: da1080d7215f ("nl80211: Advertise and configure SMPS modes") +Signed-off-by: Jouni Malinen +--- + src/drivers/driver_nl80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c +index 2ce03ed76..7571e77f0 100644 +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -3957,7 +3957,7 @@ static int wpa_driver_nl80211_set_ap(void *priv, + smps_mode = NL80211_SMPS_OFF; + break; + } +- if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode)) ++ if (nla_put_u8(msg, NL80211_ATTR_SMPS_MODE, smps_mode)) + goto fail; + } + +-- +2.17.0 + diff --git a/wpa_supplicant.spec b/wpa_supplicant.spec index 20eb796..e2fe3e9 100644 --- a/wpa_supplicant.spec +++ b/wpa_supplicant.spec @@ -7,7 +7,7 @@ Summary: WPA/WPA2/IEEE 802.1X Supplicant Name: wpa_supplicant Epoch: 1 Version: 2.6 -Release: 15%{?dist} +Release: 16%{?dist} License: BSD Group: System Environment/Base Source0: http://w1.fi/releases/%{name}-%{version}%{rcver}%{snapshot}.tar.gz @@ -103,6 +103,9 @@ Patch60: rh1497640-pae-validate-input-before-pointer.patch Patch61: rh1567474-0001-D-Bus-Implement-Pmf-property.patch Patch62: rh1567474-0002-D-Bus-Add-pmf-to-global-capabilities.patch +# fix wrong encoding of NL80211_ATTR_SMPS_MODE (rh #1570903) +Patch63: rh1570903-nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch + URL: http://w1.fi/wpa_supplicant/ %if %{build_gui} @@ -206,6 +209,7 @@ Graphical User Interface for wpa_supplicant written using QT %patch60 -p1 -b .rh1487640-pae %patch61 -p1 -b .rh1567474-pmf-0001 %patch62 -p1 -b .rh1567474-pmf-0002 +%patch63 -p1 -b .rh1570903 %build pushd wpa_supplicant @@ -303,6 +307,9 @@ chmod -R 0644 %{name}/examples/*.py %endif %changelog +* Fri Jun 22 2018 Davide Caratti - 1:2.6-16 +- Fix endoding of NL80211_ATTR_SMPS_MODE (rh#1570903) + * Fri May 11 2018 Davide Caratti - 1:2.6-15 - Make PMF configurable using D-Bus (rh#1567474)