From patchwork Tue Oct 24 22:58:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Sigurdsson X-Patchwork-Id: 830061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JSf6JT2u"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yM86F6qdXz9t1G for ; Wed, 25 Oct 2017 10:06:45 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UqKDq41pOija1gNQjYG/YuQgTYDUsszoIQ9FWczYtJA=; b=JSf6JT2uU2CVQW KwsyeybYUBMBkWSG7nx3VwRe5H+tj3sRi2ustLDwNly7weICLhzTM61zOYcE2zCC5+AlmLh1B+6Zf eqf4+QYG2cem7oEdCHCaHEX9Ou1ve5pKGSg5Ggu0+dmjVsqhSqWjVe3kgiGfS7DX6LEYCTpQSXti5 qoHHSHiE7KqrUzl3FI0l357LKfqgibfZhqbqyyo+c9kIXG2Xl8ebViEmADuuodtFuemPLs5bBL1As fJV1um6c4hPvX4eN9rdvf3MJva9WHQoAgVhWB5epS21SNP/cExE8OYVRxK8iA6jS5kVg/m0aLR2kv K0Lh9f4FdanVkx6tC/Og==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e78HH-0003oG-S0; Tue, 24 Oct 2017 23:06:31 +0000 Received: from dd34104.kasserver.com ([85.13.151.79]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e78HE-0003lU-QO for lede-dev@lists.infradead.org; Tue, 24 Oct 2017 23:06:30 +0000 Received: from localhost.localdomain (ip-37-201-5-53.hsi13.unitymediagroup.de [37.201.5.53]) by dd34104.kasserver.com (Postfix) with ESMTPSA id 8654E6C82795; Wed, 25 Oct 2017 00:58:29 +0200 (CEST) From: Timo Sigurdsson To: lede-dev@lists.infradead.org, nbd@nbd.name Date: Wed, 25 Oct 2017 00:58:15 +0200 Message-Id: <1508885896-17073-3-git-send-email-public_timo.s@silentcreek.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1508885896-17073-1-git-send-email-public_timo.s@silentcreek.de> References: <1508885896-17073-1-git-send-email-public_timo.s@silentcreek.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171024_160629_031379_AF2CBB9A X-CRM114-Status: GOOD ( 11.05 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.151.79 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH 2/3] hostapd: Backport Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Timo Sigurdsson MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org wpa_disable_eapol_key_retries can't prevent attacks against the Wireless Network Management (WNM) Sleep Mode handshake. Currently, hostapd processes WNM Sleep Mode requests from clients regardless of the setting wnm_sleep_mode. Backport Jouni Malinen's upstream patch 114f2830 in order to ignore such requests by clients when wnm_sleep_mode is disabled (which is the default). Signed-off-by: Timo Sigurdsson --- ...WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch diff --git a/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch b/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch new file mode 100644 index 0000000..13426e4 --- /dev/null +++ b/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch @@ -0,0 +1,35 @@ +From 114f2830d2c2aee6db23d48240e93415a256a37c Mon Sep 17 00:00:00 2001 +From: Jouni Malinen +Date: Fri, 20 Oct 2017 17:39:42 +0300 +Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case + +The hostapd wnm_sleep_mode parameter was previously used to control +advertisement of WNM-Sleep Mode support, but it was not used when +processing a request to use WNM-Sleep Mode. Add an explicit check during +request processing as well so that any misbehaving station is ignored. + +Signed-off-by: Jouni Malinen +--- + src/ap/wnm_ap.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c +index 7c4fde0..973e4d3 100644 +--- a/src/ap/wnm_ap.c ++++ b/src/ap/wnm_ap.c +@@ -200,6 +200,13 @@ static void ieee802_11_rx_wnmsleep_req(struct hostapd_data *hapd, + u8 *tfsreq_ie_end = NULL; + u16 tfsreq_ie_len = 0; + ++ if (!hapd->conf->wnm_sleep_mode) { ++ wpa_printf(MSG_DEBUG, "Ignore WNM-Sleep Mode Request from " ++ MACSTR " since WNM-Sleep Mode is disabled", ++ MAC2STR(addr)); ++ return; ++ } ++ + dialog_token = *pos++; + while (pos + 1 < frm + len) { + u8 ie_len = pos[1]; +-- +2.1.4