diff options
author | Vakul Garg <vakul.garg@nxp.com> | 2018-09-06 21:41:40 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-09 08:10:01 -0700 |
commit | 52ea992cfac357b73180d5c051dca43bc8d20c2a (patch) | |
tree | 032f87084cff484a3ddd203027856790faefefdb /net/ipv4 | |
parent | 0e1f4c76be241377d282e34ebea6d16ff7829747 (diff) |
net/tls: Set count of SG entries if sk_alloc_sg returns -ENOSPC
tls_sw_sendmsg() allocates plaintext and encrypted SG entries using
function sk_alloc_sg(). In case the number of SG entries hit
MAX_SKB_FRAGS, sk_alloc_sg() returns -ENOSPC and sets the variable for
current SG index to '0'. This leads to calling of function
tls_push_record() with 'sg_encrypted_num_elem = 0' and later causes
kernel crash. To fix this, set the number of SG elements to the number
of elements in plaintext/encrypted SG arrays in case sk_alloc_sg()
returns -ENOSPC.
Fixes: 3c4d7559159b ("tls: kernel TLS support")
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
0 files changed, 0 insertions, 0 deletions