From patchwork Wed Aug 29 21:40:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouni Malinen X-Patchwork-Id: 10580995 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC1F01709 for ; Wed, 29 Aug 2018 21:40:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 597DB2B3B5 for ; Wed, 29 Aug 2018 21:40:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C10A2B3EA; Wed, 29 Aug 2018 21:40:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBD452B3B5 for ; Wed, 29 Aug 2018 21:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbeH3Bj3 (ORCPT ); Wed, 29 Aug 2018 21:39:29 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41246 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbeH3Bj3 (ORCPT ); Wed, 29 Aug 2018 21:39:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E2553604BE; Wed, 29 Aug 2018 21:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1535578838; bh=+vq/cTNb+WK+8ld3XEcewSvCTSwWzmZrZHVQc+qqnbE=; h=From:To:Cc:Subject:Date:From; b=Ccl0haOOAY/aolyZjOzDe7GqqjoIfiojk0ifBmJCbQa+4TEwLb4900ALwwBISXAnA uCSuHLVWXXHqGPsw1l4gaMIfHFN+fp5vD45TPuPGwuIKfcnCDBgzxMO1ibB7+/HOeo /VvlRJqF5HTzuefu22LwoFdMI9cOpTB+HzfNne5A= Received: from jouni.codeaurora.org (87-95-207-114.bb.dnainternet.fi [87.95.207.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jouni@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3CD7E60271; Wed, 29 Aug 2018 21:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1535578838; bh=+vq/cTNb+WK+8ld3XEcewSvCTSwWzmZrZHVQc+qqnbE=; h=From:To:Cc:Subject:Date:From; b=Ccl0haOOAY/aolyZjOzDe7GqqjoIfiojk0ifBmJCbQa+4TEwLb4900ALwwBISXAnA uCSuHLVWXXHqGPsw1l4gaMIfHFN+fp5vD45TPuPGwuIKfcnCDBgzxMO1ibB7+/HOeo /VvlRJqF5HTzuefu22LwoFdMI9cOpTB+HzfNne5A= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3CD7E60271 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jouni@codeaurora.org From: Jouni Malinen To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Arunk Khandavalli , Jouni Malinen Subject: [PATCH] cfg80211: nl80211_update_ft_ies() to validate NL80211_ATTR_IE Date: Thu, 30 Aug 2018 00:40:16 +0300 Message-Id: <1535578816-23020-1-git-send-email-jouni@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arunk Khandavalli 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 --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 62e6679..65ec49d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -12206,6 +12206,7 @@ static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; if (!info->attrs[NL80211_ATTR_MDID] || + !info->attrs[NL80211_ATTR_IE] || !is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) return -EINVAL;