Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35064 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbeLIVzS (ORCPT ); Sun, 9 Dec 2018 16:55:18 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Johannes Berg" , "Arunk Khandavalli" , "Jouni Malinen" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: Subject: [PATCH 3.16 174/328] cfg80211: nl80211_update_ft_ies() to validate NL80211_ATTR_IE In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Arunk Khandavalli commit 4f0223bfe9c3e62d8f45a85f1ef1b18a8a263ef9 upstream. nl80211_update_ft_ies() tried to validate NL80211_ATTR_IE with is_valid_ie_attr() before dereferencing it, but that helper function returns true in case of NULL pointer (i.e., attribute not included). This can result to dereferencing a NULL pointer. Fix that by explicitly checking that NL80211_ATTR_IE is included. Fixes: 355199e02b83 ("cfg80211: Extend support for IEEE 802.11r Fast BSS Transition") Signed-off-by: Arunk Khandavalli Signed-off-by: Jouni Malinen Signed-off-by: Johannes Berg Signed-off-by: Ben Hutchings --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -9185,6 +9185,7 @@ static int nl80211_update_ft_ies(struct return -EOPNOTSUPP; if (!info->attrs[NL80211_ATTR_MDID] || + !info->attrs[NL80211_ATTR_IE] || !is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) return -EINVAL;