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 654A57DA7F for ; Tue, 5 Nov 2024 17:07:53 +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=1730826473; cv=none; b=Qr3kBBBWzMO2JhUPoJuwbCc9ISKHCOm6XGgp4i/JSILLm9Ajo/EQGlch8Sj+DsZhB7kKDuQJzMgLbTg1+meYqpDcLVl0nMk7Dqxk9CNOOk98ZkIGiQR4M5IGh8C9FPCT/aZPoLrV7SnYe+FoQvPITbs2HIdcR0G4Y3ds8izgAJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730826473; c=relaxed/simple; bh=wAvXbH+GDk1ojBKD8c3FC2vBQaQb+7G9BP/l0YX6jhQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KujshCCcwAuRzE5tQhrHlYcxIBvxloFYQs+ApfeSTwfr/vTBdaeCMWtD5Cknjl8eVnlNIk/uiCAAih1b/zkgJXybf31NjcxkcesWlf1V/AHmmlT7AcJ/ym2Q7vw9vge5LW+M5jph3aGq5J23szG9USa31sSvm9InmjKsgbcI2XQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FgswLkqH; 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="FgswLkqH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6095C4CECF; Tue, 5 Nov 2024 17:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730826473; bh=wAvXbH+GDk1ojBKD8c3FC2vBQaQb+7G9BP/l0YX6jhQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=FgswLkqHo8ooaDMwXzdHuq3yoE/aflihjSJG2kSdUzn2JasFEWEhBusNBdTn6CMds J3PNRYkVl1wNU9MxC9ykqeUXDwd051WN++9UfjDrbkVVfh2LM500m6GigCmoqqytwU tNIzS+mHeyarHi9Y+8C6kIox8HL6dz3bJ1Km0Axw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50100: USB: gadget: dummy-hcd: Fix "task hung" problem Date: Tue, 5 Nov 2024 18:07:29 +0100 Message-ID: <2024110526-CVE-2024-50100-be1f@gregkh> X-Mailer: git-send-email 2.47.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=2806; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wAvXbH+GDk1ojBKD8c3FC2vBQaQb+7G9BP/l0YX6jhQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlaAecezmnS0T7Qnbpoteh1BWN9DmsxXj+pabfFuyU3x J2bXZHYEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPpEmNYcOqx5fSMRrcpp8V3 RPwR35XUtjfmDcM8k3//WVKb1S4dSSh/JcQQyr8h8OYnAA== 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: dummy-hcd: Fix "task hung" problem The syzbot fuzzer has been encountering "task hung" problems ever since the dummy-hcd driver was changed to use hrtimers instead of regular timers. It turns out that the problems are caused by a subtle difference between the timer_pending() and hrtimer_active() APIs. The changeover blindly replaced the first by the second. However, timer_pending() returns True when the timer is queued but not when its callback is running, whereas hrtimer_active() returns True when the hrtimer is queued _or_ its callback is running. This difference occasionally caused dummy_urb_enqueue() to think that the callback routine had not yet started when in fact it was almost finished. As a result the hrtimer was not restarted, which made it impossible for the driver to dequeue later the URB that was just enqueued. This caused usb_kill_urb() to hang, and things got worse from there. Since hrtimers have no API for telling when they are queued and the callback isn't running, the driver must keep track of this for itself. That's what this patch does, adding a new "timer_pending" flag and setting or clearing it at the appropriate times. The Linux kernel CVE team has assigned CVE-2024-50100 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit a7f3813e589f and fixed in 6.11.5 with commit f828205ee3e4 Issue introduced in 6.10 with commit a7f3813e589f and fixed in 6.12-rc4 with commit 5189df7b8088 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-50100 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/udc/dummy_hcd.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/f828205ee3e4ddc712a13fba6c9902d51e91ddaf https://git.kernel.org/stable/c/5189df7b8088268012882c220d6aca4e64981348