Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1643251rdh; Mon, 25 Sep 2023 21:35:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvZlt9dVRu3P9jlrn5ZeiGGllMKOexBUeeO/TXzrA2uRRpOHw02xe0ibSUKlB6V8UawmE9 X-Received: by 2002:a17:90a:16c8:b0:274:5638:2a03 with SMTP id y8-20020a17090a16c800b0027456382a03mr7781037pje.20.1695702912156; Mon, 25 Sep 2023 21:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695702912; cv=none; d=google.com; s=arc-20160816; b=guqbGZBrhoLDv+J7h/odT00pns9nGdiGcYLCDuufE1OSjy79jq8L28TbasHCHOu43Z s9P31VFWlJ7790zf8Nup1OyvzP1CGSBmbCL468Njlyq3IB3ZT81Z7aiPl6LmlDR2ndTa /EX5zQxG8kG0vkFl16EhgWeUIJbzhN3f8MRCP9xIrPVZ/hMtKM7Ep7+pf10nxrryF0vk 6eLEfW2fC4DxCSKcJ6nA//eLoMVffN5yCGP884jE91BGkkHI8ducu2qXFrwmOn1EWwFK fxfEfyAVZ2DURNTpAvO1fWgz3rr1i1oowtL47XLV6bhjVWcnX77LdXr127Hmuap4yDPG MonQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=TcPGSxwt9MInQj/celUnubsm5b1vkF3Gs12n9nTNg+c=; fh=YSlvpPL42+OV5bLFCL+NbyjIvOHCcshrxbzBHge5Zrw=; b=Xst4VEOtkxQAItJChkNVZyog09lrpb+YiRiY6fwOQtr2WC0sJg1Eryfj5s21SqvilM jFHApsoE9/+XBGlH+hyxz0nZah7lRSSFOdw5VdCiZcdtrIAKdYgyut856VUIxeu8YjTX DdTofrfOrXGCPCMWHjmXf5M5cH0ugScR+GGATR1slYdMzSc1MxQwuoo2n/d1mjsRBFvW 4uaWyMIdEQ85xS3Mo8y0qReoOY9wfK5y3vmBoa7mlBaow35IONFOxVW8HBNrA4NFI3VY GncpkeMpkIRBt09tFIFjMycDszeUwDAVAYjMaHsXQ1yhujUp3mPtURroxPnRcq88lS33 ASJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=e9xdnIuv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id r7-20020a17090a690700b0025c238650d1si11637707pjj.174.2023.09.25.21.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 21:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=e9xdnIuv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 42E6C8260F69; Mon, 25 Sep 2023 19:20:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233284AbjIZCUY (ORCPT + 56 others); Mon, 25 Sep 2023 22:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjIZCUY (ORCPT ); Mon, 25 Sep 2023 22:20:24 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B577BF; Mon, 25 Sep 2023 19:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canb.auug.org.au; s=201702; t=1695694811; bh=TcPGSxwt9MInQj/celUnubsm5b1vkF3Gs12n9nTNg+c=; h=Date:From:To:Cc:Subject:From; b=e9xdnIuv+S5IexeCO7HdwPtekTa9fEYqE+2bQnMadh1ivXxvgDwpv6gXZ6ENQg+OG ncOiQyjwezbh3KJUO1sY8CrLaQsprvYpudhZHQ/lvinoN/ywcvay6Xn9Ex+0ikrJ7U WFOYqcuy2RAHeVb6wHa5ybX5ti0YZSqOPrCqG46d3C+aMVyDqOMgHNrjl8ETiz2Dc6 BBJ0s/NCk5Q/H8OOPfGo3KYn0syGAWzIDz1f8EVAZhHu3UDXiEmpr0jQfhrSTBPn9h C0rkYSY4uNqoZBHsY7ZaMciVQeYGJy75hsGzlxp9NKRq4gwChcmIsg/Fvd4mAg0mZg ZY/2fIn8NMVWw== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Rvk3b0wJwz4xPR; Tue, 26 Sep 2023 12:20:11 +1000 (AEST) Date: Tue, 26 Sep 2023 12:20:09 +1000 From: Stephen Rothwell To: Kalle Valo , Johannes Berg , Wireless Cc: Johannes Berg , Linux Kernel Mailing List , Linux Next Mailing List Subject: linux-next: manual merge of the wireless-next tree with the wireless tree Message-ID: <20230926122009.67735060@canb.auug.org.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/KDVFAo=cdHDYBMd1yQd=GhK"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 19:20:26 -0700 (PDT) --Sig_/KDVFAo=cdHDYBMd1yQd=GhK Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the wireless-next tree got a conflict in: net/mac80211/key.c between commits: 31db78a4923e ("wifi: mac80211: fix potential key use-after-free") d097ae01ebd4 ("wifi: mac80211: fix potential key leak") from the wireless tree and commit: 2a8b665e6bcc ("wifi: mac80211: remove key_mtx") from the wireless-next tree. I fixed it up (I think - see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. --=20 Cheers, Stephen Rothwell diff --cc net/mac80211/key.c index 0665ff5e456e,ac410f6632b5..000000000000 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@@ -881,21 -875,20 +880,22 @@@ int ieee80211_key_link(struct ieee80211 =20 if (link_id >=3D 0) { link_sta =3D rcu_dereference_protected(sta->link[link_id], - lockdep_is_held(&sta->local->sta_mtx)); + lockdep_is_held(&sta->local->hw.wiphy->mtx)); - if (!link_sta) - return -ENOLINK; + if (!link_sta) { + ret =3D -ENOLINK; + goto out; + } } =20 - old_key =3D key_mtx_dereference(sdata->local, link_sta->gtk[idx]); + old_key =3D wiphy_dereference(sdata->local->hw.wiphy, + link_sta->gtk[idx]); } else { if (idx < NUM_DEFAULT_KEYS) - old_key =3D key_mtx_dereference(sdata->local, - sdata->keys[idx]); + old_key =3D wiphy_dereference(sdata->local->hw.wiphy, + sdata->keys[idx]); if (!old_key) - old_key =3D key_mtx_dereference(sdata->local, - link->gtk[idx]); + old_key =3D wiphy_dereference(sdata->local->hw.wiphy, + link->gtk[idx]); } =20 /* Non-pairwise keys must also not switch the cipher on rekey */ @@@ -910,10 -901,10 +910,8 @@@ * Silently accept key re-installation without really installing the * new version of the key to avoid nonce reuse or replay issues. */ -- if (ieee80211_key_identical(sdata, old_key, key)) { - ret =3D -EALREADY; - goto unlock; - ieee80211_key_free_unused(key); - return 0; -- } ++ if (ieee80211_key_identical(sdata, old_key, key)) ++ return -EALREADY; =20 key->local =3D sdata->local; key->sdata =3D sdata; @@@ -936,13 -927,6 +934,10 @@@ ieee80211_key_free(key, delay_tailroom); } =20 + key =3D NULL; + + out: + ieee80211_key_free_unused(key); - unlock: - mutex_unlock(&sdata->local->key_mtx); -=20 return ret; } =20 --Sig_/KDVFAo=cdHDYBMd1yQd=GhK Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAmUSP9kACgkQAVBC80lX 0GxOwwf/bGjeKYnuKz2e6EzFgvC6zVZFPet+UiRM7RA8Y7l73Bu+N5l+34eCMcJh fj9LCqslTg/5o/BIoe9boDMsZadr4UCNVUpa5i5kF4Cz5zM2m4Pyy+z0eq7sKHp8 gGdfXbsm+S2E2leqTK7JPU1H/GlWVhejhrw4xtJFzjMIZJuA0CnYNNZF/Z4Bai/w JQnF57Dlgh/XNlXmCvo8zPJyBQZmPXy1QObGOCFVcAkeKz/I619241jyHbU7zap2 +M06DOAf6JRUeJMog5w3mL+/WAHOJSNddFAvYQtzYQqq68LUEXCqG17jsQT7c8LC L3+JSUtMP5zoyQKIG3IBwyeSzJ5HFQ== =gRb+ -----END PGP SIGNATURE----- --Sig_/KDVFAo=cdHDYBMd1yQd=GhK--