Linux/linux 7a8c4ddnet/tls tls_sw.c

tls: Correct length of scatterlist in tls_sw_sendpage

The scatterlist is reused by both sendmsg and sendfile.
If a sendmsg of smaller number of pages is followed by a sendfile
of larger number of pages, the scatterlist may be too short, resulting
in a crash in gcm_encrypt.

Add sg_unmark_end to make the list the correct length.

tls_sw_sendmsg already calls sg_unmark_end correctly when it allocates
memory in alloc_sg, or in zerocopy_from_iter.

Signed-off-by: Dave Watson <davejwatson at fb.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
DeltaFile
+2-0net/tls/tls_sw.c
+2-01 files

UnifiedSplitRaw