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 919A219D081 for ; Wed, 26 Feb 2025 01:57:56 +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=1740535076; cv=none; b=k6jzcLO+uZdaKqtWUzxsXuSfOQobtg+lZjNHea9z6EKhxg+Pjo7r0uYnTNrrASf4ac2ZfCoEcSCsrea3zv9gu768E3cRn7YTkoGPlpRxfzQZeFzUJo/Zz4CzowRfmKEhMGdK6Sitlh4igeuBw1fvSiQ1NEZxm3VPfpa4YZFlpg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535076; c=relaxed/simple; bh=E4HHlVMrBH1namWZc9Hot498emA9qxQJVI+NNLjawVw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QeL3H4MzJG3SMGSEWVUzn0UzAGhOLt2AQsdC+RCIILRywItgp8UKQ3QhT0keRHb/8MYAu0PK14uYG/pqSNTl5BtoPd1S6XnZ+AFybZE5N9iXe52iYrsSsV/CI7Bi6nI3sq5B4GFlbUiMPbb8JmdDMDmGBO8NAPwb6E5mW2ShYlk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oBrGAQUd; 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="oBrGAQUd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63B7FC4CEDD; Wed, 26 Feb 2025 01:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535076; bh=E4HHlVMrBH1namWZc9Hot498emA9qxQJVI+NNLjawVw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=oBrGAQUdliKFAfNZ0ZRuIjZdNEgaU2dlg3a8kpZpVAAhPhgmSWzX3NLeJmRf9Y5yc H4cEjMmWgK2cbPkp1lTIVnV/7AZTR6owUOquIBpee6G2tulje3n8s7rt/IASruYCox PuBwGxEODU4BTnW0E3gCW9U8t1fxT3KjWQHcRRpo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47649: udmabuf: validate ubuf->pagecount Date: Wed, 26 Feb 2025 02:54:00 +0100 Message-ID: <2025022649-CVE-2021-47649-f358@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=3058; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=E4HHlVMrBH1namWZc9Hot498emA9qxQJVI+NNLjawVw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SnSNInY9vReUcM6P0cLvvO2HPTHmAgeeyEeK1hVGb eJjvKXWEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNhn8ewYKPOnEVJJbdZnMTC w/dte7hOYuWfXwxzOPU6WeNnyB25/GpJNrPrg383nRe/BgA= 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: udmabuf: validate ubuf->pagecount Syzbot has reported GPF in sg_alloc_append_table_from_pages(). The problem was in ubuf->pages == ZERO_PTR. ubuf->pagecount is calculated from arguments passed from user-space. If user creates udmabuf with list.size == 0 then ubuf->pagecount will be also equal to zero; it causes kmalloc_array() to return ZERO_PTR. Fix it by validating ubuf->pagecount before passing it to kmalloc_array(). The Linux kernel CVE team has assigned CVE-2021-47649 to this issue. Affected and fixed versions =========================== Issue introduced in 4.20 with commit fbb0de795078190a9834b3409e4b009cfb18a6d4 and fixed in 5.4.189 with commit 5d50f851dd307c07ca5591297093f19967c834a9 Issue introduced in 4.20 with commit fbb0de795078190a9834b3409e4b009cfb18a6d4 and fixed in 5.10.110 with commit b267a8118c2b171bf7d67b90ed64154eeab9fae0 Issue introduced in 4.20 with commit fbb0de795078190a9834b3409e4b009cfb18a6d4 and fixed in 5.15.33 with commit 811b667cefbea9cb7511a874b169d6a92907137e Issue introduced in 4.20 with commit fbb0de795078190a9834b3409e4b009cfb18a6d4 and fixed in 5.16.19 with commit a3728d32fc61eb0fe283cb8ff60b2c8f751e2202 Issue introduced in 4.20 with commit fbb0de795078190a9834b3409e4b009cfb18a6d4 and fixed in 5.17.2 with commit 9e9b4a269f84d3230f2af84ff42322db676440d9 Issue introduced in 4.20 with commit fbb0de795078190a9834b3409e4b009cfb18a6d4 and fixed in 5.18 with commit 2b6dd600dd72573c23ea180b5b0b2f1813405882 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-2021-47649 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/dma-buf/udmabuf.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/5d50f851dd307c07ca5591297093f19967c834a9 https://git.kernel.org/stable/c/b267a8118c2b171bf7d67b90ed64154eeab9fae0 https://git.kernel.org/stable/c/811b667cefbea9cb7511a874b169d6a92907137e https://git.kernel.org/stable/c/a3728d32fc61eb0fe283cb8ff60b2c8f751e2202 https://git.kernel.org/stable/c/9e9b4a269f84d3230f2af84ff42322db676440d9 https://git.kernel.org/stable/c/2b6dd600dd72573c23ea180b5b0b2f1813405882