On Thursday 28 July 2005 16:25, Jeff Dike wrote: > There's a rather nasty bug in elf_aux.c which was uncovered by the > #if/#ifdef patch in -mm2. We have the following:
> #if ELF_CLASS == ELFCLASS32 > typedef Elf32_auxv_t elf_auxv_t; > #else > typedef Elf64_auxv_t elf_auxv_t; > #endif > Unfortunately, ELFCLASS32 is never defined, so we end up with > Elf64_aux_v_t. The patch correctly added an include of <asm/elf.h> to > define it. However, with Elf32_auxv_t, never file systems don't boot. Which ones? Also, /lib/tls is normally disabled, and the normal glibc is for 2.4 kernels, so how does that matter? Yes, with /lib/tls enabled most things usually work anyway, but are you in that config? > This is because UML then recognizes the presence of the vsyscall page > and sets __kernel_vsyscall, vsyscall_ehdr, and vsyscall_end > accordingly. > These seem to end up in UML process' ELF tables, which segfault > endlessly on the non-existant vsyscall page. Why is it non-existant? The problem here is that, on 2.6 host kernels, a process cannot avoid having that page mapped in his address space. So Bodo decided that the better thing to do was to recognize this, allow processes to use it and allow copy_from_user to read from there, since that is used to check for possible syscalls. At least IIRC. Just do a cat /proc/pid/maps and verify that at the end there *is* indeed that page is mapped even for userspace pids. > So, what is the intent here? Do we want to map the host's vsyscall > page, and just forgot to? Yes, at least IIRC. > Or do we want to tell our processes that > there is no vsyscall page? That code wouldn't be the way surely. > In my tree, I have this disabled with this: > Index: linux-2.6.12-rc3-mm2/arch/um/os-Linux/elf_aux.c > =================================================================== > --- linux-2.6.12-rc3-mm2.orig/arch/um/os-Linux/elf_aux.c 2005-07-27 > 14:56:46.000000000 -0400 +++ > linux-2.6.12-rc3-mm2/arch/um/os-Linux/elf_aux.c 2005-07-28 > 10:12:49.000000000 -0400 @@ -57,9 +57,9 @@ > break; > } > } > - if ( ! __kernel_vsyscall || ! vsyscall_ehdr || > + if (1 /* ! __kernel_vsyscall || ! vsyscall_ehdr || > ! elf_aux_hwcap || ! elf_aux_platform || > - ! page_size || (vsyscall_ehdr % page_size) ) { > + ! page_size || (vsyscall_ehdr % page_size) */ ) { > __kernel_vsyscall = 0; > vsyscall_ehdr = 0; > elf_aux_hwcap = 0; > > which works, but isn't right. > > Jeff -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ User-mode-linux-user mailing list User-mode-linux-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user