]> git.baikalelectronics.ru Git - kernel.git/commit
sock: fix sg page frag coalescing in sk_alloc_sg
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 Jul 2018 20:37:54 +0000 (22:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2018 04:28:45 +0000 (21:28 -0700)
commit2f3545e268824d29c522031061e4ff61e9bdc1e6
tree75dfd88c50706a78d0fafdfbc8b6760d138099a7
parentac6e1dd173eced10fef3567890e26f51b59574e5
sock: fix sg page frag coalescing in sk_alloc_sg

Current sg coalescing logic in sk_alloc_sg() (latter is used by tls and
sockmap) is not quite correct in that we do fetch the previous sg entry,
however the subsequent check whether the refilled page frag from the
socket is still the same as from the last entry with prior offset and
length matching the start of the current buffer is comparing always the
first sg list entry instead of the prior one.

Fixes: 3a71956a2d9a ("tls: kernel TLS support")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c