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 147C81DC99C for ; Thu, 1 May 2025 14:14:08 +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=1746108849; cv=none; b=WLbBIyD5BRZL57kFOwCJ6Gk2mC0oeQ2uu+aS7AhEVuOBbMrFWTcXNUZdqylEEKR3MQv5i1Bfp0fo2/SsYN88GxrztlH1ha3kJhJDWPHz+8ezKMQBWkRZGi/l53BaV0dl0Yt9mvvdEX1+yFR5RgfXgpU9CBIdZ0dO/ggDU3+Q5wo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108849; c=relaxed/simple; bh=BvbVRKGm8p1m+5VzMokvgUtQ0mAUUSi6g7g6uUWvztY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=H50J/xLZC4AQd8tzoiWN1hKtsKZmvhxHOQFZeJC4XPB+iqIoMgiFSJggK2IKIYxWJ1Cy1O0CVqX96Q4y8tDkIBWIqkeNkyzs8Z1/x6Vw26Vqhe+eKpHi2YpO2IqWGVVAd4wtDstS9ypiNEhF43C89L4/lOCMYrlkFcI9f75uwq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JFBlEupG; 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="JFBlEupG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06186C4CEE3; Thu, 1 May 2025 14:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108848; bh=BvbVRKGm8p1m+5VzMokvgUtQ0mAUUSi6g7g6uUWvztY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=JFBlEupGpIu3zGp4Qay7Ps0phkbrwieEhR8Lb10/0HfvtzqKO3vOS5MUDynNQDLUN R4ItVNvAB1ibZRWjyS3ave6z66cAxmBtZgeHknNzf7IKqUQqx4vNerovRoKYTCktzR b0QTFDo+Y5Hj3YnHQuKq/IDvqo8l6s3LoKyD3/eE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49830: drm/drv: Fix potential memory leak in drm_dev_init() Date: Thu, 1 May 2025 16:10:20 +0200 Message-ID: <2025050136-CVE-2022-49830-70c0@gregkh> X-Mailer: git-send-email 2.49.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=3418; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=5rq6O1zBCSS7X2KvN0thLg0LTqPgfgwdV9EavUP+pN4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDQtC75yN/19u98z9t/wdj+fXU4V7i1P1Js15JXswv +P/qpqIjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI4RMM8xS/HGi3mNrnfanc 76Z7Ye5MJzNeO4a5Asf+Omku700Rn+l0cTFfpu0Fhf/uAA== 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/drv: Fix potential memory leak in drm_dev_init() drm_dev_init() will add drm_dev_init_release() as a callback. When drmm_add_action() failed, the release function won't be added. As the result, the ref cnt added by device_get() in drm_dev_init() won't be put by drm_dev_init_release(), which leads to the memleak. Use drmm_add_action_or_reset() instead of drmm_add_action() to prevent memleak. unreferenced object 0xffff88810bc0c800 (size 2048): comm "modprobe", pid 8322, jiffies 4305809845 (age 15.292s) hex dump (first 32 bytes): e8 cc c0 0b 81 88 ff ff ff ff ff ff 00 00 00 00 ................ 20 24 3c 0c 81 88 ff ff 18 c8 c0 0b 81 88 ff ff $<............. backtrace: [<000000007251f72d>] __kmalloc+0x4b/0x1c0 [<0000000045f21f26>] platform_device_alloc+0x2d/0xe0 [<000000004452a479>] platform_device_register_full+0x24/0x1c0 [<0000000089f4ea61>] 0xffffffffa0736051 [<00000000235b2441>] do_one_initcall+0x7a/0x380 [<0000000001a4a177>] do_init_module+0x5c/0x230 [<000000002bf8a8e2>] load_module+0x227d/0x2420 [<00000000637d6d0a>] __do_sys_finit_module+0xd5/0x140 [<00000000c99fc324>] do_syscall_64+0x3f/0x90 [<000000004d85aa77>] entry_SYSCALL_64_after_hwframe+0x63/0xcd The Linux kernel CVE team has assigned CVE-2022-49830 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 2cbf7fc6718b9443ecd6261308c6348d8ffcccae and fixed in 5.10.156 with commit c47a823ea186263ab69cfb665327b7f72cb5e779 Issue introduced in 5.8 with commit 2cbf7fc6718b9443ecd6261308c6348d8ffcccae and fixed in 5.15.80 with commit 07e56de8766fe5be67252596244b84ac0ec0de91 Issue introduced in 5.8 with commit 2cbf7fc6718b9443ecd6261308c6348d8ffcccae and fixed in 6.0.10 with commit bd8d1335e6e70a396094ef98913b513140c0b86b Issue introduced in 5.8 with commit 2cbf7fc6718b9443ecd6261308c6348d8ffcccae and fixed in 6.1 with commit ff963634f7b2e0dc011349abb3fb81a0d074f443 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-49830 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/drm_drv.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/c47a823ea186263ab69cfb665327b7f72cb5e779 https://git.kernel.org/stable/c/07e56de8766fe5be67252596244b84ac0ec0de91 https://git.kernel.org/stable/c/bd8d1335e6e70a396094ef98913b513140c0b86b https://git.kernel.org/stable/c/ff963634f7b2e0dc011349abb3fb81a0d074f443