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 1BB4C2459DB for ; Wed, 15 Jan 2025 13:06:57 +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=1736946418; cv=none; b=L3+/eK5n+y410AF0DV3Jw4yHKooc7yh42MIUQauY3p8twLKgp0RATEuC9TTBI9DKL9J+W11z1fZtOsJt1qzK7n2OxBU89bNopV8k2qZqW2/dIRNhyvz7UyZ6wYvH1KO+JiZqesPZgtd/79rZuMKGBWklIfVbrRxOsJsosx7czSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736946418; c=relaxed/simple; bh=hKlsxTEkeiOruy2n+R+wThIA1wV3csz3lHIQ1ay2ahY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d5b1jE9MJLYuV+4p7QvtciOEBS1p9i7p701XL1GBtmTRrgkKgDWG5q3VoBiEXvOxJcTXvDpx/SuDCVZa25VJsSG45oi2HvgNBYf4GZWDGEqJGbdy9Q57OCRiB05sSGWnpXPfiO5otl/+HMjB5AAxmCTEHhWJfDRo5yHgE5A24cU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HvOiVHpz; 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="HvOiVHpz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36CA8C4CEDF; Wed, 15 Jan 2025 13:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736946417; bh=hKlsxTEkeiOruy2n+R+wThIA1wV3csz3lHIQ1ay2ahY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HvOiVHpz/O5s+vdLujRxkkkjCJ1bO3OZOZYec/XSSuvQD1hTcdchM7eccrV4C2ISj cgFXeg7cG98+OYRrxHKL48beKraMmHp+BD29iw/5w9U5HRztJSyaG62da5kqn1qe75 Tqf8Nxn/R6mf+z8OF2K9FFddpfcU6vBxX1R7S5vA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-57888: workqueue: Do not warn when cancelling WQ_MEM_RECLAIM work from !WQ_MEM_RECLAIM worker Date: Wed, 15 Jan 2025 14:06:11 +0100 Message-ID: <2025011511-CVE-2024-57888-0b38@gregkh> X-Mailer: git-send-email 2.48.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=3287; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hKlsxTEkeiOruy2n+R+wThIA1wV3csz3lHIQ1ay2ahY=; b=owGbwMvMwCRo6H6F97bub03G02pJDOntm44oZt9+1xFVKaMp8DdkV8zTihcbi7V6XnacOxnlP 5vJSUSvI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbSd41hwfK1T9z9Xga2Kzf/ l09uyJp7NWPZDIb50SWfunaGLfL5wcog49oTEfrHkPkOAA== 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: workqueue: Do not warn when cancelling WQ_MEM_RECLAIM work from !WQ_MEM_RECLAIM worker After commit 746ae46c1113 ("drm/sched: Mark scheduler work queues with WQ_MEM_RECLAIM") amdgpu started seeing the following warning: [ ] workqueue: WQ_MEM_RECLAIM sdma0:drm_sched_run_job_work [gpu_sched] is flushing !WQ_MEM_RECLAIM events:amdgpu_device_delay_enable_gfx_off [amdgpu] ... [ ] Workqueue: sdma0 drm_sched_run_job_work [gpu_sched] ... [ ] Call Trace: [ ] ... [ ] ? check_flush_dependency+0xf5/0x110 ... [ ] cancel_delayed_work_sync+0x6e/0x80 [ ] amdgpu_gfx_off_ctrl+0xab/0x140 [amdgpu] [ ] amdgpu_ring_alloc+0x40/0x50 [amdgpu] [ ] amdgpu_ib_schedule+0xf4/0x810 [amdgpu] [ ] ? drm_sched_run_job_work+0x22c/0x430 [gpu_sched] [ ] amdgpu_job_run+0xaa/0x1f0 [amdgpu] [ ] drm_sched_run_job_work+0x257/0x430 [gpu_sched] [ ] process_one_work+0x217/0x720 ... [ ] The intent of the verifcation done in check_flush_depedency is to ensure forward progress during memory reclaim, by flagging cases when either a memory reclaim process, or a memory reclaim work item is flushed from a context not marked as memory reclaim safe. This is correct when flushing, but when called from the cancel(_delayed)_work_sync() paths it is a false positive because work is either already running, or will not be running at all. Therefore cancelling it is safe and we can relax the warning criteria by letting the helper know of the calling context. References: 746ae46c1113 ("drm/sched: Mark scheduler work queues with WQ_MEM_RECLAIM") The Linux kernel CVE team has assigned CVE-2024-57888 to this issue. Affected and fixed versions =========================== Issue introduced in 4.5 with commit fca839c00a12d682cb59b3b620d109a1d850b262 and fixed in 6.12.9 with commit ffb231471a407c96e114070bf828cd2378fdf431 Issue introduced in 4.5 with commit fca839c00a12d682cb59b3b620d109a1d850b262 and fixed in 6.13-rc6 with commit de35994ecd2dd6148ab5a6c5050a1670a04dec77 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-57888 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: kernel/workqueue.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/ffb231471a407c96e114070bf828cd2378fdf431 https://git.kernel.org/stable/c/de35994ecd2dd6148ab5a6c5050a1670a04dec77