No description
Find a file
Eric Dumazet d887a33724 ipv4: tcp: send zero IPID in SYNACK messages
[ Upstream commit 970a5a3ea8 ]

In commit 431280eebe ("ipv4: tcp: send zero IPID for RST and
ACK sent in SYN-RECV and TIME-WAIT state") we took care of some
ctl packets sent by TCP.

It turns out we need to use a similar strategy for SYNACK packets.

By default, they carry IP_DF and IPID==0, but there are ways
to ask them to use the hashed IP ident generator and thus
be used to build off-path attacks.
(Ref: Off-Path TCP Exploits of the Mixed IPID Assignment)

One of this way is to force (before listener is started)
echo 1 >/proc/sys/net/ipv4/ip_no_pmtu_disc

Another way is using forged ICMP ICMP_FRAG_NEEDED
with a very small MTU (like 68) to force a false return from
ip_dont_fragment()

In this patch, ip_build_and_send_pkt() uses the following
heuristics.

1) Most SYNACK packets are smaller than IPV4_MIN_MTU and therefore
can use IP_DF regardless of the listener or route pmtu setting.

2) In case the SYNACK packet is bigger than IPV4_MIN_MTU,
we use prandom_u32() generator instead of the IPv4 hashed ident one.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Ray Che <xijiache@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Cc: Geoff Alexander <alexandg@cs.unm.edu>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-02-01 17:27:14 +01:00
arch powerpc/perf: Fix power_pmu_disable to call clear_pmi_irq_pending only if PMI is pending 2022-02-01 17:27:12 +01:00
block block: add bio_start_io_acct_time() to control start_time 2022-02-01 17:27:03 +01:00
certs certs: Add support for using elliptic curve keys for signing modules 2021-08-23 19:55:42 +03:00
crypto crypto: jitter - consider 32 LSB for APT 2022-01-27 11:04:31 +01:00
Documentation psi: Fix uaf issue when psi trigger is destroyed while being polled 2022-02-01 17:27:01 +01:00
drivers gve: Fix GFP flags when allocing pages 2022-02-01 17:27:14 +01:00
fs ceph: put the requests/sessions when it fails to alloc memory 2022-02-01 17:27:14 +01:00
include Revert "ipv6: Honor all IPv6 PIO Valid Lifetime values" 2022-02-01 17:27:14 +01:00
init init: make unknown command line param message clearer 2021-11-18 19:17:11 +01:00
ipc shm: extend forced shm destroy to support objects from several IPC nses 2021-11-25 09:48:42 +01:00
kernel sched/pelt: Relax the sync of util_sum with util_avg 2022-02-01 17:27:10 +01:00
lib lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test 2022-01-27 11:05:44 +01:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm memcg: better bounds on the memcg stats updates 2022-01-29 10:58:24 +01:00
net ipv4: tcp: send zero IPID in SYNACK messages 2022-02-01 17:27:14 +01:00
samples samples: bpf: Fix 'unknown warning group' build warning on Clang 2022-01-27 11:03:29 +01:00
scripts scripts: sphinx-pre-install: Fix ctex support on Debian 2022-01-27 11:05:44 +01:00
security selinux: fix potential memleak in selinux_add_opt() 2022-01-27 11:03:43 +01:00
sound ASoC: mediatek: mt8183: fix device_node leak 2022-01-27 11:05:04 +01:00
tools KVM: selftests: Don't skip L2's VMCALL in SMM test for SVM guest 2022-02-01 17:27:14 +01:00
usr kbuild: remove include/linux/cyclades.h from header file check 2022-02-01 17:27:04 +01:00
virt Revert "KVM: SVM: avoid infinite loop on NPF from bad address" 2022-02-01 17:27:01 +01:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS drm fixes for 5.15 final 2021-10-28 12:17:01 -07:00
Makefile Linux 5.15.18 2022-01-29 10:58:25 +01:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.