x86_64: ensure that dtor pointer passed to app is 0 so it won't be used
authorRich Felker <dalias@aerifal.cx>
Sun, 19 Jun 2011 12:33:27 +0000 (08:33 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 19 Jun 2011 12:33:27 +0000 (08:33 -0400)
leaving it uninitialized caused unpredictable crashes or worse due to
calling an indeterminate function pointer.

src/ldso/x86_64/start.s

index efb274545a4da2c0d799c700ef55738ddf4e5408..cb0a9e1f22220708cc70787eb65d0e4bf1c64c8c 100644 (file)
@@ -5,4 +5,5 @@ _start:
        lea 8(%rsp),%rsi
        lea _GLOBAL_OFFSET_TABLE_(%rip),%rdx
        call __dynlink
+       xor %edx,%edx
        jmp *%rax