]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix potential memory corruption
authorEric Dumazet <edumazet@google.com>
Wed, 2 Nov 2016 14:53:17 +0000 (07:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Nov 2016 19:33:30 +0000 (15:33 -0400)
commit01ae599763fb68594c39a412f4c91852c067b814
tree781677be717b11066e303449ee4abd787048816e
parenteba9b8ce114d0dbb6ca53d2f3797cb7646a9d2f9
tcp: fix potential memory corruption

Imagine initial value of max_skb_frags is 17, and last
skb in write queue has 15 frags.

Then max_skb_frags is lowered to 14 or smaller value.

tcp_sendmsg() will then be allowed to add additional page frags
and eventually go past MAX_SKB_FRAGS, overflowing struct
skb_shared_info.

Fixes: c08eb253e011 ("net:Add sysctl_max_skb_frags")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
Cc: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c