From mboxrd@z Thu Jan 1 00:00:00 1970 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 B419020B04 for ; Thu, 22 Aug 2024 03:33: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=1724297596; cv=none; b=R2ndYlllrc66poGXQa8aoFffhEoG885bhvw3u+Y3qZVH4mxqNQoU+f7wMUlrYR2Svgl+R109G198vSQakPa8BpsuaxXMqV7cJUE44dxUzfVKZjbfx2mnJMqf1v5/Y+RhuEJ/97rU3SlMoN1xkqUXWTCsyd9V2re/1tQLVdRrPJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724297596; c=relaxed/simple; bh=FXgRduGu6gcyG37w+cQsgsK8xdG8sAQ2Cn8I3W/8euI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ANAGFDphcLBgQkXUsPPf+KP6b+PqU75vNeomo8ov4VOplq4v4QnPN7fD9NJUg5Hw5ijVM7n5uTe6SsEtxr7jGmWt6S3n2F3mUUQWmWhP7wXS79GTXswnxK4Doob550zcVpesyD/Ctp8puRbnlauLHpZwCzMx7SVrODA9fN/Xs90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NCPdK0Je; 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="NCPdK0Je" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EFD2C4AF0B; Thu, 22 Aug 2024 03:33:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724297596; bh=FXgRduGu6gcyG37w+cQsgsK8xdG8sAQ2Cn8I3W/8euI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=NCPdK0Je5SpAjN64gPj81tOlb0th4mhzrOsHJ4DKuNwLZ+C63yhmBJmXeVS2vTdlm da615ALVmNHqzQGkOFu3EXRR9pgiP4LuhG3/NrtmOxHxDL/NALRfzeExvWdNHIaAKD nFOzpjMo05ME7Z4jABE3W5qHvmxdycchE/HoHQ68= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48926: usb: gadget: rndis: add spinlock for rndis response list Date: Thu, 22 Aug 2024 11:31:27 +0800 Message-ID: <2024082220-CVE-2022-48926-e8ce@gregkh> X-Mailer: git-send-email 2.46.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=3986; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=FXgRduGu6gcyG37w+cQsgsK8xdG8sAQ2Cn8I3W/8euI=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnHNnI+e7110aoXXx5fTzmfEq1wW2F/jODp+Sq3vn+6d 7Sd6eDXoI5YFgZBJgZZMUWWL9t4ju6vOKToZWh7GmYOKxPIEAYuTgGYSGgsw1zxn6evtmSsqBQL WKubdfoA55L9XJUMCyan39fi00hz2s2+4zeT/K+7wkeCNwIA 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: gadget: rndis: add spinlock for rndis response list There's no lock for rndis response list. It could cause list corruption if there're two different list_add at the same time like below. It's better to add in rndis_add_response / rndis_free_response / rndis_get_next_response to prevent any race condition on response list. [ 361.894299] [1: irq/191-dwc3:16979] list_add corruption. next->prev should be prev (ffffff80651764d0), but was ffffff883dc36f80. (next=ffffff80651764d0). [ 361.904380] [1: irq/191-dwc3:16979] Call trace: [ 361.904391] [1: irq/191-dwc3:16979] __list_add_valid+0x74/0x90 [ 361.904401] [1: irq/191-dwc3:16979] rndis_msg_parser+0x168/0x8c0 [ 361.904409] [1: irq/191-dwc3:16979] rndis_command_complete+0x24/0x84 [ 361.904417] [1: irq/191-dwc3:16979] usb_gadget_giveback_request+0x20/0xe4 [ 361.904426] [1: irq/191-dwc3:16979] dwc3_gadget_giveback+0x44/0x60 [ 361.904434] [1: irq/191-dwc3:16979] dwc3_ep0_complete_data+0x1e8/0x3a0 [ 361.904442] [1: irq/191-dwc3:16979] dwc3_ep0_interrupt+0x29c/0x3dc [ 361.904450] [1: irq/191-dwc3:16979] dwc3_process_event_entry+0x78/0x6cc [ 361.904457] [1: irq/191-dwc3:16979] dwc3_process_event_buf+0xa0/0x1ec [ 361.904465] [1: irq/191-dwc3:16979] dwc3_thread_interrupt+0x34/0x5c The Linux kernel CVE team has assigned CVE-2022-48926 to this issue. Affected and fixed versions =========================== Issue introduced in 4.6 with commit f6281af9d62e and fixed in 4.9.304 with commit 9f5d8ba538ef Issue introduced in 4.6 with commit f6281af9d62e and fixed in 4.14.269 with commit 669c2b178956 Issue introduced in 4.6 with commit f6281af9d62e and fixed in 4.19.232 with commit 9f688aadede6 Issue introduced in 4.6 with commit f6281af9d62e and fixed in 5.4.182 with commit 9ab652d41dea Issue introduced in 4.6 with commit f6281af9d62e and fixed in 5.10.103 with commit 4ce247af3f30 Issue introduced in 4.6 with commit f6281af9d62e and fixed in 5.15.26 with commit da514063440b Issue introduced in 4.6 with commit f6281af9d62e and fixed in 5.16.12 with commit 33222d1571d7 Issue introduced in 4.6 with commit f6281af9d62e and fixed in 5.17 with commit aaaba1c86d04 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-48926 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/gadget/function/rndis.c drivers/usb/gadget/function/rndis.h 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/9f5d8ba538ef81cd86ea587ca3f8c77e26bea405 https://git.kernel.org/stable/c/669c2b178956718407af5631ccbc61c24413f038 https://git.kernel.org/stable/c/9f688aadede6b862a0a898792b1a35421c93636f https://git.kernel.org/stable/c/9ab652d41deab49848673c3dadb57ad338485376 https://git.kernel.org/stable/c/4ce247af3f30078d5b97554f1ae6200a0222c15a https://git.kernel.org/stable/c/da514063440b53a27309a4528b726f92c3cfe56f https://git.kernel.org/stable/c/33222d1571d7ce8c1c75f6b488f38968fa93d2d9 https://git.kernel.org/stable/c/aaaba1c86d04dac8e49bf508b492f81506257da3