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 C54C719CC02 for ; Wed, 26 Feb 2025 01:58:40 +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=1740535120; cv=none; b=U5CKjiJdxh9NVrwB1HE+v2+0zX3oNZVRgXA1zcB0PKNqoMKp+anST8CBIkBMwQDxf1q1NqO8CPzDTLLGW7BwnoZdX8XA45WRHuIiuS4cld0v5FEARQZ3z58W5CjGNlu26gLGsQeo/fSDRGQ7mRME05E6hJcxjmx3IP2T9PBZwV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535120; c=relaxed/simple; bh=JQbDy5/1sVBlI3mgf7rPjaS+SNiJwhQfXeKjot6tIi0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sSzOXxDy8Tnfjohq/vT47nD8YYIBOi9OMeAQAi/zdNeN24GIi2POw/O1riFIQR6ErhhWgmU4Iwj9s4zeVIg75t5c8clXwu5BJ60SDv5Tx7zHnll87lGlL6Q/lyi5mqZIQ6niWtQgNK5Yntz4NqTngnwImS9vZi5J1cP0XqetP1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UvS8erc4; 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="UvS8erc4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C3CBC4CEDD; Wed, 26 Feb 2025 01:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535120; bh=JQbDy5/1sVBlI3mgf7rPjaS+SNiJwhQfXeKjot6tIi0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=UvS8erc4J5vpNF+kUkQPajFpiysQStt1Q1jU8JsIWYeYQDLBAWTbKR1bTxrDYPxbP txRWJA5namPVMpL922+yPpSvoDcvf19wtCmm7leiIx8uNUsfZCREo1QnPDFcXOO3Gy SQoRL4jzyPUhduN234PgsBsAHytl3sNtLmqn07Xg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49137: drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj Date: Wed, 26 Feb 2025 02:55:42 +0100 Message-ID: <2025022606-CVE-2022-49137-92fc@gregkh> X-Mailer: git-send-email 2.48.1 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=2768; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JQbDy5/1sVBlI3mgf7rPjaS+SNiJwhQfXeKjot6tIi0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SuwebTC9oiX6tXVH6dkTSolBWi+tahvll9ZFdzhpO x2T2hDQEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABMpMmJY0BqUoVNiIHP3SoQA r2ma0PxJHy95MCzY9rIvLGwSyyT2xm3LZeav5I7uXfwMAA== 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: drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj This issue takes place in an error path in amdgpu_cs_fence_to_handle_ioctl(). When `info->in.what` falls into default case, the function simply returns -EINVAL, forgetting to decrement the reference count of a dma_fence obj, which is bumped earlier by amdgpu_cs_get_fence(). This may result in reference count leaks. Fix it by decreasing the refcount of specific object before returning the error code. The Linux kernel CVE team has assigned CVE-2022-49137 to this issue. Affected and fixed versions =========================== Fixed in 4.19.238 with commit 72d77ddb2224ebc00648f4f78f8a9a259dccbdf7 Fixed in 5.4.189 with commit 4009f104b02b223d1a11d74b36b1cc083bc37028 Fixed in 5.10.111 with commit 927beb05aaa429c883cc0ec6adc48964b187e291 Fixed in 5.15.34 with commit 3edd8646cb7c11b57c90e026bda6f21076223f5b Fixed in 5.16.20 with commit b6d1f7d97c81ebaf2cda9c4c943ee2e484fffdcf Fixed in 5.17.3 with commit bc2d5c0775c839e2b072884f4ee6a93ba410f107 Fixed in 5.18 with commit dfced44f122c500004a48ecc8db516bb6a295a1b 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-2022-49137 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/gpu/drm/amd/amdgpu/amdgpu_cs.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/72d77ddb2224ebc00648f4f78f8a9a259dccbdf7 https://git.kernel.org/stable/c/4009f104b02b223d1a11d74b36b1cc083bc37028 https://git.kernel.org/stable/c/927beb05aaa429c883cc0ec6adc48964b187e291 https://git.kernel.org/stable/c/3edd8646cb7c11b57c90e026bda6f21076223f5b https://git.kernel.org/stable/c/b6d1f7d97c81ebaf2cda9c4c943ee2e484fffdcf https://git.kernel.org/stable/c/bc2d5c0775c839e2b072884f4ee6a93ba410f107 https://git.kernel.org/stable/c/dfced44f122c500004a48ecc8db516bb6a295a1b