From b44ff5876528e76bffd7520effcd3428dac9106a Mon Sep 17 00:00:00 2001 From: Davide Caratti Date: Tue, 29 May 2018 11:41:32 +0200 Subject: [PATCH] hostapd: fix encoding of NL80211_ATTR_SMPS_MODE https://bugzilla.redhat.com/show_bug.cgi?id=1582839 Signed-off-by: Davide Caratti --- hostapd.spec | 8 +++- ...-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch | 38 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch diff --git a/hostapd.spec b/hostapd.spec index 76a0454..e55b560 100644 --- a/hostapd.spec +++ b/hostapd.spec @@ -2,7 +2,7 @@ Name: hostapd Version: 2.6 -Release: 8%{?dist} +Release: 9%{?dist} Summary: IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator License: BSD URL: http://w1.fi/hostapd @@ -22,6 +22,8 @@ Patch5: https://w1.fi/security/2017-1/rebased-v2.6-0005-Fix-PTK-rekeying Patch6: https://w1.fi/security/2017-1/rebased-v2.6-0006-TDLS-Reject-TPK-TK-reconfiguration.patch Patch8: https://w1.fi/security/2017-1/rebased-v2.6-0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch +Patch9: nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch + BuildRequires: libnl3-devel BuildRequires: openssl-devel BuildRequires: perl-generators @@ -72,6 +74,7 @@ Logwatch scripts for hostapd. %patch5 -p1 %patch6 -p1 %patch8 -p1 +%patch9 -p1 %build cd hostapd @@ -191,6 +194,9 @@ fi %{_sysconfdir}/logwatch/scripts/services/%{name} %changelog +* Tue May 29 2018 Davide Caratti - 2.6-9 +- backport fix for Fix NL80211_ATTR_SMPS_MODE encoding (rh #1582839) + * Wed Feb 07 2018 Fedora Release Engineering - 2.6-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch b/nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch new file mode 100644 index 0000000..ad15b7c --- /dev/null +++ b/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 +