diff options
author | newton <newton@FreeBSD.org> | 1999-02-04 21:20:13 +0000 |
---|---|---|
committer | newton <newton@FreeBSD.org> | 1999-02-04 21:20:13 +0000 |
commit | 67934ff5c867dfbd8a57d5bf499d3b93a6bf6dcf (patch) | |
tree | d29c659a538fd2213e3faca34387f59d81e48c6d /sys/i386/linux | |
parent | 63f9aaa28d180f76153b4f416cf4622858afa7ed (diff) | |
download | FreeBSD-src-67934ff5c867dfbd8a57d5bf499d3b93a6bf6dcf.zip FreeBSD-src-67934ff5c867dfbd8a57d5bf499d3b93a6bf6dcf.tar.gz |
Added call to elf_brand_inuse() to prevent you from cutting your own
legs out from under you.
Diffstat (limited to 'sys/i386/linux')
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index fd80f1d..744719c 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_sysvec.c,v 1.43 1999/01/06 23:05:38 julian Exp $ + * $Id: linux_sysvec.c,v 1.44 1999/01/17 20:36:14 peter Exp $ */ /* XXX we use functions that might not exist. */ @@ -471,8 +471,16 @@ linux_elf_modevent(module_t mod, int type, void *data) case MOD_UNLOAD: for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo) - if (elf_remove_brand_entry(*brandinfo) < 0) - error = EINVAL; + if (elf_brand_inuse(*brandinfo)) { + error = EBUSY; + } + + if (error == 0) { + for (brandinfo = &linux_brandlist[0]; + *brandinfo != NULL; ++brandinfo) + if (elf_remove_brand_entry(*brandinfo) < 0) + error = EINVAL; + } if (error) printf("Could not deinstall ELF interpreter entry\n"); else if (bootverbose) |