]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tcp: md5: fix potential overestimation of TCP option space
authorEric Dumazet <edumazet@google.com>
Thu, 5 Dec 2019 18:10:15 +0000 (10:10 -0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:45:21 +0000 (23:45 -0500)
commit2af7feb3c547c74957ba9752cbffbf067742c338
tree0959a4ad519eb5c73ffb57c2516c11b4b5080205
parent8d9fcc03939445c0f5f132b15453545553047a9c
tcp: md5: fix potential overestimation of TCP option space

BugLink: https://bugs.launchpad.net/bugs/1859249
[ Upstream commit 9424e2e7ad93ffffa88f882c9bc5023570904b55 ]

Back in 2008, Adam Langley fixed the corner case of packets for flows
having all of the following options : MD5 TS SACK

Since MD5 needs 20 bytes, and TS needs 12 bytes, no sack block
can be cooked from the remaining 8 bytes.

tcp_established_options() correctly sets opts->num_sack_blocks
to zero, but returns 36 instead of 32.

This means TCP cooks packets with 4 extra bytes at the end
of options, containing unitialized bytes.

Fixes: 33ad798c924b ("tcp: options clean up")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/ipv4/tcp_output.c