Odin icon indicating copy to clipboard operation
Odin copied to clipboard

fix 6 argument syscall on i386

Open jasonKercher opened this issue 1 year ago • 0 comments

It looks like the routine where we put the rest of the arguments (>6) on the stack and pass their address in ebp wouldn't apply until arg_count == 8 which fails GB_ASSERT(arg_count <= 7); anyway. I don't know about the other systems, but there currently exists no system call with more than 6 arguments in Linux (Fixes #3512).

From linux/arch/x86/entry/entry_32.S:

/*
...
 *
 * Arguments:
 * eax  system call number
 * ebx  arg1
 * ecx  arg2
 * edx  arg3
 * esi  arg4
 * edi  arg5
 * ebp  arg6
 */
SYM_FUNC_START(entry_INT80_32)
        ASM_CLAC
        pushl   %eax                    /* pt_regs->orig_ax */

        SAVE_ALL pt_regs_ax=$-ENOSYS switch_stacks=1    /* save rest */

        movl    %esp, %eax
        call    do_int80_syscall_32
.Lsyscall_32_done:

jasonKercher avatar May 11 '24 03:05 jasonKercher