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 5DFA2149C6D for ; Wed, 3 Apr 2024 14:58:16 +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=1712156296; cv=none; b=XV4PXxiuof6d4rKdnWlyA1ETDnbaPDWuCGAU7ssX46iiALzAwbSK7LvV2+EIotrScHVLcNFRWKdwpdZhEe4SflCDHiQ5OEVpWoXFIcR1zBIkFWs2g1B0cL9y/Oj9U8/V+k7Pd8UzOp4NKaMNYzmWUNpAp7rCr1tBoX7VfUaaCu8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156296; c=relaxed/simple; bh=GCZsUB19B8sn57O/R8FEYsi8SLTEC2I+XEax2Pag05A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XiQJYSzPamdGn4bpL50OvGOBtcd+gX0X/X/yCAx6Ugg1Q9lB7i2LJ8532KMXrQgYNtVwfw6LrWKLMxGjqlhYPyOg776V0cYqxz4maO0dGv98913OjmrUKN6PejH8DdEB6WMVLZQv9MTT4YvQP9GBswDxqzJJa5+uLUka/lQYIhg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=F1eVttUO; 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="F1eVttUO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF5EEC433F1; Wed, 3 Apr 2024 14:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712156296; bh=GCZsUB19B8sn57O/R8FEYsi8SLTEC2I+XEax2Pag05A=; h=From:To:Cc:Subject:Date:Reply-to:From; b=F1eVttUOUF4iitdEMWUAGwiLbRiqRRccAHhQebKzYa1coJSOJ65J4G0zNd47uG0az 5h5z0QUcouP7OfxyVjYF7EW7Ys2vFnA4q5y5Vg207KEJhOwZIj3/v6FsY8Vl8udlM1 oBmx46rCoAidotUsSr26hE/KbBYMubNrKUmaitS4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26715: usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend Date: Wed, 3 Apr 2024 16:56:06 +0200 Message-ID: <2024040343-CVE-2024-26715-20ed@gregkh> X-Mailer: git-send-email 2.44.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=3148; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GCZsUB19B8sn57O/R8FEYsi8SLTEC2I+XEax2Pag05A=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm8ue93bdyYcenLegYl/njH91P7NjhLeazf/djgCMPXF dWcRq9vd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBETsxhmCs1+8Nz63qb6kiO qQJTjrG9Y3HRk2JYsGjD9Nea1620mbIqV4lwu/2W9PO6DQA= 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 NULL pointer dereference in dwc3_gadget_suspend In current scenario if Plug-out and Plug-In performed continuously there could be a chance while checking for dwc->gadget_driver in dwc3_gadget_suspend, a NULL pointer dereference may occur. Call Stack: CPU1: CPU2: gadget_unbind_driver dwc3_suspend_common dwc3_gadget_stop dwc3_gadget_suspend dwc3_disconnect_gadget CPU1 basically clears the variable and CPU2 checks the variable. Consider CPU1 is running and right before gadget_driver is cleared and in parallel CPU2 executes dwc3_gadget_suspend where it finds dwc->gadget_driver which is not NULL and resumes execution and then CPU1 completes execution. CPU2 executes dwc3_disconnect_gadget where it checks dwc->gadget_driver is already NULL because of which the NULL pointer deference occur. The Linux kernel CVE team has assigned CVE-2024-26715 to this issue. Affected and fixed versions =========================== Issue introduced in 4.6 with commit 9772b47a4c29 and fixed in 5.15.149 with commit 88936ceab6b4 Issue introduced in 4.6 with commit 9772b47a4c29 and fixed in 6.1.79 with commit 57e2e42ccd3c Issue introduced in 4.6 with commit 9772b47a4c29 and fixed in 6.6.18 with commit c7ebd8149ee5 Issue introduced in 4.6 with commit 9772b47a4c29 and fixed in 6.7.6 with commit 36695d5eeeef Issue introduced in 4.6 with commit 9772b47a4c29 and fixed in 6.8 with commit 61a348857e86 Issue introduced in 3.16.81 with commit 8cca5c85393a Issue introduced in 4.4.178 with commit df2ca3271569 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-26715 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/88936ceab6b426f1312327e9ef849c215c6007a7 https://git.kernel.org/stable/c/57e2e42ccd3cd6183228269715ed032f44536751 https://git.kernel.org/stable/c/c7ebd8149ee519d27232e6e4940e9c02071b568b https://git.kernel.org/stable/c/36695d5eeeefe5a64b47d0336e7c8fc144e78182 https://git.kernel.org/stable/c/61a348857e869432e6a920ad8ea9132e8d44c316