Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E73B17BB2D for ; Wed, 10 Apr 2024 18:58:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712775489; cv=none; b=ArpmI/O6U/Xla2yRpUCOTIB31MIDiODhV9EshlsTHSfB312SIUTPg0pgJ5qx/myymHCnZtQ44rHDLGTBuaAgXojlVMGmmmQi3Omns3V/61KYY3n9+uskko+OHLz7KJKsMYvtZP99MXTFcGHI+MTDeXuPaOW2kOzKyZxFV9qKUa4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712775489; c=relaxed/simple; bh=+8/2RZtz0Exz/Zc6WTmsUaaZHuaObEIyAFDI/KnPrPY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cgp3Pphztd0p78DWaBs/ObMZzpwiG7adDrm7rNwLde5NkezBSYkvlfp160liiYbEz0u+3SHX4+JanFfV6QqrOcwvOeM1JUYyiPNbC/JRECKjioUnJVqcBygsq/B0fa51RUM39nk1sZr/Zyyxa6RnoS9LIDK01bep/OsG/Puu2DY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZHKzINh8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZHKzINh8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D57EEC433C7; Wed, 10 Apr 2024 18:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712775489; bh=+8/2RZtz0Exz/Zc6WTmsUaaZHuaObEIyAFDI/KnPrPY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ZHKzINh8d/ciDZxiunxQ1wfG5xE3Wwa9W1Y/+BYGFmjWrqG83p079FvcpsGIs6KNu xFpvZxmS6tDaot5SKjPXM26v62eNuVSZeaGbGt1gv9/1mikONpjUlFz7K2xrv3squf yMNvnoMYMgysRjkoJ2cvdhDPbP1TyLB4P76x6y9Y= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47198: scsi: lpfc: Fix use-after-free in lpfc_unreg_rpi() routine Date: Wed, 10 Apr 2024 20:57:47 +0200 Message-ID: <2024041036-CVE-2021-47198-2426@gregkh> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2076; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+8/2RZtz0Exz/Zc6WTmsUaaZHuaObEIyAFDI/KnPrPY=; b=owGbwMvMwCRo6H6F97bub03G02pJDGliDxUmTmMOnGwftDXlYKiYhfvZwy93lPbqKq0VOVomI nBTMzO+I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACby7B/DgrOib43yX/R95FBu 3nr6dBrblAWRHgwLJp28a6Ewu1ur4/CF9/vK74lJxbTbAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: scsi: lpfc: Fix use-after-free in lpfc_unreg_rpi() routine An error is detected with the following report when unloading the driver: "KASAN: use-after-free in lpfc_unreg_rpi+0x1b1b" The NLP_REG_LOGIN_SEND nlp_flag is set in lpfc_reg_fab_ctrl_node(), but the flag is not cleared upon completion of the login. This allows a second call to lpfc_unreg_rpi() to proceed with nlp_rpi set to LPFC_RPI_ALLOW_ERROR. This results in a use after free access when used as an rpi_ids array index. Fix by clearing the NLP_REG_LOGIN_SEND nlp_flag in lpfc_mbx_cmpl_fc_reg_login(). The Linux kernel CVE team has assigned CVE-2021-47198 to this issue. Affected and fixed versions =========================== Fixed in 5.15.5 with commit dbebf865b323 Fixed in 5.16 with commit 79b20beccea3 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2021-47198 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/scsi/lpfc/lpfc_hbadisc.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/dbebf865b3239595c1d4dba063b122862583b52a https://git.kernel.org/stable/c/79b20beccea3a3938a8500acef4e6b9d7c66142f