[oss] [Lab 02][Task 5] mark .data as executable

Radu Caragea sinaelgl at gmail.com
Sat Oct 25 17:10:20 EEST 2014


Can you try and run "execstack -s task5" after compiling and check if it works ?

On Sat, Oct 25, 2014 at 5:06 PM, Alex Teaca <ionutalex.teaca at gmail.com> wrote:
>
> Hello !
>
> For the task 5, I try to mark the .data section as executable.
> I tried in gdb to call the mprotect function:
>
> (gdb) call mprotect(0x0804a010, 4, 0x1|0x2|0x4)
> $1 = -1
> , where the 0x0804a010 is the address of .data section found with objdump.
> You see that mprotect returns error.
>
> Also, I tried to compile with -S flag, and update the task5.s with
> ".section .data,"awx", at progbits"
> but, when I compile, I get
>
> gcc -C task5.s
> test5.s: Assembler messages:
> test5.s:5: Warning: ignoring changed section attributes for .data
>
> and the .data section remains WA.
>
> So, how can I run code from .data section ?
>
> Thanks, Alex
>
>
> _______________________________________________
> http://elf.cs.pub.ro/oss/wiki/resources/mailing-list


More information about the oss mailing list