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 992641FA272 for ; Mon, 21 Oct 2024 18:05: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=1729533955; cv=none; b=DGZ5AQH7F90mRrhyz360c6bYuBgIyn50IL+qQmf1g4vYPXbrmJ0yiY0Py8PSJZ7MkSFIzShEhpvETXnASbDZ8yO6yC4XSQmusVrXTq9A8CPY2F6ii/EbkjDwF8X6cT6zY5OvlImyotyJozwpMvr4GdAP8YxiBC4ymxtmNTbDINI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729533955; c=relaxed/simple; bh=6StRSEA3cQ57N8rHPeJTzmIWEHV9FheYeNlfomZvJX4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SGyTP/6gVUa04Yfc3hnNU7MSvRRfkoovUmUBLZwThyzA3qpA+ELro0OWrAhVK4Dzbgyi33uCaNUb1FO3ehUGBmIV9aJ9OIIz6F91NWkH5OXA80iqz4+Mf4BClvMlyC6PIuGXggcM/n06s+WBxUAMG3yOYSv6jpgxLpDWwVfkPtU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IjDIf0WJ; 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="IjDIf0WJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BC1AC4CEC3; Mon, 21 Oct 2024 18:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729533955; bh=6StRSEA3cQ57N8rHPeJTzmIWEHV9FheYeNlfomZvJX4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=IjDIf0WJrxQ+zBzDbIVDhp9nhuEQ3Ml9gwriLnvaAaIj0DX6lypXihI/6kHWQemXR qyq5evKpBW4rqaKTtGgXFZ8/L8nP3i3KjbIad4qVJhqpENy0pKjMNCHMBmMIsAG9q5 mhhLCLeLyCKv/9dctHJyr4DyelV8p1nWNXYwrgAc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49944: sctp: set sk_state back to CLOSED if autobind fails in sctp_listen_start Date: Mon, 21 Oct 2024 20:02:32 +0200 Message-ID: <2024102128-CVE-2024-49944-240a@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=3245; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=6StRSEA3cQ57N8rHPeJTzmIWEHV9FheYeNlfomZvJX4=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli034IPA5L3PxHKqeFdWvbe20/jhsHcn5Wnpv8e/GTR 6vL79m2dcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE7vozzNPS+/Wdm8mQfWPY r/Oz/+iVP77Bbs0wz/TumtAgd+eejZFbowVmF61YcEv9JwA= 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: sctp: set sk_state back to CLOSED if autobind fails in sctp_listen_start In sctp_listen_start() invoked by sctp_inet_listen(), it should set the sk_state back to CLOSED if sctp_autobind() fails due to whatever reason. Otherwise, next time when calling sctp_inet_listen(), if sctp_sk(sk)->reuse is already set via setsockopt(SCTP_REUSE_PORT), sctp_sk(sk)->bind_hash will be dereferenced as sk_state is LISTENING, which causes a crash as bind_hash is NULL. KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:sctp_inet_listen+0x7f0/0xa20 net/sctp/socket.c:8617 Call Trace: __sys_listen_socket net/socket.c:1883 [inline] __sys_listen+0x1b7/0x230 net/socket.c:1894 __do_sys_listen net/socket.c:1902 [inline] The Linux kernel CVE team has assigned CVE-2024-49944 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.30 with commit 5e8f3f703ae4 and fixed in 5.10.227 with commit dd70c8a89ef9 Issue introduced in 2.6.30 with commit 5e8f3f703ae4 and fixed in 5.15.168 with commit e7a8442195e8 Issue introduced in 2.6.30 with commit 5e8f3f703ae4 and fixed in 6.1.113 with commit 9230a59eda08 Issue introduced in 2.6.30 with commit 5e8f3f703ae4 and fixed in 6.6.55 with commit 7f64cb5b4d8c Issue introduced in 2.6.30 with commit 5e8f3f703ae4 and fixed in 6.10.14 with commit f032e1dac30b Issue introduced in 2.6.30 with commit 5e8f3f703ae4 and fixed in 6.11.3 with commit e914bf68dab8 Issue introduced in 2.6.30 with commit 5e8f3f703ae4 and fixed in 6.12-rc2 with commit 8beee4d8dee7 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-49944 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/sctp/socket.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/dd70c8a89ef99c3d53127fe19e51ef47c3f860fa https://git.kernel.org/stable/c/e7a8442195e8ebd97df467ce4742980ab57edcce https://git.kernel.org/stable/c/9230a59eda0878d7ecaa901d876aec76f57bd455 https://git.kernel.org/stable/c/7f64cb5b4d8c872296eda0fdce3bcf099eec7aa7 https://git.kernel.org/stable/c/f032e1dac30b3376c7d6026fb01a8c403c47a80d https://git.kernel.org/stable/c/e914bf68dab88815a7ae7b7a3a5e8913c8ff14a5 https://git.kernel.org/stable/c/8beee4d8dee76b67c75dc91fd8185d91e845c160