From nobody Sun Jun 5 21:13:56 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EB4201BE1B14; Sun, 5 Jun 2022 21:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LGTrP333gz3wTx; Sun, 5 Jun 2022 21:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654463637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CwtHlV2CLKnuoMSolMAXVFwJo8g15C/KTJlqmv7Qa0k=; b=hLIhgpLSGzquu05feQdB2xKKLxTdSEmP54FVTyXKWLhkxUmvFXCpoupRqSia7/HnuAcl+2 s2SbxPfpaqRdsaO8m2oweUrAGfQrPqLWB5yYtA+Hdx+svO1h201v/9DIgmoFg0Qf5upsix Fccm0JKUn779Y4/QLx+sRifuqkBIGTaqXXFfHB+hbWhHBql0USjf9IwRQE7eQGGHnu1BXF q8MrfJkQkMbYQt5BgbsZDOTzk7NSwjXHnsyX58K+bjaib/cda/2+abi40M+OyXzGeZ74sD I0ShKihSRRLjVJsc8t47Iwl3xv/9rOUvDXyPueDuUc/+B69axIAxeRDUjGfaGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F56F1959E; Sun, 5 Jun 2022 21:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 255LDuGR081898; Sun, 5 Jun 2022 21:13:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 255LDu3n081897; Sun, 5 Jun 2022 21:13:56 GMT (envelope-from git) Date: Sun, 5 Jun 2022 21:13:56 GMT Message-Id: <202206052113.255LDu3n081897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 71df58aefcf8 - main - LinuxKPI: 802.11: plug a ni leak in lkpi_sta_assoc_to_run() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71df58aefcf8be21b32e2a7b83da6d0facb8b326 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654463637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CwtHlV2CLKnuoMSolMAXVFwJo8g15C/KTJlqmv7Qa0k=; b=OdwLV6PkkGLi9jePuEUL07fMseQYYuFQS6KrYRknlQs8Jk0TtIwtWWGh25l8Kq6b7Vvi6C SQY+cf9fMwsYfRoZVnQ7dpm3HiKzJI1/vmMoj3hA4C64fOq1p+ESs3YSR+r6TZN4NbiV2B CnUVkcK0czROFFNDE6PRfYz5CrzeqQel1awVueoRL+DwLNqhI+BLX5yLOkQ7+BJb4coyVp 5muWCwyHn+kSNVZnycAPW3Mjmj+ESzT63tMkAZOt3wnuFPljEKI46tmY6V0O8NGb2gOaDb fCd4bMQDOTEVZQeccf6zf0H5tXEX4Kv04z02SiztwBHHt8hdnh6Rx3lTM6pEYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654463637; a=rsa-sha256; cv=none; b=MpJ/GFK7ZQy8P4pJ+dQJNBKpiQC3k/+SUGU9+V/o1MNWTUaDANw/fi+ZaoQ2Wg813Ax0Hw rRiYQlKeVotzZOt0p4xGNgDKWv5wyCMcse2cvlv24Nd0jix/Tigg9dPb9FI/aeG7vVwQUh 7n8gJKZPEJM2yzWWE6UG9KFUbjx046qGBAN3JQmHfhPKPiOHJIVw8bhFrVnVp/Tgi9BMbL FAYFup80HfZIztmp6FFozr7BvvS/JICZg6Mw7/5L0D1C8QF5rqkbo7bn0/sD6M9syrTeyU paiTO/IbSU887cwZQ5IdkwGNP2K1fUYcdj9yM/NRJiKJ7WYj471meh2LKN1TtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=71df58aefcf8be21b32e2a7b83da6d0facb8b326 commit 71df58aefcf8be21b32e2a7b83da6d0facb8b326 Author: Bjoern A. Zeeb AuthorDate: 2022-06-05 21:10:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-05 21:12:55 +0000 LinuxKPI: 802.11: plug a ni leak in lkpi_sta_assoc_to_run() In lkpi_sta_assoc_to_run() we are going through some code segments twice (auth->assoc, assoc->authorized). The 2nd time we shall not re-gain a reference on the net80211 node as otherwise it'll leak. Likewise we do not have to re-set lsta and sta. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index f2a5d6dac706..fd17aba19d96 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1590,12 +1590,9 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int } /* Update sta_state (ASSOC to AUTHORIZED). */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " "ASSOC: %#x\n", __func__, lsta, lsta->state)); - sta = LSTA_TO_STA(lsta); error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_AUTHORIZED); if (error != 0) { IMPROVE("undo some changes?");