From patchwork Sun Jun 4 09:11:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 13266520 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 746A1C7EE2A for ; Sun, 4 Jun 2023 09:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbjFDJMC (ORCPT ); Sun, 4 Jun 2023 05:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231150AbjFDJMB (ORCPT ); Sun, 4 Jun 2023 05:12:01 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BFC135 for ; Sun, 4 Jun 2023 02:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685869919; x=1717405919; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sGckar7NKQP8BcHnAYRXGTOKVXeBLDHrSE3f2tIhT6s=; b=KQZwzyAzOdqPNj83uREV7k0hJjid/plT3/gI6AMxrXDpqbizx7AvHPYE bXAe4/iAhpj4E80Z1k6y/biV0MLiqwYsKsbbndVlYhLrGiWd1cxIwcXTo bu+fyIbc9MAvA1n1a7px4FL85qJEhIVD7jTEWR+CJhp4kBxW72QqMoHP6 sONzxu411vW8aTeqENpepiS7jTkX3Hvuh4EBqBUHexls2znRujsifGuIO XsSzaV6T2OpaphyRW0H0ZzhzHHvVRGfM35TbB5WrqHZOMrf3+n2MwGQ5q 4NwJ3/ccuU7+FZo79gvKqoFuM2WDieAMFjCMTknhf1NPytASMf3Dh5/c5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10730"; a="336526511" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="336526511" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2023 02:11:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10730"; a="820804540" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="820804540" Received: from yfruchte-mobl3.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.219.60]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2023 02:11:57 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 06/16] wifi: cfg80211: reject bad AP MLD address Date: Sun, 4 Jun 2023 12:11:18 +0300 Message-Id: <20230604120651.89188912bd1d.I8dbc6c8ee0cb766138803eec59508ef4ce477709@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230604091128.609335-1-gregory.greenman@intel.com> References: <20230604091128.609335-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg When trying to authenticate, if the AP MLD address isn't a valid address, mac80211 can throw a warning. Avoid that by rejecting such addresses. Fixes: d648c23024bd ("wifi: nl80211: support MLO in auth/assoc") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- net/wireless/nl80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d95f8053020d..087d60c0f6e4 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10723,6 +10723,8 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info) if (!info->attrs[NL80211_ATTR_MLD_ADDR]) return -EINVAL; req.ap_mld_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); + if (!is_valid_ether_addr(req.ap_mld_addr)) + return -EINVAL; } req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,