]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tcp: tcp_fragment() should apply sane memory limits
authorEric Dumazet <edumazet@google.com>
Fri, 7 Jun 2019 23:10:08 +0000 (16:10 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Sun, 9 Jun 2019 00:02:34 +0000 (17:02 -0700)
commit9277dc0626bd6e888025f8b1be013710cb7d63d7
tree3a51187e9179ee8186a9774149b6fe8c08698423
parent1b56e4cb5deca1af4415d378ffcea5a220895c39
tcp: tcp_fragment() should apply sane memory limits

Jonathan Looney reported that a malicious peer can force a sender
to fragment its retransmit queue into tiny skbs, inflating memory
usage and/or overflow 32bit counters.

TCP allows an application to queue up to sk_sndbuf bytes,
so we need to give some allowance for non malicious splitting
of retransmit queue.

A new SNMP counter is added to monitor how many times TCP
did not allow to split an skb if the allowance was exceeded.

Note that this counter might increase in the case applications
use SO_SNDBUF socket option to lower sk_sndbuf.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Jonathan Looney <jtl@netflix.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
Cc: Bruce Curtis <brucec@netflix.com>
Orabug: 29884306
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
include/uapi/linux/snmp.h
net/ipv4/proc.c
net/ipv4/tcp_output.c