]> git.baikalelectronics.ru Git - kernel.git/commit
net: tls: avoid hanging tasks on the tx_lock
authorJakub Kicinski <kuba@kernel.org>
Wed, 1 Mar 2023 00:28:57 +0000 (16:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:40 +0000 (13:55 +0100)
commit08160042a91eae722f05fc5a3070e766ab9f9896
treefee4ee5763848a524ac85758bbef3b8b5b89605b
parentcc8d0aa823540b63427f033afbae82b959598f82
net: tls: avoid hanging tasks on the tx_lock

commit 9ace5c7a643931b39a1fd317834cfd8a72b2673e upstream.

syzbot sent a hung task report and Eric explains that adversarial
receiver may keep RWIN at 0 for a long time, so we are not guaranteed
to make forward progress. Thread which took tx_lock and went to sleep
may not release tx_lock for hours. Use interruptible sleep where
possible and reschedule the work if it can't take the lock.

Testing: existing selftest passes

Reported-by: syzbot+9c0268252b8ef967c62e@syzkaller.appspotmail.com
Fixes: 772e9aee525f ("net/tls: add a TX lock")
Link: https://lore.kernel.org/all/000000000000e412e905f5b46201@google.com/
Cc: stable@vger.kernel.org # wait 4 weeks
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230301002857.2101894-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tls/tls_sw.c