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 054BC239E9A for ; Sat, 4 Oct 2025 07:34:08 +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=1759563248; cv=none; b=OAhUNpYZB56/gy1/0ipIEjsYxz8hvsCF9oGrREgrRdGtjnnIso/+1I1bg2TmaTc81rgDNw9Vqs+ysGvuMiLoEFP/5kDByn7GzkKYDx/1CJhO4SyeOh53dBeQLY/y+XaehkrMcQSAikDPyKyzPixo79e/idO67s7adDxv/RlnF+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759563248; c=relaxed/simple; bh=x1W/NnvnqOkOBCFpJis+3t8idR2f77Q1Sx+8AAbQHqo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IXsohPDg7dkfzchGSNb6AI3DSLLz2BPVJldi4NxBNr63OvidAZX2Zab1hDl9aNDAi6gp+DmhnhlcI5e3VG+5cZyXggRgF+CoNqbx7fjtBBjJH0dr6W+YUovha86YdLe6pzE0djXMGN+VsQNLSjHG0FW3hEXjT1RZiXFoV14cD94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nrLA8gFW; 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="nrLA8gFW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79517C4CEF1; Sat, 4 Oct 2025 07:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759563247; bh=x1W/NnvnqOkOBCFpJis+3t8idR2f77Q1Sx+8AAbQHqo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=nrLA8gFW3mbFwyaHJ7ohc8CX6ZYe7X1PuXoQDzozYTjkStyPzfjJltdAmKHt9Tjnk Okp67LPgrNkT5jxaxdqQpRP7tCpSGwgfriK1ZaEJ+LuJzjvdqBJHP4V6SsSJmb3SRr gyglm3wurA6XJQ14WPD8TVx0y0hu2DZ5X7xZlO2Q= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39950: net/tcp: Fix a NULL pointer dereference when using TCP-AO with TCP_REPAIR Date: Sat, 4 Oct 2025 09:33:34 +0200 Message-ID: <2025100420-CVE-2025-39950-e7d6@gregkh> X-Mailer: git-send-email 2.51.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=3709; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=trvskZ2DP5WQYhH0gd4WuL1kNWmCfFno+lpHHQtysm8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkPzh5I+pv1tS/9khjr26Yrk342L1vQO8/rx/Sa3QtVw g/06caJdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE7P8yLFhq/+BJ8pQH8eus vW5s0omy3yW3gY1hflHD/YnP9UIzqhx+blw3OV+3VGWxOwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net/tcp: Fix a NULL pointer dereference when using TCP-AO with TCP_REPAIR A NULL pointer dereference can occur in tcp_ao_finish_connect() during a connect() system call on a socket with a TCP-AO key added and TCP_REPAIR enabled. The function is called with skb being NULL and attempts to dereference it on tcp_hdr(skb)->seq without a prior skb validation. Fix this by checking if skb is NULL before dereferencing it. The commentary is taken from bpf_skops_established(), which is also called in the same flow. Unlike the function being patched, bpf_skops_established() validates the skb before dereferencing it. int main(void){ struct sockaddr_in sockaddr; struct tcp_ao_add tcp_ao; int sk; int one = 1; memset(&sockaddr,'\0',sizeof(sockaddr)); memset(&tcp_ao,'\0',sizeof(tcp_ao)); sk = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); sockaddr.sin_family = AF_INET; memcpy(tcp_ao.alg_name,"cmac(aes128)",12); memcpy(tcp_ao.key,"ABCDEFGHABCDEFGH",16); tcp_ao.keylen = 16; memcpy(&tcp_ao.addr,&sockaddr,sizeof(sockaddr)); setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &tcp_ao, sizeof(tcp_ao)); setsockopt(sk, IPPROTO_TCP, TCP_REPAIR, &one, sizeof(one)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htobe16(123); inet_aton("127.0.0.1", &sockaddr.sin_addr); connect(sk,(struct sockaddr *)&sockaddr,sizeof(sockaddr)); return 0; } $ gcc tcp-ao-nullptr.c -o tcp-ao-nullptr -Wall $ unshare -Urn BUG: kernel NULL pointer dereference, address: 00000000000000b6 PGD 1f648d067 P4D 1f648d067 PUD 1982e8067 PMD 0 Oops: Oops: 0000 [#1] SMP NOPTI Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 RIP: 0010:tcp_ao_finish_connect (net/ipv4/tcp_ao.c:1182) The Linux kernel CVE team has assigned CVE-2025-39950 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 7c2ffaf21bd67f73d21560995ce17eaf5fc1d37f and fixed in 6.12.49 with commit 5f445eb259906b61a518487a790e11d07d31738c Issue introduced in 6.7 with commit 7c2ffaf21bd67f73d21560995ce17eaf5fc1d37f and fixed in 6.16.9 with commit 993b734d31ab804747ac961b1ee664b023c3b5fa Issue introduced in 6.7 with commit 7c2ffaf21bd67f73d21560995ce17eaf5fc1d37f and fixed in 6.17 with commit 2e7bba08923ebc675b1f0e0e0959e68e53047838 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-2025-39950 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/ipv4/tcp_ao.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/5f445eb259906b61a518487a790e11d07d31738c https://git.kernel.org/stable/c/993b734d31ab804747ac961b1ee664b023c3b5fa https://git.kernel.org/stable/c/2e7bba08923ebc675b1f0e0e0959e68e53047838