]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r349989:
authorMichael Tuexen <tuexen@FreeBSD.org>
Sat, 7 Sep 2019 10:49:37 +0000 (10:49 +0000)
committerMichael Tuexen <tuexen@FreeBSD.org>
Sat, 7 Sep 2019 10:49:37 +0000 (10:49 +0000)
commit98eff843671afc6fa8673fc5fd20d7a31ac29aa3
tree5bfe1f948aca77ed06bac60fa115d6e716b34951
parent5f624f25a461172183c717bf530b7dcc3683bf59
MFC r349989:

Improve the input validation for l_linger.
When using the SOL_SOCKET level socket option SO_LINGER, the structure
struct linger is used as the option value. The component l_linger is of
type int, but internally copied to the field so_linger of the structure
struct socket. The type of so_linger is short, but it is assumed to be
non-negative and the value is used to compute ticks to be stored in a
variable of type int.

Therefore, perform input validation on l_linger similar to the one
performed by NetBSD and OpenBSD.

Thanks to syzkaller for making me aware of this issue.

Thanks to markj@ for pointing out that a similar check should be added
to so_linger_set().

Reviewed by: markj@
Differential Revision: https://reviews.freebsd.org/D20948
sys/kern/uipc_socket.c