]> git.baikalelectronics.ru Git - 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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 27 Jan 2022 16:37:02 +0000 (08:37 -0800)
commitb9284e94a783cbd21e2b176f0053eca58ca8646c
tree21e7e8d8dc4d9bac3afb75db6ea66f8aed7a1226
parentb34ba215de0792ccfce865dee955ff4d0ac0d8f9
ipv4: avoid using shared IP generator for connected sockets

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: 1bad92b3f896 ("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>
include/net/ip.h