Date: Fri, 10 Aug 2001 19:36:29 -0400 From: "Brian F. Feldman" <green@FreeBSD.org> To: Bill Paul <wpaul@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern link_elf.c Message-ID: <200108102336.f7ANaUQ85691@green.bikeshed.org> In-Reply-To: Message from Bill Paul <wpaul@FreeBSD.org> of "Fri, 10 Aug 2001 16:15:13 PDT." <200108102315.f7ANFD257971@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Bill Paul <wpaul@FreeBSD.org> wrote: > wpaul 2001/08/10 16:15:13 PDT > > Modified files: > sys/kern link_elf.c > Log: > 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. I must be misremembering that at one point you couldn't unload a preloaded module... -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108102336.f7ANaUQ85691>