From nobody Wed Jun 08 17:07:10 2022 X-Original-To: dev-commits-src-all@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 2D1F7831CD2; Wed, 8 Jun 2022 17:07:14 +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 4LJDDH1Glcz4lRQ; Wed, 8 Jun 2022 17:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654708033; 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=nxBeh7Mw5W77SaJqrb51YnN7CyZE+dT1saPO9C4NVmc=; b=mkCK7L7MK7E/pivCtFQxUiB/eWWJFR6bPFDcp1nh73UwTZ0btDv78Q8QFPgp90G/9hFNdR D7MpaNa0EFg6AlQp1Xfv7CbRugXzayXzxDK3iNA3xxkN0utkq+I6vTf2X3BHsUzAiUqe0K /cBXG29xl3rbpTXJyaALJh3lTjR+03netVsQv0OhHFG8/ehfYQv56qp50xiQdmbU1+Vw+Y 77SkAjSvYgJTkDcjOJlbgA9Gi82cP8mH88jnra0gQpJ/Y5qzdfS3Mzy8Eyz/n9q0rkRdk1 ku0rpzev7/+45No4CiumGVo9b4YtagiXidOnF2qkVfCMG3ULZOW271gEdc9ykg== 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 CB62413A75; Wed, 8 Jun 2022 17:07:10 +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 258H7Ajk089052; Wed, 8 Jun 2022 17:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 258H7AGm089051; Wed, 8 Jun 2022 17:07:10 GMT (envelope-from git) Date: Wed, 8 Jun 2022 17:07:10 GMT Message-Id: <202206081707.258H7AGm089051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 994522a420d1 - stable/13 - LinuxKPI: 802.11: plug a ni leak in lkpi_sta_assoc_to_run() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 994522a420d17a43615a59468dc91d935b82f48b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654708033; 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=nxBeh7Mw5W77SaJqrb51YnN7CyZE+dT1saPO9C4NVmc=; b=RUjtpdZc0Ih5JLdN5D2XQxrAS+Cx3LKFW1Jnxi0S7pe/aXNuhAbQShmfwgwvBS3jgQOeeT yzlTs/XoCALB/5WmEk9VmtOCZQVPPJ9sgiLNe7tAW3u5H2rfiromvfaEpyu2D76UfBqBA8 utn5f+0pGLP2rWVLTtEnviXh64mI7mB8x5hGMvp/XayPkGkB5peoWFPNBocgq8cYEz4Stz CL4HpGz+vqzQKUKjBSiRHtfDykApAybWhclqfmum8WcxT9uUdwR46YnefAb5ritOrVH2R4 K5gsDmkWf1Bgabc/x++gWKggjzJ/V1X8LdiP9Af+c8G/m/ijkYa89zjfeVRgEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654708033; a=rsa-sha256; cv=none; b=M4sB7L01qoYfnkxqRKQ3EKCA0oWG1ESiQohVnxdC7QtufUrMZ9qw+EOCeHdwlH2WHJn0We HbfgyseVE5Xae5IMU3luZMD4tL3xgTdfLe9bj0aeza9CIDMgmRZ23zWMqNSyz9fMRrPTnv SdSkjmzIHJ9zpeOQ905jX+jqZwqg+kvlCSpNLaJOm17YzrmSQqJB5qDdBjk5M0vUfPrC7e 4uJKD6NCcgMyU72G77rFiqJQqOHOCngLRAq9GxgxWyMwCgfCP1Uak/n50SYrQdZK74N+kO mFmVQ+nTeroTznMV5WyFjC1QhCOjwz+lmvgYTxnLsheyGBIHcdJSvOHL8iirYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=994522a420d17a43615a59468dc91d935b82f48b commit 994522a420d17a43615a59468dc91d935b82f48b Author: Bjoern A. Zeeb AuthorDate: 2022-06-05 21:10:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-08 16:11:19 +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 (cherry picked from commit 71df58aefcf8be21b32e2a7b83da6d0facb8b326) --- 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 82467d932054..094724c57d10 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?");