Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2224571/?format=api
{ "id": 2224571, "url": "http://patchwork.ozlabs.org/api/patches/2224571/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260417162057.3732-1-fmancera@suse.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": "<20260417162057.3732-1-fmancera@suse.de>", "list_archive_url": null, "date": "2026-04-17T16:20:56", "name": "[1/2,nf] netfilter: nfnetlink_osf: fix out-of-bounds read on option matching", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "c724533932b7a951d97a3423969b2a6304c1c176", "submitter": { "id": 90904, "url": "http://patchwork.ozlabs.org/api/people/90904/?format=api", "name": "Fernando Fernandez Mancera", "email": "fmancera@suse.de" }, "delegate": { "id": 11902, "url": "http://patchwork.ozlabs.org/api/users/11902/?format=api", "username": "strlen", "first_name": "Florian", "last_name": "Westphal", "email": "fw@strlen.de" }, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260417162057.3732-1-fmancera@suse.de/mbox/", "series": [ { "id": 500370, "url": "http://patchwork.ozlabs.org/api/series/500370/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=500370", "date": "2026-04-17T16:20:57", "name": "[1/2,nf] netfilter: nfnetlink_osf: fix out-of-bounds read on option matching", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500370/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2224571/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2224571/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-12002-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\tdkim=pass (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=bZLsYTiu;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=AtT73iFC;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=aPnIB5TQ;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=h2FY9A38;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-12002-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"bZLsYTiu\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"AtT73iFC\";\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"aPnIB5TQ\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"h2FY9A38\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=195.135.223.130", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.de", "smtp-out1.suse.de;\n\tnone" ], "Received": [ "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fy0cT3T11z1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 18 Apr 2026 02:26:01 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id D69573050C30\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 16:21:50 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 228FD34F48E;\n\tFri, 17 Apr 2026 16:21:44 +0000 (UTC)", "from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 82CA228F5\n\tfor <netfilter-devel@vger.kernel.org>; Fri, 17 Apr 2026 16:21:41 +0000 (UTC)", "from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby smtp-out1.suse.de (Postfix) with ESMTPS id AE1FB6A9BE;\n\tFri, 17 Apr 2026 16:21:35 +0000 (UTC)", "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 43C53593AF;\n\tFri, 17 Apr 2026 16:21:35 +0000 (UTC)", "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n\tby imap1.dmz-prg2.suse.org with ESMTPSA\n\tid NVDSDQ9e4mlAFQAAD6G6ig\n\t(envelope-from <fmancera@suse.de>); Fri, 17 Apr 2026 16:21:35 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776442903; cv=none;\n b=DOxxmz5ckZlQCrkZHfkkkyAMvZjKW9XbGH4AE+Fpus2yMOsbn6BQv7rZq7fkUgPn93rfPDbZNjQ9No1PTT+4pM+Tg9eIUTKwbcmbrdGqFM4ypr98ybld5u4qfYUF1U20OfvWaLX77y9XMNy+Cw4xJHafVbarNq65VQyApglhQMk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776442903; c=relaxed/simple;\n\tbh=YnVEOQlSyYBs3gRu6/9WAzwZ9EduIos/joljLlqm60s=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=LFv8v8yAK+yyKMy2JXZrf1Ee/aStlw9rhf9zes+69JDNDO7Lj6EVVdalmqkdjQTjd90T7/95ILdap5CgfqbgcI4QCHvmE1xBGqZZs9RuR7V5agxjnU3IDAtMPXgx8Up/L24g1G8yzT3REeJPuZF8k28k6BfSbNKR0yqn0TNU/iw=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de;\n spf=pass smtp.mailfrom=suse.de;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=bZLsYTiu;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=AtT73iFC;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=aPnIB5TQ;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=h2FY9A38; arc=none smtp.client-ip=195.135.223.130", "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1776442899;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n\tbh=gHuz/jVQj6H7J+pM4dAvL3x3DF9RxxH8iIPsfYigp6g=;\n\tb=bZLsYTiufaMAu53oDgn2IcDWrHiN575NqxGVrPVxBypE0QWTrOgFsTZLGybUeCKH8EUX4Q\n\tldi24BQlqhx547KgUm/RuqrXu4qqyFUOimpFbvcuy0cV/7mi+JIff4X5c0CsXWaLbutRvs\n\tbYYe3gpwYpCZL2WUHr4TZkdE7dQAr8Y=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1776442899;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n\tbh=gHuz/jVQj6H7J+pM4dAvL3x3DF9RxxH8iIPsfYigp6g=;\n\tb=AtT73iFC9Iw3OKQw+J9pYsb2e/MNfG92ZtNPYj0J+xJRJmFllvdeLscXS5uIfzb26Y5lNe\n\tdNhAxCkXRNlYGtAw==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1776442895;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n\tbh=gHuz/jVQj6H7J+pM4dAvL3x3DF9RxxH8iIPsfYigp6g=;\n\tb=aPnIB5TQ9HzcKH6hw74yKxgXAhpprr+jlWI1q8z6mr1ku3yT10BGC058MI/nuSyAOmjkYw\n\tmtDKpgX+jQ2Wx27gAL7fybst6lyiFGQBuNdknwZKrVIdlPlGKXoOBj7XzZb/Ng8pEXxauk\n\tzJH6FcNpjDF1jnusD1xRX/jlGM9p3ds=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1776442895;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n\tbh=gHuz/jVQj6H7J+pM4dAvL3x3DF9RxxH8iIPsfYigp6g=;\n\tb=h2FY9A38g+zNilqY3UGxwz/xHih1mbSVZzOdTLjJlZ8pb9o9uYlNj5CySy/w5VYsxIuC8g\n\ti+KO36Dkb2zkaUCg==" ], "From": "Fernando Fernandez Mancera <fmancera@suse.de>", "To": "netfilter-devel@vger.kernel.org", "Cc": "netdev@vger.kernel.org,\n\tcoreteam@netfilter.org,\n\tpablo@netfilter.org,\n\tfw@strlen.de,\n\tphil@nwl.cc,\n\tFernando Fernandez Mancera <fmancera@suse.de>", "Subject": "[PATCH 1/2 nf] netfilter: nfnetlink_osf: fix out-of-bounds read on\n option matching", "Date": "Fri, 17 Apr 2026 18:20:56 +0200", "Message-ID": "<20260417162057.3732-1-fmancera@suse.de>", "X-Mailer": "git-send-email 2.51.0", "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", "X-Spam-Score": "-2.80", "X-Spam-Level": "", "X-Spamd-Result": "default: False [-2.80 / 50.00];\n\tBAYES_HAM(-3.00)[100.00%];\n\tNEURAL_HAM_LONG(-1.00)[-1.000];\n\tMID_CONTAINS_FROM(1.00)[];\n\tR_MISSING_CHARSET(0.50)[];\n\tNEURAL_HAM_SHORT(-0.20)[-1.000];\n\tMIME_GOOD(-0.10)[text/plain];\n\tTO_MATCH_ENVRCPT_ALL(0.00)[];\n\tARC_NA(0.00)[];\n\tRCVD_VIA_SMTP_AUTH(0.00)[];\n\tFROM_HAS_DN(0.00)[];\n\tMIME_TRACE(0.00)[0:+];\n\tDBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email,strlen.de:email];\n\tFUZZY_RATELIMITED(0.00)[rspamd.com];\n\tRCPT_COUNT_SEVEN(0.00)[7];\n\tRCVD_COUNT_TWO(0.00)[2];\n\tFROM_EQ_ENVFROM(0.00)[];\n\tDKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n\tTO_DN_SOME(0.00)[];\n\tRCVD_TLS_ALL(0.00)[]", "X-Spam-Flag": "NO" }, "content": "In nf_osf_match(), the nf_osf_hdr_ctx structure is initialized once\nand passed by reference to nf_osf_match_one() for each fingerprint\nchecked. During TCP option parsing, nf_osf_match_one() advances the\nshared ctx->optp pointer.\n\nIf a fingerprint perfectly matches, the function returns early without\nrestoring ctx->optp to its initial state. If the user has configured\nNF_OSF_LOGLEVEL_ALL, the loop continues to the next fingerprint.\nHowever, because ctx->optp was not restored, the next call to\nnf_osf_match_one() starts parsing from the end of the options buffer.\nThis causes subsequent matches to read garbage data and fail\nimmediately, making it impossible to log more than one match or logging\nincorrect matches.\n\nInstead of using a shared ctx->optp pointer, pass the context as a\nconstant pointer and use a local pointer (optp) for TCP option\ntraversal. This makes nf_osf_match_one() strictly stateless from the\ncaller's perspective, ensuring every fingerprint check starts at the\ncorrect option offset.\n\nFixes: 1a6a0951fc00 (\"netfilter: nfnetlink_osf: add missing fmatch check\")\nSuggested-by: Florian Westphal <fw@strlen.de>\nSigned-off-by: Fernando Fernandez Mancera <fmancera@suse.de>\n---\n net/netfilter/nfnetlink_osf.c | 19 ++++++++-----------\n 1 file changed, 8 insertions(+), 11 deletions(-)", "diff": "diff --git a/net/netfilter/nfnetlink_osf.c b/net/netfilter/nfnetlink_osf.c\nindex 45d9ad231a92..f58267986453 100644\n--- a/net/netfilter/nfnetlink_osf.c\n+++ b/net/netfilter/nfnetlink_osf.c\n@@ -64,9 +64,9 @@ struct nf_osf_hdr_ctx {\n static bool nf_osf_match_one(const struct sk_buff *skb,\n \t\t\t const struct nf_osf_user_finger *f,\n \t\t\t int ttl_check,\n-\t\t\t struct nf_osf_hdr_ctx *ctx)\n+\t\t\t const struct nf_osf_hdr_ctx *ctx)\n {\n-\tconst __u8 *optpinit = ctx->optp;\n+\tconst __u8 *optp = ctx->optp;\n \tunsigned int check_WSS = 0;\n \tint fmatch = FMATCH_WRONG;\n \tint foptsize, optnum;\n@@ -95,17 +95,17 @@ static bool nf_osf_match_one(const struct sk_buff *skb,\n \tcheck_WSS = f->wss.wc;\n \n \tfor (optnum = 0; optnum < f->opt_num; ++optnum) {\n-\t\tif (f->opt[optnum].kind == *ctx->optp) {\n+\t\tif (f->opt[optnum].kind == *optp) {\n \t\t\t__u32 len = f->opt[optnum].length;\n-\t\t\tconst __u8 *optend = ctx->optp + len;\n+\t\t\tconst __u8 *optend = optp + len;\n \n \t\t\tfmatch = FMATCH_OK;\n \n-\t\t\tswitch (*ctx->optp) {\n+\t\t\tswitch (*optp) {\n \t\t\tcase OSFOPT_MSS:\n-\t\t\t\tmss = ctx->optp[3];\n+\t\t\t\tmss = optp[3];\n \t\t\t\tmss <<= 8;\n-\t\t\t\tmss |= ctx->optp[2];\n+\t\t\t\tmss |= optp[2];\n \n \t\t\t\tmss = ntohs((__force __be16)mss);\n \t\t\t\tbreak;\n@@ -113,7 +113,7 @@ static bool nf_osf_match_one(const struct sk_buff *skb,\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tctx->optp = optend;\n+\t\t\toptp = optend;\n \t\t} else\n \t\t\tfmatch = FMATCH_OPT_WRONG;\n \n@@ -156,9 +156,6 @@ static bool nf_osf_match_one(const struct sk_buff *skb,\n \t\t}\n \t}\n \n-\tif (fmatch != FMATCH_OK)\n-\t\tctx->optp = optpinit;\n-\n \treturn fmatch == FMATCH_OK;\n }\n \n", "prefixes": [ "1/2", "nf" ] }