In the following code after calling 'access' system call, 0xfffffffe is present in EAX. While in case of success, 'access' system call returns 0. Here I am trying to access the memory which is part of the data section. Then why 'access' is returning 0xfffffffe ?
global _start section .text _start: mov eax, 0x21 ; Access system call mov ebx, message mov ecx, 0 ; F_OK int 0x80 section .data message:dd 0,0,0,0,0,0,0
I am following the below-mentioned paper.
I am copy pasting the following lines from page number 7 and 8 of the paper.
'access' system call is preferred because "the pathname pointer is the argument that will be used to do the address validation. Since pathname is the first argument, it means that the ebx register will need to point to the address that needs to be validated."
And if we see in the following code author has used 'access' system call to validate EBX register. Following code is present on page number 8 of the paper.
User contributions licensed under CC BY-SA 3.0