Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4306632rwd; Sun, 4 Jun 2023 02:18:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4plGrBZpUbVOKja4eDvL4rPJ6fYMsRPF3IaevT9Ax1aBAESTxyY3q+NCoecc3gcSbSVOmR X-Received: by 2002:a05:6a20:4390:b0:10e:d4fb:b03a with SMTP id i16-20020a056a20439000b0010ed4fbb03amr4639910pzl.43.1685870336653; Sun, 04 Jun 2023 02:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685870336; cv=none; d=google.com; s=arc-20160816; b=YjfpIZKWoa4tNWA0KIygDApS3vTuCVHheOnLeoaOZGk2CZWmrY1XUrmM8ObNVuJe7S 6qCOgxGYh/3vox6U2Yp/6C3QhFFyTXCFGX+54srxIPZeLu7YGF6pdT5YnEwBS5Tadw5K JBgAalBCSLXfnrjNlyesyAXoYQVuxSfh0JOabxD+owTOi2WM5sGOGPL2Liix+oSkcubK u8oW6mxtL3t1DtnlpG7WSIrqn1vs4ggyYXOmUrBkjl6fqNrUe0j9oMHjPNRDMiqwN9Db NkKhNZg//1mGWJyU2Bwwb5/7FdWzVjG8bky9EegT1mxGeu6jnkSTKOM/TBBZYi+YcnJE R3tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HzoyAqrmlyrRadWGHrpeWDUHkWi+w0Ac+tsDp4C42vU=; b=s7ur+75XPDapl5iHltaUTeHY9wjzGAZwqlEi2mklhD7SMNCiRTC815mDP+42K1C15t TX+1Q4OGarkR4WjNMwByQzm/LlIb2hVbwQXYrLreV7q7g5xsTxtVJPf0O9RDC/FtRelS 1MOBWZBiwONOXUaZDmRyEhpwXy0Bf4SLTNS1PLO6fjMWv0MVQdUxSNj23sA6Q925v3XN /orithXB9p/tTNHZz66mWN77nde2dFzDxbEBb0umWsV6Vr0SCTe1gyhXpL1aVJ8FmJSc qjOyOxFUN9LzOFzz5XjIxDWTB2aIG5jNOGTViDI9akpbqK7JLz0NuZVGO9pZoMo5LIJo dG9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KQZwzyAz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v69-20020a638948000000b00542b2e4c964si3200751pgd.822.2023.06.04.02.18.42; Sun, 04 Jun 2023 02:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KQZwzyAz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbjFDJMC (ORCPT + 63 others); 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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, -- 2.38.1