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 9469B1F63D5 for ; Fri, 27 Dec 2024 15:01:36 +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=1735311696; cv=none; b=kb7U1psjqA8qChruXzmPVIvGJyTmKBkaR5R9cgn8CMRdNLr5ipg476TpDhHyj/bKfzJDqaK+9+BLaDlVS2J9StUp0MGO2hgWuC+IrRluyOaZ/qGD7Q5SVkZXKSX/rAcBlEg7dD37Lgwc1zxhlfXt31+vfy3FTH5tTYUBPHudF5M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735311696; c=relaxed/simple; bh=aciIT9WbMLpoL4WHywpQdHdotExJVx5guIiKktFyVAM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NxDf3mq5QgQSRcthBxeYB1m3fEkgzlxaLFUKaXFQtfndLIDgIqHGB3KOtt7xsmMriKqDbTh4KUbCftPzVYJ5SsWTy3O8Op/gtH1VLNIxM4QTyIaVI+P9rLgVO4wIZJcjb4BxhBgNEJPwEJeFJnQsvXeO36CmPjWZFbsT0J1A9f0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=04WFpO2s; 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="04WFpO2s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED817C4CED0; Fri, 27 Dec 2024 15:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735311696; bh=aciIT9WbMLpoL4WHywpQdHdotExJVx5guIiKktFyVAM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=04WFpO2sxUnZROL8X0pJ4N9oYUXxR15HpcGmQf3W+25hnX+i0kkyGBQdedUp2Mknk Qjdm4w9738Mhws8naX1KZS8wQdSVrQwLX2IgyMhBL/NWDIvhaZ71VfQFUR1FWVVJ7A UAC8SdTUyrc9qQu02usnEeWUtYUOdhGY+zHH0ONI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56624: iommufd: Fix out_fput in iommufd_fault_alloc() Date: Fri, 27 Dec 2024 15:51:31 +0100 Message-ID: <2024122711-CVE-2024-56624-35f7@gregkh> X-Mailer: git-send-email 2.47.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=2774; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=aciIT9WbMLpoL4WHywpQdHdotExJVx5guIiKktFyVAM=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5++7vr1R7nhizePkMo4bKn28WneTKy8i5KvlN/OGTS crTio/d6ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJbCtkWNARwGa2pLpGcM08 Ph0l3Sv5u/NYSxjmWVzOLCk/1zb5uLQ9g2BgQcu1onR+AA== 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: iommufd: Fix out_fput in iommufd_fault_alloc() As fput() calls the file->f_op->release op, where fault obj and ictx are getting released, there is no need to release these two after fput() one more time, which would result in imbalanced refcounts: refcount_t: decrement hit 0; leaking memory. WARNING: CPU: 48 PID: 2369 at lib/refcount.c:31 refcount_warn_saturate+0x60/0x230 Call trace: refcount_warn_saturate+0x60/0x230 (P) refcount_warn_saturate+0x60/0x230 (L) iommufd_fault_fops_release+0x9c/0xe0 [iommufd] ... VFS: Close: file count is 0 (f_op=iommufd_fops [iommufd]) WARNING: CPU: 48 PID: 2369 at fs/open.c:1507 filp_flush+0x3c/0xf0 Call trace: filp_flush+0x3c/0xf0 (P) filp_flush+0x3c/0xf0 (L) __arm64_sys_close+0x34/0x98 ... imbalanced put on file reference count WARNING: CPU: 48 PID: 2369 at fs/file.c:74 __file_ref_put+0x100/0x138 Call trace: __file_ref_put+0x100/0x138 (P) __file_ref_put+0x100/0x138 (L) __fput_sync+0x4c/0xd0 Drop those two lines to fix the warnings above. The Linux kernel CVE team has assigned CVE-2024-56624 to this issue. Affected and fixed versions =========================== Issue introduced in 6.11 with commit 07838f7fd529c8a6de44b601d4b7057e6c8d36ed and fixed in 6.12.5 with commit 2b3f30c8edbf9a122ce01f13f0f41fbca5f1d41d Issue introduced in 6.11 with commit 07838f7fd529c8a6de44b601d4b7057e6c8d36ed and fixed in 6.13-rc2 with commit af7f4780514f850322b2959032ecaa96e4b26472 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-56624 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/iommu/iommufd/fault.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/2b3f30c8edbf9a122ce01f13f0f41fbca5f1d41d https://git.kernel.org/stable/c/af7f4780514f850322b2959032ecaa96e4b26472