]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Define a module version for accept filter modules.
authormarkj <markj@FreeBSD.org>
Tue, 19 May 2020 18:35:08 +0000 (18:35 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 19 May 2020 18:35:08 +0000 (18:35 +0000)
commitb20c56f366b63be2e4ebdd47808bbc31a2c3dd5e
tree28ea28be3e9b66e1bfa83bd116f1c6ab1c8cb42c
parent40125f6322cf64b5672896fc4b8cfc39e10275f2
Define a module version for accept filter modules.

Otherwise accept filters compiled into the kernel do not preempt
preloaded accept filter modules.  Then, the preloaded file registers its
accept filter module before the kernel, and the kernel's attempt fails
since duplicate accept filter list entries are not permitted.  This
causes the preloaded file's module to be released, since
module_register_init() does a lookup by name, so the preloaded file is
unloaded, and the accept filter's callback points to random memory since
preload_delete_name() unmaps the file on x86 as of r336505.

Add a new ACCEPT_FILTER_DEFINE macro which wraps the accept filter and
module definitions, and ensures that a module version is defined.

PR: 245870
Reported by: Thomas von Dein <freebsd@daemon.de>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
sys/netinet/accf_data.c
sys/netinet/accf_dns.c
sys/netinet/accf_http.c
sys/sys/socketvar.h