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 EC00B3DE424 for ; Fri, 24 Apr 2026 14:44:33 +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=1777041874; cv=none; b=tMGduvIrKgExwQyofgBIC6voHyqna1ymix8vgRFTRd+2/n2R1kLDXczhwBU4m8oghZL41MQjpU+tFbBEGTXn+giUNUc8a1ZM0a40B929ZknSOvBTmqf4351NxOMq8frjNcakcN6QQ/jW+KjtGf0pn5Iwxs1mdKKBp0JVbpokP9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041874; c=relaxed/simple; bh=+uukA1oTMX0NFnmddwE14NUBv4nLbS/xn6NmpSSDYIM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LKKAoXC2JJCT4qRpZ4NkVtZ37UVtK+cCXNhTAlwBjx93Gl61PJU9YL8elYSgBohUBQ96RUlpCjZSh5IvQD5Egp6F7ifTjY2t7tZowKEXaf+Ac1pgr0RmNh2cGUj/xSJnokof0sxVV9g6n979HW185Od1lJ2rV9oNDAWObL5RvJw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JR1CqTsR; 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="JR1CqTsR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82BAFC19425; Fri, 24 Apr 2026 14:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777041873; bh=+uukA1oTMX0NFnmddwE14NUBv4nLbS/xn6NmpSSDYIM=; h=From:To:Cc:Subject:Date:Reply-To:From; b=JR1CqTsR1y2Ratsb0VZDU2z7Chulc1UUwfeHQ8EbZlDtxkMKrdb2RDVNxQeIK2+K3 OYCOTGUqAv0rI0xDmyUqKdCdJ8vG7A39svpH+AfHy+sa3ygvvQ6KHmjVI7+k08RCcr kjsJjJwSqqgBTkxuwjsCYfY5ScV+jf4x5//amu3Y= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31606: usb: gadget: f_hid: don't call cdev_init while cdev in use Date: Fri, 24 Apr 2026 16:43:42 +0200 Message-ID: <2026042420-CVE-2026-31606-baa6@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2336; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JoABjQSnkKDT3bWpHqlvFqTBEkLXlFqEO4y1AI/vpCo=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvGzsuiz5vu79vrV2tk7bzVuad2zbNvnG5YH7+5+3RS zbu4M6o7IhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJbCtgmF/5x3Kt3LWHEt7a HoYbdbiVP7zPVGeYZ7PR/Z/Lg1mC61j3x2v7uV1ye/huGgA= 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: gadget: f_hid: don't call cdev_init while cdev in use When calling unbind, then bind again, cdev_init reinitialized the cdev, even though there may still be references to it. That's the case when the /dev/hidg* device is still opened. This obviously unsafe behavior like oopes. This fixes this by using cdev_alloc to put the cdev on the heap. That way, we can simply allocate a new one in hidg_bind. The Linux kernel CVE team has assigned CVE-2026-31606 to this issue. Affected and fixed versions =========================== Fixed in 6.12.83 with commit c6c0d13db5d0f8d465eabc14bd23d2b6a7247a43 Fixed in 6.18.24 with commit eb6ef6185f2054a341ec70d7e2165f5381744215 Fixed in 6.19.14 with commit 5a229016ca3ac551294ec59770be9da94ec4bf63 Fixed in 7.0.1 with commit 75ecc46828ec377dd5692c677168ef6d64fd7123 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-2026-31606 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/f_hid.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/c6c0d13db5d0f8d465eabc14bd23d2b6a7247a43 https://git.kernel.org/stable/c/eb6ef6185f2054a341ec70d7e2165f5381744215 https://git.kernel.org/stable/c/5a229016ca3ac551294ec59770be9da94ec4bf63 https://git.kernel.org/stable/c/75ecc46828ec377dd5692c677168ef6d64fd7123 https://git.kernel.org/stable/c/81ebd43cc0d6d106ce7b6ccbf7b5e40ca7f5503d