[Nestedvm] NestedVM: Buffer overflow error compiling nestedvm
C.F.Scheidecker Antunes
cf.antunes at gmail.com
Tue Jan 3 21:27:09 EST 2012
I've discovered that one needs to build the mips ar tool with symbols.
A lot of code in binutils
uses sprintf instead of snprintf and there might be a bug.
Is this correct? If so, how can I modify the make file so that it will
fix this situation?
Thanks.
On Tue, Jan 3, 2012 at 6:17 PM, C.F.Scheidecker Antunes
<cf.antunes at gmail.com> wrote:
> Hi all,
>
> I was having the error of a missing param for the function open and
> was able to fix that. That was the error:
>
> inlined ‘collect_execute’ em ../../gcc-3.3.6/gcc/collect2.c:1575:20:
> /usr/include/x86_64-linux-gnu/bits/fcntl2.h:51:24: erro: call to
> ‘__open_missing_mode’ declared with attribute error: open with O_CREAT
> in second argument needs 3 arguments
> make[3]: ** [collect2.o] Erro 1
> make[3]: Saindo do diretório
> `/home/antunes/nestedvm/nestedvm/upstream/build/gcc-obj/gcc'
>
> So I have changed the code on collect2.c to include the following
> parameter: 0664
>
> /* Open response file. */
> // original:
> // redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
> // modificado
> redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT,0664);
>
> Now, it all looked good until I had a buffer overflow error as follows.
>
> I did a search on the forum and found Andre with the same error here:
> https://lists.hcoop.net/pipermail/nestedvm/2011-May/000116.html
>
> But I could not find how he fixed the same error. Any one knows how to do it?
>
> I intend to collect instructions on how to complete this build and
> send it to the list once I have all figured out.
>
> Thanks.
>
> Carlos.
>
> Here is the error:
>
>
> *** buffer overflow detected ***: mips-unknown-elf-ar terminated
> ======= Backtrace: =========
> /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x2b7246c177f7]
> /lib/x86_64-linux-gnu/libc.so.6(+0xf7710)[0x2b7246c16710]
> /lib/x86_64-linux-gnu/libc.so.6(+0xf6b79)[0x2b7246c15b79]
> /lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xdd)[0x2b7246b94e7d]
> /lib/x86_64-linux-gnu/libc.so.6(_IO_padn+0xf0)[0x2b7246b89450]
> /lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x228a)[0x2b7246b6877a]
> /lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x94)[0x2b7246c15c14]
> /lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x2b7246c15b5d]
> mips-unknown-elf-ar[0x407359]
> mips-unknown-elf-ar[0x40932f]
> mips-unknown-elf-ar[0x40cc79]
> mips-unknown-elf-ar[0x404afd]
> mips-unknown-elf-ar[0x4050b5]
> mips-unknown-elf-ar[0x402638]
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x2b7246b4030d]
> mips-unknown-elf-ar[0x402935]
> ======= Memory map: ========
> 00400000-0046b000 r-xp 00000000 08:05 39061427
> /home/antunes/nestedvm/nestedvm/upstream/install/bin/mips-unknown-elf-ar
> 0066a000-0066b000 r--p 0006a000 08:05 39061427
> /home/antunes/nestedvm/nestedvm/upstream/install/bin/mips-unknown-elf-ar
> 0066b000-0066c000 rw-p 0006b000 08:05 39061427
> /home/antunes/nestedvm/nestedvm/upstream/install/bin/mips-unknown-elf-ar
> 0066c000-0066e000 rw-p 00000000 00:00 0
> 016c6000-01810000 rw-p 00000000 00:00 0 [heap]
> 2b72468fc000-2b724691d000 r-xp 00000000 08:05 28970246
> /lib/x86_64-linux-gnu/ld-2.13.so
> 2b724691d000-2b724691f000 rw-p 00000000 00:00 0
> 2b7246b1c000-2b7246b1d000 r--p 00020000 08:05 28970246
> /lib/x86_64-linux-gnu/ld-2.13.so
> 2b7246b1d000-2b7246b1f000 rw-p 00021000 08:05 28970246
> /lib/x86_64-linux-gnu/ld-2.13.so
> 2b7246b1f000-2b7246cb4000 r-xp 00000000 08:05 28970239
> /lib/x86_64-linux-gnu/libc-2.13.so
> 2b7246cb4000-2b7246eb3000 ---p 00195000 08:05 28970239
> /lib/x86_64-linux-gnu/libc-2.13.so
> 2b7246eb3000-2b7246eb7000 r--p 00194000 08:05 28970239
> /lib/x86_64-linux-gnu/libc-2.13.so
> 2b7246eb7000-2b7246eb8000 rw-p 00198000 08:05 28970239
> /lib/x86_64-linux-gnu/libc-2.13.so
> 2b7246eb8000-2b7246ec1000 rw-p 00000000 00:00 0
> 2b7246ec1000-2b724740a000 r--p 00000000 08:05 4587586
> /usr/lib/locale/locale-archive
> 2b724740a000-2b7247411000 r--s 00000000 08:05 28970381
> /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
> 2b724742f000-2b7247444000 r-xp 00000000 08:05 28967762
> /lib/x86_64-linux-gnu/libgcc_s.so.1
> 2b7247444000-2b7247643000 ---p 00015000 08:05 28967762
> /lib/x86_64-linux-gnu/libgcc_s.so.1
> 2b7247643000-2b7247644000 r--p 00014000 08:05 28967762
> /lib/x86_64-linux-gnu/libgcc_s.so.1
> 2b7247644000-2b7247645000 rw-p 00015000 08:05 28967762
> /lib/x86_64-linux-gnu/libgcc_s.so.1
> 7fff311c1000-7fff311e5000 rw-p 00000000 00:00 0 [stack]
> 7fff311ff000-7fff31200000 r-xp 00000000 00:00 0 [vdso]
> ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0
> [vsyscall]
> make[4]: *** [libgcc.a] Abortado
> make[4]: ** Apagando arquivo `libgcc.a'
> make[4]: Saindo do diretório
> `/home/antunes/nestedvm/nestedvm/upstream/build/gcc-obj/gcc'
> make[3]: ** [stmp-multilib] Erro 2
> make[3]: Saindo do diretório
> `/home/antunes/nestedvm/nestedvm/upstream/build/gcc-obj/gcc'
> make[2]: ** [all-gcc] Erro 2
> make[2]: Saindo do diretório
> `/home/antunes/nestedvm/nestedvm/upstream/build/gcc-obj'
> make[1]: ** [tasks/build_gcc] Erro 2
> make[1]: Saindo do diretório `/home/antunes/nestedvm/nestedvm/upstream'
> make: ** [upstream/tasks/build_gcc] Erro 2
More information about the Nestedvm
mailing list