Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2215856/?format=api
{ "id": 2215856, "url": "http://patchwork.ozlabs.org/api/patches/2215856/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-14-fw@strlen.de/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/projects/26/?format=api", "name": "Netfilter Development", "link_name": "netfilter-devel", "list_id": "netfilter-devel.vger.kernel.org", "list_email": "netfilter-devel@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260325131108.23045-14-fw@strlen.de>", "list_archive_url": null, "date": "2026-03-25T13:11:07", "name": "[net,13/14] netfilter: nf_conntrack_sip: fix use of uninitialized rtp_addr in process_sdp", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": true, "hash": "7f89c131c0095f592ad2fa31b35d3f75bcc9672f", "submitter": { "id": 1025, "url": "http://patchwork.ozlabs.org/api/people/1025/?format=api", "name": "Florian Westphal", "email": "fw@strlen.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-14-fw@strlen.de/mbox/", "series": [ { "id": 497441, "url": "http://patchwork.ozlabs.org/api/series/497441/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=497441", "date": "2026-03-25T13:10:55", "name": "[net,01/14] netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497441/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2215856/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2215856/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-11407-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "netfilter-devel@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11407-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.216.245.30", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc" ], "Received": [ "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgnqN1mq9z1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 00:31:12 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 08BCD31770F5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 13:14:13 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id EDFA73DD515;\n\tWed, 25 Mar 2026 13:12:32 +0000 (UTC)", "from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc\n [91.216.245.30])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 768593DA7E3;\n\tWed, 25 Mar 2026 13:12:31 +0000 (UTC)", "by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)\n\tid 133FC60AF9; Wed, 25 Mar 2026 14:12:30 +0100 (CET)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774444352; cv=none;\n b=KT1Of02ZddlrdposC1VXq8RRyr5rZrn+eSGSc+vmw88YqmoX/fBLF7nhIayKpcBQM8OC6XiROvbgUa2UUzczGbRhyHokh6rJZL+QUUm+4CEFTYU/304CLPa+KeLsTIQmhEvHWNfUfn4oIZ2+1LlyaYq1A4iwqSbdJOp9tlLrRAc=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774444352; c=relaxed/simple;\n\tbh=UiqHFT0kt119Q4NorbM1nwW//HNGPA2WXqHtJiZSuUE=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=GAC3DvN9AGBeDkaoKx8OSSj6Z8hsanHpQJlUhsphtnpf3vLl9HA3RQCdno1taEXox+aO44Rz7bXDh7SOmgLwZnLxlEmCY2PzdGmtV0uFJqnuuCi+zaUcTB9XkIyQWHRNH/yd7jnPsd5mpJ5S14pmBNMYJ6a2TvMcl6jQ+MQMuMg=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc;\n arc=none smtp.client-ip=91.216.245.30", "From": "Florian Westphal <fw@strlen.de>", "To": "<netdev@vger.kernel.org>", "Cc": "Paolo Abeni <pabeni@redhat.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tEric Dumazet <edumazet@google.com>,\n\tJakub Kicinski <kuba@kernel.org>,\n\t<netfilter-devel@vger.kernel.org>,\n\tpablo@netfilter.org", "Subject": "[PATCH net 13/14] netfilter: nf_conntrack_sip: fix use of\n uninitialized rtp_addr in process_sdp", "Date": "Wed, 25 Mar 2026 14:11:07 +0100", "Message-ID": "<20260325131108.23045-14-fw@strlen.de>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260325131108.23045-1-fw@strlen.de>", "References": "<20260325131108.23045-1-fw@strlen.de>", "Precedence": "bulk", "X-Mailing-List": "netfilter-devel@vger.kernel.org", "List-Id": "<netfilter-devel.vger.kernel.org>", "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "From: Weiming Shi <bestswngs@gmail.com>\n\nprocess_sdp() declares union nf_inet_addr rtp_addr on the stack and\npasses it to the nf_nat_sip sdp_session hook after walking the SDP\nmedia descriptions. However rtp_addr is only initialized inside the\nmedia loop when a recognized media type with a non-zero port is found.\n\nIf the SDP body contains no m= lines, only inactive media sections\n(m=audio 0 ...) or only unrecognized media types, rtp_addr is never\nassigned. Despite that, the function still calls hooks->sdp_session()\nwith &rtp_addr, causing nf_nat_sdp_session() to format the stale stack\nvalue as an IP address and rewrite the SDP session owner and connection\nlines with it.\n\nWith CONFIG_INIT_STACK_ALL_ZERO (default on most distributions) this\nresults in the session-level o= and c= addresses being rewritten to\n0.0.0.0 for inactive SDP sessions. Without stack auto-init the\nrewritten address is whatever happened to be on the stack.\n\nFix this by pre-initializing rtp_addr from the session-level connection\naddress (caddr) when available, and tracking via a have_rtp_addr flag\nwhether any valid address was established. Skip the sdp_session hook\nentirely when no valid address exists.\n\nFixes: 4ab9e64e5e3c (\"[NETFILTER]: nf_nat_sip: split up SDP mangling\")\nReported-by: Xiang Mei <xmei5@asu.edu>\nSigned-off-by: Weiming Shi <bestswngs@gmail.com>\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n net/netfilter/nf_conntrack_sip.c | 14 ++++++++++----\n 1 file changed, 10 insertions(+), 4 deletions(-)", "diff": "diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c\nindex 20e57cf5c83a..939502ff7c87 100644\n--- a/net/netfilter/nf_conntrack_sip.c\n+++ b/net/netfilter/nf_conntrack_sip.c\n@@ -1040,6 +1040,7 @@ static int process_sdp(struct sk_buff *skb, unsigned int protoff,\n \tunsigned int port;\n \tconst struct sdp_media_type *t;\n \tint ret = NF_ACCEPT;\n+\tbool have_rtp_addr = false;\n \n \thooks = rcu_dereference(nf_nat_sip_hooks);\n \n@@ -1056,8 +1057,11 @@ static int process_sdp(struct sk_buff *skb, unsigned int protoff,\n \tcaddr_len = 0;\n \tif (ct_sip_parse_sdp_addr(ct, *dptr, sdpoff, *datalen,\n \t\t\t\t SDP_HDR_CONNECTION, SDP_HDR_MEDIA,\n-\t\t\t\t &matchoff, &matchlen, &caddr) > 0)\n+\t\t\t\t &matchoff, &matchlen, &caddr) > 0) {\n \t\tcaddr_len = matchlen;\n+\t\tmemcpy(&rtp_addr, &caddr, sizeof(rtp_addr));\n+\t\thave_rtp_addr = true;\n+\t}\n \n \tmediaoff = sdpoff;\n \tfor (i = 0; i < ARRAY_SIZE(sdp_media_types); ) {\n@@ -1091,9 +1095,11 @@ static int process_sdp(struct sk_buff *skb, unsigned int protoff,\n \t\t\t\t\t &matchoff, &matchlen, &maddr) > 0) {\n \t\t\tmaddr_len = matchlen;\n \t\t\tmemcpy(&rtp_addr, &maddr, sizeof(rtp_addr));\n-\t\t} else if (caddr_len)\n+\t\t\thave_rtp_addr = true;\n+\t\t} else if (caddr_len) {\n \t\t\tmemcpy(&rtp_addr, &caddr, sizeof(rtp_addr));\n-\t\telse {\n+\t\t\thave_rtp_addr = true;\n+\t\t} else {\n \t\t\tnf_ct_helper_log(skb, ct, \"cannot parse SDP message\");\n \t\t\treturn NF_DROP;\n \t\t}\n@@ -1125,7 +1131,7 @@ static int process_sdp(struct sk_buff *skb, unsigned int protoff,\n \n \t/* Update session connection and owner addresses */\n \thooks = rcu_dereference(nf_nat_sip_hooks);\n-\tif (hooks && ct->status & IPS_NAT_MASK)\n+\tif (hooks && ct->status & IPS_NAT_MASK && have_rtp_addr)\n \t\tret = hooks->sdp_session(skb, protoff, dataoff,\n \t\t\t\t\t dptr, datalen, sdpoff,\n \t\t\t\t\t &rtp_addr);\n", "prefixes": [ "net", "13/14" ] }