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 DAA1317C6C7 for ; Mon, 25 Mar 2024 09:17:47 +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=1711358267; cv=none; b=b9OMCXHS51/KHoTZ2D8UnjEUsxnvPcPI8Eso+pIlYxxqAkV3ElZykqm4XCzvEX8UV2CBfTbdmQMJ6pr/BPI9xMq0VRLJXrROD3sDvkB7yLEEOOx6nWysjSMEfVMhs46cH53qSdrFR827g8DRIf04bqPUoeBwjPm+oJ2RW7qsWNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711358267; c=relaxed/simple; bh=hFpDtmRvOtpqvOlVRGh75xTao9WCgAIx3vkPB7bH4ys=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=juTx9xKZr8GTImTJZcs5c0UXXX41vKn77Y8H3smqUUXWwHQczzNLpaNhfjHrJGOuUEpKBEhxiI7qsYbxoCOJMTQqsoFYURgMliWaZ3iaOAx4lLynxC8e9KcACWTdIazXhrbFRNVrO+eN/0of1Qh+wsHjaDwHo42ugJz0VIeF2Xo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XnMAtUyE; 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="XnMAtUyE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6100EC43394; Mon, 25 Mar 2024 09:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711358267; bh=hFpDtmRvOtpqvOlVRGh75xTao9WCgAIx3vkPB7bH4ys=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XnMAtUyE8mKWRxeTSW1gPJtUbt/GXf4foKMR5om5DDb8BwYCL3iuUIKuxSJAbhEHm DAOf0eMGLRyWot1MpOkyu+xdh8O+ilq/FZG6yDpXtMb90j7RSfRJ+2IElKokRmASxw iKMyY0H0VEcPZt2Q4BcIhuhZH06l/chPRfycahJ4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47163: tipc: wait and exit until all work queues are done Date: Mon, 25 Mar 2024 10:16:39 +0100 Message-ID: <2024032534-CVE-2021-47163-3ab9@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=3070; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hFpDtmRvOtpqvOlVRGh75xTao9WCgAIx3vkPB7bH4ys=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmMDp9L936dW/xBIXXpm9g/Ajc+rnjeqqYpLxd9wmX14 r0aDPkbOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiH0UY5vvda0l/ujX05aqG OzcW3FmSE2WpvYBhwelHsX8bGS05mv9+dQ8T2mT4qPzvSgA= 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: tipc: wait and exit until all work queues are done On some host, a crash could be triggered simply by repeating these commands several times: # modprobe tipc # tipc bearer enable media udp name UDP1 localip 127.0.0.1 # rmmod tipc [] BUG: unable to handle kernel paging request at ffffffffc096bb00 [] Workqueue: events 0xffffffffc096bb00 [] Call Trace: [] ? process_one_work+0x1a7/0x360 [] ? worker_thread+0x30/0x390 [] ? create_worker+0x1a0/0x1a0 [] ? kthread+0x116/0x130 [] ? kthread_flush_work_fn+0x10/0x10 [] ? ret_from_fork+0x35/0x40 When removing the TIPC module, the UDP tunnel sock will be delayed to release in a work queue as sock_release() can't be done in rtnl_lock(). If the work queue is schedule to run after the TIPC module is removed, kernel will crash as the work queue function cleanup_beareri() code no longer exists when trying to invoke it. To fix it, this patch introduce a member wq_count in tipc_net to track the numbers of work queues in schedule, and wait and exit until all work queues are done in tipc_exit_net(). The Linux kernel CVE team has assigned CVE-2021-47163 to this issue. Affected and fixed versions =========================== Issue introduced in 4.1 with commit d0f91938bede and fixed in 5.4.124 with commit d1f76dfadaf8 Issue introduced in 4.1 with commit d0f91938bede and fixed in 5.10.42 with commit 5195ec5e365a Issue introduced in 4.1 with commit d0f91938bede and fixed in 5.12.9 with commit b9f5b7ad4ac3 Issue introduced in 4.1 with commit d0f91938bede and fixed in 5.13 with commit 04c26faa51d1 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-2021-47163 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: net/tipc/core.c net/tipc/core.h net/tipc/udp_media.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/d1f76dfadaf8f47ed1753f97dbcbd41c16215ffa https://git.kernel.org/stable/c/5195ec5e365a2a9331bfeb585b613a6e94f98dba https://git.kernel.org/stable/c/b9f5b7ad4ac3af006443f535b1ce7bff1d130d7d https://git.kernel.org/stable/c/04c26faa51d1e2fe71cf13c45791f5174c37f986