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 E60D73BBE9 for ; Fri, 29 Mar 2024 09:13:55 +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=1711703636; cv=none; b=F5BS7LOOM0TxAZ31PHB2v7P6PpGp4ITFtBmXdqP7W2AA8nLakk/XBsuMyb2KItg8n8MT/7dPTQ3CxVqS+JLitlj8gSXsP+/PlJxEh3HNago4tb4BmRdzv2IzDbVqddaq+CDfjlu8cGZHxjjg0U+AnJFXJpwISij2or+HI/Yse2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711703636; c=relaxed/simple; bh=qG2zCY46Uz7u/IJy2GTXiFsICC6dQw0wnp96YS8YgDg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=W6cWk2RbC2PVNduwnEpIF06Y24kv2zitEFm4JOPKuLxZtoMOgh8MeSCqrZherab6bL50oIQdFs7/3DVp02QqpTzr6DfHPB/LTm4uzHQfAd0TxBVcLAt1n6VFgwpGbtp19Rhf7YtBoJwM64P5RqOTFKjK6T050RxqyWdGF4pYS5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ybFsNzk7; 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="ybFsNzk7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E991C43390; Fri, 29 Mar 2024 09:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711703635; bh=qG2zCY46Uz7u/IJy2GTXiFsICC6dQw0wnp96YS8YgDg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ybFsNzk7llP3YsCk7U2Ye2NWDT4UfVafrVMg1Vk9JHifaVPXnIbkl9tg+1zL3WZUS q78EsIV2Y/s0DLdnrSEhZp3A9qkUxDLvryfBFXZl3LsxSS/mMV2kZ6KI3tuQ9nrKgA Gg/VHw3Z8ULP/i4p2SA4gSHdsca2elp/ohABUPRg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52629: sh: push-switch: Reorder cleanup operations to avoid use-after-free bug Date: Fri, 29 Mar 2024 10:13:50 +0100 Message-ID: <2024032949-CVE-2023-52629-a508@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=2552; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qG2zCY46Uz7u/IJy2GTXiFsICC6dQw0wnp96YS8YgDg=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlsbb6HfzwUmf3yv0nzpnuSwZ9dP19xd76bya2X6fVdX HSziHdzRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEwkWodhfpHT66Xy3RGWzj4t FTNC+Jcwem8IY1jQmNDvbyRf+MtKZlHM/0mvGPdwrtcBAA== 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: sh: push-switch: Reorder cleanup operations to avoid use-after-free bug The original code puts flush_work() before timer_shutdown_sync() in switch_drv_remove(). Although we use flush_work() to stop the worker, it could be rescheduled in switch_timer(). As a result, a use-after-free bug can occur. The details are shown below: (cpu 0) | (cpu 1) switch_drv_remove() | flush_work() | ... | switch_timer // timer | schedule_work(&psw->work) timer_shutdown_sync() | ... | switch_work_handler // worker kfree(psw) // free | | psw->state = 0 // use This patch puts timer_shutdown_sync() before flush_work() to mitigate the bugs. As a result, the worker and timer will be stopped safely before the deallocate operations. The Linux kernel CVE team has assigned CVE-2023-52629 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.20 with commit 9f5e8eee5cfe and fixed in 6.5.4 with commit 610dbd8ac271 Issue introduced in 2.6.20 with commit 9f5e8eee5cfe and fixed in 6.6 with commit 246f80a0b17f 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-2023-52629 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: arch/sh/drivers/push-switch.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/610dbd8ac271aa36080aac50b928d700ee3fe4de https://git.kernel.org/stable/c/246f80a0b17f8f582b2c0996db02998239057c65