]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ipv4: avoid using shared IP generator for connected sockets
authorEric Dumazet <edumazet@google.com>
Thu, 27 Jan 2022 01:10:22 +0000 (17:10 -0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 3 Feb 2022 09:28:50 +0000 (10:28 +0100)
commit2a0239eb5c17c7c720498bc4c2af0847fee596d6
treed076e367ccee1cb9f2402ddfcfc621db74fed299
parentccf187e55d9658a936179adc2da8b02e0e8b0f86
ipv4: avoid using shared IP generator for connected sockets

BugLink: https://bugs.launchpad.net/bugs/1959879
commit 23f57406b82de51809d5812afd96f210f8b627f3 upstream.

ip_select_ident_segs() has been very conservative about using
the connected socket private generator only for packets with IP_DF
set, claiming it was needed for some VJ compression implementations.

As mentioned in this referenced document, this can be abused.
(Ref: Off-Path TCP Exploits of the Mixed IPID Assignment)

Before switching to pure random IPID generation and possibly hurt
some workloads, lets use the private inet socket generator.

Not only this will remove one vulnerability, this will also
improve performance of TCP flows using pmtudisc==IP_PMTUDISC_DONT

Fixes: 73f156a6e8c1 ("inetpeer: get rid of ip_id_count")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reported-by: Ray Che <xijiache@gmail.com>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
include/net/ip.h