diff options
author | wpaul <wpaul@FreeBSD.org> | 2001-08-10 23:15:13 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2001-08-10 23:15:13 +0000 |
commit | 69603fe5d4a5db02b03e6a8d979e6e4ecf1787a4 (patch) | |
tree | 65fc7ee5df389e3d8dc729739d518da5eaa8d65a /sys/sys/protosw.h | |
parent | add729e8404a84d920980fd5865f0ef019373b8b (diff) | |
download | FreeBSD-src-69603fe5d4a5db02b03e6a8d979e6e4ecf1787a4.zip FreeBSD-src-69603fe5d4a5db02b03e6a8d979e6e4ecf1787a4.tar.gz |
Fix some of the GDB linkage setup. The l_name member of the gdb linkage
structure is always free()ed yet only sometimes malloc()ed. In particular,
it was simply set to point to l_filename from the a linker_file_t in
link_elf_link_preload_finish(). The l_filename had been malloc()ed inside
the kern_linker.c module and was being free()ed twice: once by
link_elf_unload_file() and again by linker_file_unload(), leading to
a panic.
How to duplicate the problem:
- Pre-load a kernel module from the loader, i.e. if_sis.ko
- Boot system
- Attempt to unload module with kldunload if_sis
- Bewm
The problem here is that the case where the module was loaded with kldload
after system boot would work correctly, so this bug went unnoticed until
I stubbed my toe on it just now. (Also, you can only trip this bug if
you compile a kernel with options DDB, but that's the default now.)
Fix: remember to malloc() a separate copy of the module name for the
l_name member of the gdb linkage structure in three places where the
linkage structure can be initialized.
Diffstat (limited to 'sys/sys/protosw.h')
0 files changed, 0 insertions, 0 deletions