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 0E12E28AAE7 for ; Thu, 10 Jul 2025 07:44: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=1752133448; cv=none; b=dSgLtBVIiCeOstIaMrPgH/Z6C28wcrtZib4c0R+H4BCZC18zpcrG+NuCD1Vl9eC6Q8SIlpqX3Yi46Ru0y0VJ4l5i6Vky0JU7YY+1apgYdoFMAppPfdn5FmMdk3ThN9AGyftLhqkOTkQUNfQY5yYCif+xiXHOVQjilElFrJ6iE/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752133448; c=relaxed/simple; bh=SiydG/4VjUzRkvFL29vJGmN8f55gcSYjbfRQ+yF2kgo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=p1BobGxKoP9fuUkxvrPLLIrf9ztgbl2FaY99rRbt7sEJqceyYJwT7Nps9Cj0XfOEUM/hZ4VGdcnJx/57eWWwzkZZo29Vz6tj8FiJzmPMKu/JJlIE3GtBmD0deOwmHQ1rlGukDUdXbCHPRwXd2pwCxrCT2FH7F2S2tY8hSa2yHt8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uUdJ8m9w; 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="uUdJ8m9w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F775C4CEE3; Thu, 10 Jul 2025 07:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752133447; bh=SiydG/4VjUzRkvFL29vJGmN8f55gcSYjbfRQ+yF2kgo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=uUdJ8m9wmViQYPMYhgK1mpPpf4eLRr2BYJbrfOqG+s+905u9kiQ3QctK9Wy9RtZJz fp5YXi6eXfmh7k85al9XimrBGfvAH462JZsOpmQ+Pzd6JBLDIwqerPZOuDvknPbWMe 63paovnP8EEIRsAwJ/rI55buJZ/RuVjd2O2fQ1uQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38274: fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt() Date: Thu, 10 Jul 2025 09:42:15 +0200 Message-ID: <2025071008-CVE-2025-38274-087f@gregkh> X-Mailer: git-send-email 2.50.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=2700; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oJnfSLHY+UIvsRfYsPnrMYlenW6YeWZb8w6ucCRRCEg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBn5eRcuZgbrpzkfZ5/A9uTdJk7l6Us3MqQcKbtZrW2i/ iv7SOGGjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIvBfDgrUz7JMDtFdtzTlU qpX5xm374VRLD4b5VVwaxpPsHizzXDX/7G8vI1u1BPk7AA== 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: fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt() fpga_mgr_test_img_load_sgt() allocates memory for sgt using kunit_kzalloc() however it does not check if the allocation failed. It then passes sgt to sg_alloc_table(), which passes it to __sg_alloc_table(). This function calls memset() on sgt in an attempt to zero it out. If the allocation fails then sgt will be NULL and the memset will trigger a NULL pointer dereference. Fix this by checking the allocation with KUNIT_ASSERT_NOT_ERR_OR_NULL(). The Linux kernel CVE team has assigned CVE-2025-38274 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit ccbc1c302115d8125d6a96296ba52702c6de0ade and fixed in 6.6.94 with commit e69e2cfd8b38d9463a250e153ef4963a604d61e9 Issue introduced in 6.6 with commit ccbc1c302115d8125d6a96296ba52702c6de0ade and fixed in 6.12.34 with commit 8b2230ac7ff0aeb2441132df638a82ab124f8624 Issue introduced in 6.6 with commit ccbc1c302115d8125d6a96296ba52702c6de0ade and fixed in 6.15.3 with commit eb4c74eaa6e2d15f3bbd32941c9d2a25b29a718d Issue introduced in 6.6 with commit ccbc1c302115d8125d6a96296ba52702c6de0ade and fixed in 6.16-rc1 with commit 6ebf1982038af12f3588417e4fd0417d2551da28 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-2025-38274 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/fpga/tests/fpga-mgr-test.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/e69e2cfd8b38d9463a250e153ef4963a604d61e9 https://git.kernel.org/stable/c/8b2230ac7ff0aeb2441132df638a82ab124f8624 https://git.kernel.org/stable/c/eb4c74eaa6e2d15f3bbd32941c9d2a25b29a718d https://git.kernel.org/stable/c/6ebf1982038af12f3588417e4fd0417d2551da28