fix i386 __set_thread_area fallback
authorRich Felker <dalias@aerifal.cx>
Mon, 31 Aug 2020 01:37:12 +0000 (21:37 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 31 Aug 2020 01:37:12 +0000 (21:37 -0400)
this code is only needed for pre-2.6 kernels, which are not actually
supported anyway, and was never tested. the fallback path using
SYS_modify_ldt failed to clear the upper bits of %eax (all ones due to
SYS_set_thread_area's return value being an error) before modifying
%al to attempt a new syscall.

src/thread/i386/__set_thread_area.s

index c2c21dd..aa6852b 100644 (file)
@@ -28,6 +28,7 @@ __set_thread_area:
        ret
 2:
        mov %ebx,%ecx
+       xor %eax,%eax
        xor %ebx,%ebx
        xor %edx,%edx
        mov %ebx,(%esp)