Date: Thu, 5 Feb 2009 23:01:36 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r188209 - head/sys/kern Message-ID: <200902052301.n15N1a04041963@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Thu Feb 5 23:01:36 2009 New Revision: 188209 URL: http://svn.freebsd.org/changeset/base/188209 Log: Drop the kernel linker lock while running SYSUNINIT routines and removing sysctls during a linker file unload. We drop the lock when doing similar operations during a linker file load. To close races, clear the LINKED flag before dropping the lock so that the linker file is no longer visible to userland. MFC after: 1 week Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Feb 5 22:19:13 2009 (r188208) +++ head/sys/kern/kern_linker.c Thu Feb 5 23:01:36 2009 (r188209) @@ -643,8 +643,11 @@ linker_file_unload(linker_file_t file, i * link error. */ if (file->flags & LINKER_FILE_LINKED) { + file->flags &= ~LINKER_FILE_LINKED; + KLD_UNLOCK(); linker_file_sysuninit(file); linker_file_unregister_sysctls(file); + KLD_LOCK(); } TAILQ_REMOVE(&linker_files, file, link);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902052301.n15N1a04041963>