From patchwork Wed Oct 19 08:25:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp348705wrs; Wed, 19 Oct 2022 07:10:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bDFKS+LuJ+2NNtwprxhd5Qya5gESgcO3FPD8YW6GsapEAOK3e1gONXG2bHVjKh/KYzOPH X-Received: by 2002:a17:902:d510:b0:185:475a:4057 with SMTP id b16-20020a170902d51000b00185475a4057mr8833471plg.54.1666188636389; Wed, 19 Oct 2022 07:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188636; cv=none; d=google.com; s=arc-20160816; b=ynE2f3x2DeBAuPT5+E1vDC9TteMbUgDx2fE95/ThPhOdVcl7SVct58LUBow+BahKeb VI575RAaXixTnpCsBe477uUEcFyKJ5Be1RW3h3ag4ajessbeEkLDnbk43cZ/l1zF9+Ih PMiKtIKDFxvUyt8QgCGH8anrMzF7/NUG4kCjiTfKUtJ5807ZHbQZwq8rottN/Rlfotm/ 7UFOEOV6Z421rLLe+u21m5KxSw2h79eDhEnKWutQB7/I2MleAQBUaig7u2zHI2ZDf2S6 cnpQ6mB0CjpGgdREbKkysNaoK6tVr6Wwo8HBuApBRrRvm9QhPLpr+B9TNqJ+rl1cYNYY sR7A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pY/eLsfK5Z82gErNorIFxThhfE7VFhuOC8niwt4aXrg=; b=ryQpKL9//cjbEa/f5Ze3UV7NZwG6NLVuGKpmPW/gYCDa0eUInjjAhN+sGtBkKlpBBr olCNIEyEVQeg+ZZUiHp7OdYb7nTgdq7h+HfvRyPLIqXTbeK/I/GRTZKuFSpiCCekZA2b LuS3Y4w/rKX0jNJPc9NOye4HPmXtzYVtZTWwL3Vz6kBSC9sEjSgH0HfCX+PQ9CKrwNX9 ELpxaKc+1n/bLtkd70xdKYyeK/sDD5zUDuuQKg30tHupbxqqNeCzhUFmV3j3d5JWiUea tjSlB0ZJHIH5YfYuAZh5Ke+yMjIXpPak8DZLZIs+SocXF2rPvph2E0zW0XiN717TetQY 1gUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tyFqr05e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n6-20020a654506000000b0044b817adee1si18204187pgq.78.2022.10.19.07.10.07; Wed, 19 Oct 2022 07:10:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=tyFqr05e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233785AbiJSNxr (ORCPT + 99 others); Wed, 19 Oct 2022 09:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230172AbiJSNwy (ORCPT ); Wed, 19 Oct 2022 09:52:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D836A1960AA; Wed, 19 Oct 2022 06:36:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8B40EB82316; Wed, 19 Oct 2022 08:49:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3B70C433D6; Wed, 19 Oct 2022 08:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169339; bh=qcIfLVy8NdhyzguIZ1nO/PoYtpJQB81Qs76YDchO8XY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tyFqr05e+eoopmBTag7Xf2atGLn7ehS3lQ2foOSMiGksVYTjH1l1G/BEOgQq3JRgf BqgHVcooGXXpmakWyOBOkJyDDcz1GQIuIdEKM/eZXO+B2LtvgBCDwII8mz0KB9oIuh 7pJtX+/n7U1JujIl9WR+0TfvT6s3rVDZ+/sGdhlc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Sasha Levin Subject: [PATCH 6.0 240/862] wifi: mac80211: fix use-after-free Date: Wed, 19 Oct 2022 10:25:27 +0200 Message-Id: <20221019083300.643211248@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747125415408716213?= X-GMAIL-MSGID: =?utf-8?q?1747125415408716213?= From: Johannes Berg [ Upstream commit 40fb87129049ec5876dabf4a4d4aed6642b31f1a ] We've already freed the assoc_data at this point, so need to use another copy of the AP (MLD) address instead. Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link") Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index fc764984d687..1e9cb4be6ed3 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5122,7 +5122,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, resp.req_ies = ifmgd->assoc_req_ies; resp.req_ies_len = ifmgd->assoc_req_ies_len; if (sdata->vif.valid_links) - resp.ap_mld_addr = assoc_data->ap_addr; + resp.ap_mld_addr = sdata->vif.cfg.ap_addr; cfg80211_rx_assoc_resp(sdata->dev, &resp); notify_driver: drv_mgd_complete_tx(sdata->local, sdata, &info);