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 A012586348 for ; Sat, 28 Dec 2024 09:48:01 +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=1735379281; cv=none; b=R7irbSbjFLrDQJFwfuZpEIkJWFdolL/oh+fB+kWQc45/8ggMhVPJ42gA55AQZK1XVs8OvAnsaSn3oGpboHv4GQm8lH+bCby6p65Eo6A8208myhQFoOrheXkBBtKPPR7U9aOW+bj1t5m7n/Fppj+rQoRyo/9fYfJZu7z5VG1Wbto= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735379281; c=relaxed/simple; bh=zfzHRJKhgO5o61kV5ZUPr9M4S1ZUOheREAOFl1rOavI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JAsz1dLa/2LqTo04BU2HHFMtZkTgaj0sxgn/OJivxpc8pTr2V2ITNzME/bs/fxdv/RZu+buGTMsZeHttEhnWd8DV0wl9+wibPoOsJ2snaUrZSNMQMAfBo7ffeKNZ8HIboCWH0ePXroD9pEkDhfWrJ3aB+Q5cRcQ4Yss4mErH5Nk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sLSdg61T; 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="sLSdg61T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10A1EC4CECD; Sat, 28 Dec 2024 09:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735379281; bh=zfzHRJKhgO5o61kV5ZUPr9M4S1ZUOheREAOFl1rOavI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sLSdg61T5sEBG+t/mUZ66RY5cjA8A/prch2GAc/inGIM/5Lu8jMdiS8bLUOBh8S8r TxxgPebCAQ7Om1KVnQl8kN6to/jGF+mfxmiHbZincNCbmXBaqarag3TGA19t7M21XK N7GlD/bBtZGNLtcg/XPsUFbXCJEsxa3H/k7WYj74= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56698: usb: dwc3: gadget: Fix looping of queued SG entries Date: Sat, 28 Dec 2024 10:45:50 +0100 Message-ID: <2024122836-CVE-2024-56698-6b0b@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=3316; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=zfzHRJKhgO5o61kV5ZUPr9M4S1ZUOheREAOFl1rOavI=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn5Jw6s5bxw0+Ly1B3Xre6z+jy+b3llc3JHzLRZt2tnX Dls+s7MuiOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmomrAMM+wRtN4+iS3DWJF QgWJpTX7I2on32CYp/xfy+TilKX+nQmpL22FKl30+0rdAA== 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: usb: dwc3: gadget: Fix looping of queued SG entries The dwc3_request->num_queued_sgs is decremented on completion. If a partially completed request is handled, then the dwc3_request->num_queued_sgs no longer reflects the total number of num_queued_sgs (it would be cleared). Correctly check the number of request SG entries remained to be prepare and queued. Failure to do this may cause null pointer dereference when accessing non-existent SG entry. The Linux kernel CVE team has assigned CVE-2024-56698 to this issue. Affected and fixed versions =========================== Issue introduced in 4.18 with commit c96e6725db9d6a04ac1bee881e3034b636d9f71c and fixed in 5.10.231 with commit 8ceb21d76426bbe7072cc3e43281e70c0d664cc7 Issue introduced in 4.18 with commit c96e6725db9d6a04ac1bee881e3034b636d9f71c and fixed in 5.15.174 with commit 0247da93bf62d33304b7bf97850ebf2a86e06d28 Issue introduced in 4.18 with commit c96e6725db9d6a04ac1bee881e3034b636d9f71c and fixed in 6.1.120 with commit c9e72352a10ae89a430449f7bfeb043e75c255d9 Issue introduced in 4.18 with commit c96e6725db9d6a04ac1bee881e3034b636d9f71c and fixed in 6.6.64 with commit 1534f6f69393aac773465d80d31801b554352627 Issue introduced in 4.18 with commit c96e6725db9d6a04ac1bee881e3034b636d9f71c and fixed in 6.11.11 with commit b7c3d0b59213ebeedff63d128728ce0b3d7a51ec Issue introduced in 4.18 with commit c96e6725db9d6a04ac1bee881e3034b636d9f71c and fixed in 6.12.2 with commit 70777a23a54e359cfdfafc625a57cd56434f3859 Issue introduced in 4.18 with commit c96e6725db9d6a04ac1bee881e3034b636d9f71c and fixed in 6.13-rc1 with commit b7fc65f5141c24785dc8c19249ca4efcf71b3524 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-56698 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/dwc3/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/8ceb21d76426bbe7072cc3e43281e70c0d664cc7 https://git.kernel.org/stable/c/0247da93bf62d33304b7bf97850ebf2a86e06d28 https://git.kernel.org/stable/c/c9e72352a10ae89a430449f7bfeb043e75c255d9 https://git.kernel.org/stable/c/1534f6f69393aac773465d80d31801b554352627 https://git.kernel.org/stable/c/b7c3d0b59213ebeedff63d128728ce0b3d7a51ec https://git.kernel.org/stable/c/70777a23a54e359cfdfafc625a57cd56434f3859 https://git.kernel.org/stable/c/b7fc65f5141c24785dc8c19249ca4efcf71b3524