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 D0F01313D7E for ; Thu, 18 Sep 2025 16:06:01 +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=1758211561; cv=none; b=MbNrOZcnHnBTA6KHa3kPQGt2p53/RrhvqQYShnoPqFldAYsTHp2D9F+z9fGgG+pAahZPQ9RJdqHYUsYcUIFJfsjDhzKfGDa8MO/d+d166iL1ykHn4r3Jh1/MBAkiDw3MRXM+dD+FPOlIm31F9jKuk5AAfAdEmSbV0D8PBumMoLM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758211561; c=relaxed/simple; bh=tumKDGz8HqelJd7GrCCTQAcQD437VJAsUWX+H15Qei0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CtUVB+tB1YjWzxf+2//8V9Y5QQpu/KVDxkRtfcWaTvrizX8L7KBzW4rftLTp1/3Ciyw7Hmod/GxTlT4HNZeAqV6/RtNHgsMApc+EYKwNo+E1Ylz4C34oJrr+p3JcmKYCquSTN+CVbV56A10RTaN61qYbWt35x1qE4MWHq0Rx3iU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uUtnLzPZ; 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="uUtnLzPZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1329C4CEE7; Thu, 18 Sep 2025 16:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758211561; bh=tumKDGz8HqelJd7GrCCTQAcQD437VJAsUWX+H15Qei0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=uUtnLzPZYE9qPnQAXT/hFnafNl7cUseAc9JC5D9zKmjZe9pq6DPkdVn65hps/aMLB FkCXVJV5dqjXdXjUBx6c2vdDKqRdDOsEbImqwbQ4VvUrkus2cB03U9BIw2QNzngRuZ UE7fTDz8hWABO9fReSwY+om5S+6Szyv2rHHzbA9k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50417: drm/panfrost: Fix GEM handle creation ref-counting Date: Thu, 18 Sep 2025 18:04:07 +0200 Message-ID: <2025091855-CVE-2022-50417-1a69@gregkh> X-Mailer: git-send-email 2.51.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=3175; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wV7hHp0Ye2xQt8fjHT/gL33dq3TEBSDk24FNUxi9/CE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlndLMT7PYctLmruoX9Ww7Hkxpn7RJB2YbAnsI3FVZVF gkbv+d2xLIwCDIxyIopsnzZxnN0f8UhRS9D29Mwc1iZQIYwcHEKwEScpBnmJzheKNjmr56f6CE2 +/6B9jfmLQ/EGBZ0v5iQMWsS9185xlOduZPn7170rDIUAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: drm/panfrost: Fix GEM handle creation ref-counting panfrost_gem_create_with_handle() previously returned a BO but with the only reference being from the handle, which user space could in theory guess and release, causing a use-after-free. Additionally if the call to panfrost_gem_mapping_get() in panfrost_ioctl_create_bo() failed then a(nother) reference on the BO was dropped. The _create_with_handle() is a problematic pattern, so ditch it and instead create the handle in panfrost_ioctl_create_bo(). If the call to panfrost_gem_mapping_get() fails then this means that user space has indeed gone behind our back and freed the handle. In which case just return an error code. The Linux kernel CVE team has assigned CVE-2022-50417 to this issue. Affected and fixed versions =========================== Issue introduced in 5.2 with commit f3ba91228e8e917e5bd6c4b72bfe846933d17370 and fixed in 5.10.163 with commit 0b70f6ea4d4f2b4d4b291d86ab76b4d07394932c Issue introduced in 5.2 with commit f3ba91228e8e917e5bd6c4b72bfe846933d17370 and fixed in 5.15.87 with commit 4f1105ee72d8c7c35d90e3491b31b2d9d6b7e33a Issue introduced in 5.2 with commit f3ba91228e8e917e5bd6c4b72bfe846933d17370 and fixed in 6.0.19 with commit 3f9feffa8a5ab08b4e298a27b1aa7204a7d42ca2 Issue introduced in 5.2 with commit f3ba91228e8e917e5bd6c4b72bfe846933d17370 and fixed in 6.1.5 with commit ba3d2c2380e7129b525a787489c0b7e819a3b898 Issue introduced in 5.2 with commit f3ba91228e8e917e5bd6c4b72bfe846933d17370 and fixed in 6.2 with commit 4217c6ac817451d5116687f3cc6286220dc43d49 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-50417 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/panfrost/panfrost_drv.c drivers/gpu/drm/panfrost/panfrost_gem.c drivers/gpu/drm/panfrost/panfrost_gem.h 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/0b70f6ea4d4f2b4d4b291d86ab76b4d07394932c https://git.kernel.org/stable/c/4f1105ee72d8c7c35d90e3491b31b2d9d6b7e33a https://git.kernel.org/stable/c/3f9feffa8a5ab08b4e298a27b1aa7204a7d42ca2 https://git.kernel.org/stable/c/ba3d2c2380e7129b525a787489c0b7e819a3b898 https://git.kernel.org/stable/c/4217c6ac817451d5116687f3cc6286220dc43d49