]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sockets: on accept(2) don't copy all of so_options to new socket
authorGleb Smirnoff <glebius@FreeBSD.org>
Mon, 14 Aug 2023 19:56:07 +0000 (12:56 -0700)
committerGleb Smirnoff <glebius@FreeBSD.org>
Mon, 14 Aug 2023 19:56:08 +0000 (12:56 -0700)
commitd29b95ecc0d049406d27a6c11939d40a46658733
treea9bdf929d35c0d9e31ea1bad1498a0da8ea87d0b
parente3637e2f5b802e3ea3b9d4819e505e79c3f072af
sockets: on accept(2) don't copy all of so_options to new socket

As uncovered by e3ba0d6adde3 we are copying lots of irrelevant options
from the listener to an accepted socket, even those that aren't relevant
to a non-listener, e.g. SO_REUSE*, SO_ACCEPTFILTER.  Stop doing that
and provide a fixed opt-in list for options to be inherited.  Ideally
we shall not inherit anything at all.  For compatibility inherit a set
of options that are meaningful for a non-listening socket of a protocol
that can listen(2).

Differential Revision: https://reviews.freebsd.org/D41412
Fixes: e3ba0d6adde3c694f46a30b3b67eba43a7099395
sys/kern/uipc_socket.c