From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6443443DA56; Tue, 16 Jun 2026 15:15:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781622942; cv=none; b=QFkd9s/Zs335l4THJJUUVMXD2RHFZH3VZUYV8vcxApcqx+vWQHfhx/icdhmdApIGoFZ4eQlhdnEKn9fMYGm1GwtoaR7w5j0ItfZI8SJaNVG+eGsWqUkzJ81QloH3eEEQ9Yc44ke0yBe43UH6c7i0sgvyrrP47+PPDh4ofZMgGR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781622942; c=relaxed/simple; bh=60xAuKGInUl3P7PMu0lq2zAWVia9KzwzQrvZdeP9e04=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OcuM6sFOpoUg2C2C6laauqoSWMh0PI6luw1NmPk751P0UnvLcEFJ5iK+rXCv8bIrLD/acdyfS8jHO7upBeKF97s8UaXr/pdnRuHKvmxREeAixGM9jSBOJNwL2krjEV6Gc6Z+jk86oAQNBnxJjwp9UO+4kAMNAQ+4kIkfCQE2aSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iRTyHetq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iRTyHetq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3220E1F000E9; Tue, 16 Jun 2026 15:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781622941; bh=lx8PFpJMiiHy+4WglP0bu7h34/phgFdovUS1r+FBVDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iRTyHetqY7wm+C+Wp3jIkLLhSY+/5PeCQM0rhF+AFN71g1yqTL2T954wX4bvfo1UP lkLX1fV4w07+r1OY78JOuEhbjaZ9gp9bWUmNGTkfgqu2kbh6PPE2ALnONdpLYywSHg QwpcNc8m1E9WJ8eJ9B97gbDdG8U4dtdM0XUOn0oE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tamir Shahar , Amit Klein , Eric Dumazet , David Ahern , Ido Schimmel , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.0 058/378] ipv4: restrict IPOPT_SSRR and IPOPT_LSRR options Date: Tue, 16 Jun 2026 20:24:49 +0530 Message-ID: <20260616145113.031603304@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145109.744539446@linuxfoundation.org> References: <20260616145109.744539446@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit d3915a1f5a4bc0ac911032903c3c6ab8df9fcc7c ] This patch restricts setting Loose Source and Record Route (LSRR) and Strict Source and Record Route (SSRR) IP options to users with CAP_NET_RAW capability. This prevents unprivileged applications from forcing packets to route through attacker-controlled nodes to leak TCP ISN and possibly other protocol information. While LSRR and SSRR are commonly filtered in many network environments, they may still be supported and forwarded along some network paths. RFC 7126 (Recommendations on Filtering of IPv4 Packets Containing IPv4 Options) recommend to drop these options in 4.3 and 4.4. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Tamir Shahar Reported-by: Amit Klein Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20260602161547.2642155-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv4/ip_options.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index be8815ce3ac242..09d745112c1526 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c @@ -530,6 +530,10 @@ int ip_options_get(struct net *net, struct ip_options_rcu **optp, kfree(opt); return -EINVAL; } + if (opt->opt.srr && !ns_capable(net->user_ns, CAP_NET_RAW)) { + kfree(opt); + return -EPERM; + } kfree(*optp); *optp = opt; return 0; -- 2.53.0