]> git.baikalelectronics.ru Git - kernel.git/commit
tls: fix skb_to_sgvec returning unhandled error.
authorDoron Roberts-Kedes <doronrk@fb.com>
Mon, 2 Jul 2018 17:25:05 +0000 (10:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Jul 2018 14:26:47 +0000 (23:26 +0900)
commit15853f06ec2b1cd95aa12a5d6b4635b976028c4d
tree3f6755391f5b5e541167ebd8a8c14065d9eeefb9
parentdae535959fc53b497a989187bc30af032035a503
tls: fix skb_to_sgvec returning unhandled error.

The current code does not inspect the return value of skb_to_sgvec. This
can cause a nullptr kernel panic when the malformed sgvec is passed into
the crypto request.

Checking the return value of skb_to_sgvec and skipping decryption if it
is negative fixes this problem.

Fixes: 3ff4595c20b5 ("tls: RX path for ktls")
Acked-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c