Hola
Cuando paso el valor al cuarto argumento rcx, al llamar la syscall el valor se torna nuló, es lo que muestra kdump, ¿A que se debe?.
.section .text
.globl _start
_start:
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
movb $0x6, %dl
addb $0x61, %al
syscall
xchgq %rax, %rdi
incq %r8
incq %rsi
leaq 0x8(%rsp), %rcx
movb $0x69, %al
syscall
CALL socket(PF_INET,SOCK_STREAM,IPPROTO_TCP)
RET socket 3
CALL setsockopt(0x3,0x2,0x6,0,0x1)
RET setsockopt -1 errno 22 Invalid argument
PSIG SIGSEGV SIG_DFL code SEGV_MAPERR<1> addr=0x16 trapno=6
Un saludo.
Ya solucioné el problema, la instrucción syscall salva rip en rcx lo "destruye", se tiene que usar r10.
Un saludo.