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 BF31428C2B3 for ; Wed, 18 Jun 2025 11:12:54 +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=1750245174; cv=none; b=qOLIn4GBqXM/03f0B7FHJ/g2vuMB88Wwi5o33I9RgxaZY74HJnlcZSfDS6ojKKMatsF7GQv1/+fo2/M/LoT3dLaXIAwgnuxc3ahOMTxupBtyALPBGSlUNs/IV900bQOVJsEfDOKclWRad1d9kXekYoLEjJucHM6OHzLVv/YaM3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245174; c=relaxed/simple; bh=eIpOhlebVwO+2gH8BOi4ZhiWsc31+Gue4ROXN0/AP44=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=K4+KY7KX7ID+U0yiNQFWzd9PL5qTD/ssXdsHAtWwCAh+ZGimREcv/VbPo2giB74SPYoFJKwanVv2+VJ1dILnK3JiSmElVdKVJCwKcvCrfmmJrdPX+rYRYXlULh7CoxaXBbyYhyEakPK5frHfTtMAMmZ/KP3ZSEmu1OcuiMBehhA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nDGx/6YA; 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="nDGx/6YA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DFE5C4CEE7; Wed, 18 Jun 2025 11:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245174; bh=eIpOhlebVwO+2gH8BOi4ZhiWsc31+Gue4ROXN0/AP44=; h=From:To:Cc:Subject:Date:Reply-to:From; b=nDGx/6YAn7Vq3pWA/Zj6JRbsXoJ+CfOn2r7dXX/2sRX0Tse/+XN6w7BKjk5QbndVr H3vtm07UiWs8YqdkbMbdB0w/3/DMzcPIPaKGkXfGYWZXEzFdakUTjJ+RGouBuX/4Ny /MLoQ5xpmVcAN+joOdZ+mvc/9vt4bAGN10U215OQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50151: usb: cdns3: fix random warning message when driver load Date: Wed, 18 Jun 2025 13:03:36 +0200 Message-ID: <2025061822-CVE-2022-50151-6132@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=3037; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Kqxd5yfrysEFJHGvEEu9/zxzAQxZbGb5sOTxTT5sPag=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc5qKn3h7aT45J2g/73WjYeqrsp/rW1Z7Nd7SNmWa/ lZF4R9DRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzktjnD/JiJ0aFROhly2mvV b2iXT+PocQ71YZhnvvhhsdLbCz//1lhJmccHWSp77KgFAA== 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: usb: cdns3: fix random warning message when driver load Warning log: [ 4.141392] Unexpected gfp: 0x4 (GFP_DMA32). Fixing up to gfp: 0xa20 (GFP_ATOMIC). Fix your code! [ 4.150340] CPU: 1 PID: 175 Comm: 1-0050 Not tainted 5.15.5-00039-g2fd9ae1b568c #20 [ 4.158010] Hardware name: Freescale i.MX8QXP MEK (DT) [ 4.163155] Call trace: [ 4.165600] dump_backtrace+0x0/0x1b0 [ 4.169286] show_stack+0x18/0x68 [ 4.172611] dump_stack_lvl+0x68/0x84 [ 4.176286] dump_stack+0x18/0x34 [ 4.179613] kmalloc_fix_flags+0x60/0x88 [ 4.183550] new_slab+0x334/0x370 [ 4.186878] ___slab_alloc.part.108+0x4d4/0x748 [ 4.191419] __slab_alloc.isra.109+0x30/0x78 [ 4.195702] kmem_cache_alloc+0x40c/0x420 [ 4.199725] dma_pool_alloc+0xac/0x1f8 [ 4.203486] cdns3_allocate_trb_pool+0xb4/0xd0 pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags) { ... page = kmalloc(sizeof(*page), mem_flags); page->vaddr = dma_alloc_coherent(pool->dev, pool->allocation, &page->dma, mem_flags); ... } kmalloc was called with mem_flags, which is passed down in cdns3_allocate_trb_pool() and have GFP_DMA32 flags. kmall_fix_flags() report warning. GFP_DMA32 is not useful at all. dma_alloc_coherent() will handle DMA memory region correctly by pool->dev. GFP_DMA32 can be removed safely. The Linux kernel CVE team has assigned CVE-2022-50151 to this issue. Affected and fixed versions =========================== Fixed in 5.15.63 with commit 8e142744f0e96abc69ccd99e6d6c7eb662267f21 Fixed in 5.19.2 with commit 960a8a35a6027a08c4b511435bf59609b5d5e5cd Fixed in 6.0 with commit 8659ab3d936fcf0084676f98b75b317017aa8f82 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-50151 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/usb/cdns3/cdns3-gadget.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/8e142744f0e96abc69ccd99e6d6c7eb662267f21 https://git.kernel.org/stable/c/960a8a35a6027a08c4b511435bf59609b5d5e5cd https://git.kernel.org/stable/c/8659ab3d936fcf0084676f98b75b317017aa8f82