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 CE9A13D8105; Tue, 16 Jun 2026 18:21:34 +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=1781634095; cv=none; b=dSAASx+AIX5DuOlUn8MXaRVV4W9I4LPyAgtOvDX/0KA8ig+kyBGCMKlSmDG5xXDyT+bPIYpcC4j8gm/hONAnQLReRM9ezkvrt4BoEbNxtcM2mTnt4I83Qnh0wlRopozJbC5813JPaLC1Bhqt7ic4kn+T2xvGBEyV/8+IbGisFlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781634095; c=relaxed/simple; bh=DujW0d6AAV6C1cmzampMBg2OLvcgwdIELoFQreImK/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uXDEQD9YPu4dSho0uT9qlAw6eujv1/8dMGVZRGwsJHmCdSUzWjbPzd8x7jDgUOA6W3i5Ln/tL1WNzSP6dQZ+Eef0Cmwzq/TmpW3/w7H79nccGrZ8aKPEn/ZU/mF6q8inBRH7Uya7ZYGFyXaZIZ2WkDJvOoc8YK3AU781SARvYCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cL1xXWIE; 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="cL1xXWIE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D81911F000E9; Tue, 16 Jun 2026 18:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781634094; bh=b7/9rAoE0o4H6GyT0pfdJWac0P7Bx5SQLaWG6tqNX90=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cL1xXWIExsaXz3sHNAmOFDbFw/z/d6l4M7UBCEWHxN2gcrM8xjegUT9UGZhyicD6L 5g4ZmNZgN/fOVytRn1uspTnMzsVGuKNuIa7vc16IDGRBP7Pgln1gnGUCx3z5ZTRgG4 DKJuKsxXFtEpdC3IjgzR8b12lK0FDIZyIVpEMTmE= 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 5.15 168/411] ipv4: restrict IPOPT_SSRR and IPOPT_LSRR options Date: Tue, 16 Jun 2026 20:26:46 +0530 Message-ID: <20260616145109.549721040@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145100.376842714@linuxfoundation.org> References: <20260616145100.376842714@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 5.15-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 da1b5038bdfd04..4afdaaab616239 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c @@ -543,6 +543,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