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 28CF11F706E for ; Fri, 27 Dec 2024 15:08:18 +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=1735312098; cv=none; b=FS4cYMig1fLuZGmY2dKZHt//ZGqfN0MhXLx2RsSxfHzF5Q0Udov+X87xq1nMZseBJ+Kc7JBg40+I5IeRppiZ3uDM/8vPx+NLx1mT1BVWSQo48ZRbrWvmFMmDyB5jo9jDuca9OyMPpsoPxN68Ko5oLBBng1yzmkH+ux0Trb8zuf0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735312098; c=relaxed/simple; bh=cNok7jma8N9jMNFRVKfYI3AirnhPfo9v5xErX9E90Nk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WNAPJekKQ3O/hQZ2VuyJ7CoUWRp9aEYG4hIcSKr4P0Rk8TvzYRFHkQk0Q4/hpuurY4ip9SMDn0+W6pKWlTclmiZ64/xQqLozhNdW5zgxwCN2QNafJ3VwUh6NIGgIoUULYENxFuFtN8WYHvnJJYH1g5LXHg/Zjkn9FYJg4bRvv1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jCJps/u4; 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="jCJps/u4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B0EDC4CED0; Fri, 27 Dec 2024 15:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735312098; bh=cNok7jma8N9jMNFRVKfYI3AirnhPfo9v5xErX9E90Nk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jCJps/u4zpfQDATF/S8A/x4eY+grBaZRqzqg5YBOHQKy+jrmmzeSgAm4k305Lvwzt NGQFDGQU+0DY4KCr7Oi9SC0eXDXrK9ULI7mADGkpl4GUzLQIxwEEx6YFOOOm6ruDat whzduxj9cLPWPl1mf+qCwNPI7tSFvoBHqpgiNbHA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56661: tipc: fix NULL deref in cleanup_bearer() Date: Fri, 27 Dec 2024 16:06:58 +0100 Message-ID: <2024122751-CVE-2024-56661-a403@gregkh> X-Mailer: git-send-email 2.47.1 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=4635; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=cNok7jma8N9jMNFRVKfYI3AirnhPfo9v5xErX9E90Nk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5h3p8llqbWt956PE4sismIHiHplq+ZZKSgRX/890aE RvzJOZ0xLIwCDIxyIopsnzZxnN0f8UhRS9D29Mwc1iZQIYwcHEKwET2vmKY75Nn+yZ1t3q/3jnp 3zujljRtjLScyzA/z3+7FVffwfoWNZ+sk9e/vpjGHM0BAA== 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: fix NULL deref in cleanup_bearer() syzbot found [1] that after blamed commit, ub->ubsock->sk was NULL when attempting the atomic_dec() : atomic_dec(&tipc_net(sock_net(ub->ubsock->sk))->wq_count); Fix this by caching the tipc_net pointer. [1] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] CPU: 0 UID: 0 PID: 5896 Comm: kworker/0:3 Not tainted 6.13.0-rc1-next-20241203-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events cleanup_bearer RIP: 0010:read_pnet include/net/net_namespace.h:387 [inline] RIP: 0010:sock_net include/net/sock.h:655 [inline] RIP: 0010:cleanup_bearer+0x1f7/0x280 net/tipc/udp_media.c:820 Code: 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 3c f7 99 f6 48 8b 1b 48 83 c3 30 e8 f0 e4 60 00 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 df e8 1a f7 99 f6 49 83 c7 e8 48 8b 1b RSP: 0018:ffffc9000410fb70 EFLAGS: 00010206 RAX: 0000000000000006 RBX: 0000000000000030 RCX: ffff88802fe45a00 RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffc9000410f900 RBP: ffff88807e1f0908 R08: ffffc9000410f907 R09: 1ffff92000821f20 R10: dffffc0000000000 R11: fffff52000821f21 R12: ffff888031d19980 R13: dffffc0000000000 R14: dffffc0000000000 R15: ffff88807e1f0918 FS: 0000000000000000(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556ca050b000 CR3: 0000000031c0c000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 The Linux kernel CVE team has assigned CVE-2024-56661 to this issue. Affected and fixed versions =========================== Issue introduced in 5.4.287 with commit 4e69457f9dfae67435f3ccf29008768eae860415 and fixed in 5.4.288 with commit d1d4dfb189a115734bff81c411bc58d9e348db7d Issue introduced in 5.10.231 with commit 650ee9a22d7a2de8999fac2d45983597a0c22359 and fixed in 5.10.232 with commit a771f349c95d3397636861a0a6462d4a7a7ecb25 Issue introduced in 5.15.174 with commit d2a4894f238551eae178904e7f45af87577074fd and fixed in 5.15.175 with commit 07b569eda6fe6a1e83be5a587abee12d1303f95e Issue introduced in 6.1.120 with commit d62d5180c036eeac09f80660edc7a602b369125f and fixed in 6.1.121 with commit 754ec823ee53422361da7958a8c8bf3275426912 Issue introduced in 6.6.66 with commit d00d4470bf8c4282617a3a10e76b20a9c7e4cffa and fixed in 6.6.67 with commit 89ecda492d0a37fd00aaffc4151f1f44c26d93ac Issue introduced in 6.12.5 with commit e48b211c4c59062cb6dd6c2c37c51a7cc235a464 and fixed in 6.12.6 with commit a852c82eda4991e21610837aaa160965be71f5cc Issue introduced in 6.13-rc2 with commit 6a2fa13312e51a621f652d522d7e2df7066330b6 and fixed in 6.13-rc3 with commit b04d86fff66b15c07505d226431f808c15b1703c 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-56661 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/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/d1d4dfb189a115734bff81c411bc58d9e348db7d https://git.kernel.org/stable/c/a771f349c95d3397636861a0a6462d4a7a7ecb25 https://git.kernel.org/stable/c/07b569eda6fe6a1e83be5a587abee12d1303f95e https://git.kernel.org/stable/c/754ec823ee53422361da7958a8c8bf3275426912 https://git.kernel.org/stable/c/89ecda492d0a37fd00aaffc4151f1f44c26d93ac https://git.kernel.org/stable/c/a852c82eda4991e21610837aaa160965be71f5cc https://git.kernel.org/stable/c/b04d86fff66b15c07505d226431f808c15b1703c