]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern: soclose: don't sleep on SO_LINGER w/ timeout=0
authorKyle Evans <kevans@FreeBSD.org>
Fri, 4 Dec 2020 04:39:48 +0000 (04:39 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 4 Dec 2020 04:39:48 +0000 (04:39 +0000)
commit34af05ead3cf0eaf69d678d8025864bcad295273
treeabafd1709f2765e7e2c94eb01ccd012b6e3469db
parentdf9053920f6f70cbb26c998fb231f8afb51b386f
kern: soclose: don't sleep on SO_LINGER w/ timeout=0

This is a valid scenario that's handled in the various protocol layers where
it makes sense (e.g., tcp_disconnect and sctp_disconnect). Given that it
indicates we should immediately drop the connection, it makes little sense
to sleep on it.

This could lead to panics with INVARIANTS. On non-INVARIANTS kernels, this
could result in the thread hanging until a signal interrupts it if the
protocol does not mark the socket as disconnected for whatever reason.

Reported by: syzbot+e625d92c1dd74e402c81@syzkaller.appspotmail.com
Reviewed by: glebius, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27407
sys/kern/uipc_socket.c