From mboxrd@z Thu Jan 1 00:00:00 1970 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 0AF3D1CF7A6 for ; Mon, 21 Oct 2024 19:39:47 +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=1729539588; cv=none; b=h37fUa8KT2RjvOWidgiuj/+0EZoYoKRuVizyas7Wns/OiB9T3XeaGWf5CRcYP79tLfJ3A+reF6m/vs70ry+3wroqdZSz8mnR0fTPTBCj7s2NUk1p7YjmAcP/JQKkMvxqkrranIr+ozY/0EaRUSz6XNsbEIUPmf5yP462pglZjrw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729539588; c=relaxed/simple; bh=bnNFTXXKgIg/kktHNsN9uR7o1I3Lhhg72L5Ub9/IijU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uoumnEao/f+JhRDGnVrjC+Rv8kULCjHa+5sV6aG3ItzG3fSbc2c5mNX3bzLv9s5ZQG/bIBX1aUTuUg+tumhReQ+09ySqBOvNKgLWaOtnKPY9jvMebLNdbMttYJ4Psx+hfzE+egNkhBeD9cZRJDalIoPlGSgfhBOuKIYBSmvasY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aJBxsSnu; 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="aJBxsSnu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47E5AC4CEC3; Mon, 21 Oct 2024 19:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729539587; bh=bnNFTXXKgIg/kktHNsN9uR7o1I3Lhhg72L5Ub9/IijU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=aJBxsSnuOZie85on9UN5zgeOEIuiUdW0pn2H7ZYPDrTUgv1cOq/C7Xw6iQFIDtMHb E2/YeEvfKx1SpP8YeDvecZD9P+B1+PKM2zqTNr84O6X5qGpoTQI6nqeD2lpazPH7Av GRfCYeumi8AUYxOV063yl2sgl3AGv/3zWq53LEwU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50020: ice: Fix improper handling of refcount in ice_sriov_set_msix_vec_count() Date: Mon, 21 Oct 2024 21:39:26 +0200 Message-ID: <2024102129-CVE-2024-50020-e41a@gregkh> X-Mailer: git-send-email 2.47.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=3032; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=bnNFTXXKgIg/kktHNsN9uR7o1I3Lhhg72L5Ub9/IijU=; b=owGbwMvMwCRo6H6F97bub03G02pJDOliaz9uF8v9/U/qmpJ14neN92WafImuec+T9siHbjkqI xHU/y+zI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZybT/Dgqlpx9dV3hEovrFJ cXr9RdsJlSnaOQwLTlpfTj7fYiUs688rl+r8w8v3FpMXAA== 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: ice: Fix improper handling of refcount in ice_sriov_set_msix_vec_count() This patch addresses an issue with improper reference count handling in the ice_sriov_set_msix_vec_count() function. First, the function calls ice_get_vf_by_id(), which increments the reference count of the vf pointer. If the subsequent call to ice_get_vf_vsi() fails, the function currently returns an error without decrementing the reference count of the vf pointer, leading to a reference count leak. The correct behavior, as implemented in this patch, is to decrement the reference count using ice_put_vf(vf) before returning an error when vsi is NULL. Second, the function calls ice_sriov_get_irqs(), which sets vf->first_vector_idx. If this call returns a negative value, indicating an error, the function returns an error without decrementing the reference count of the vf pointer, resulting in another reference count leak. The patch addresses this by adding a call to ice_put_vf(vf) before returning an error when vf->first_vector_idx < 0. This bug was identified by an experimental static analysis tool developed by our team. The tool specializes in analyzing reference count operations and identifying potential mismanagement of reference counts. In this case, the tool flagged the missing decrement operation as a potential issue, leading to this patch. The Linux kernel CVE team has assigned CVE-2024-50020 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 4d38cb44bd32 and fixed in 6.11.4 with commit 416dbb815ca6 Issue introduced in 6.7 with commit 4d38cb44bd32 and fixed in 6.12-rc3 with commit d517cf89874c Issue introduced in 6.7.10 with commit 3345e7cf0cf8 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-2024-50020 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/net/ethernet/intel/ice/ice_sriov.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/416dbb815ca69684de148328990ba0ec53e6dbc1 https://git.kernel.org/stable/c/d517cf89874c6039e6294b18d66f40988e62502a