i trying compile -msecure-plt, , although compilation completing fine, when looking @ memory maps doesn't flag doing anything. assuming not doing because got , plt sections both still in rwxp
segements.
dump of assembler code function main: 0x1000061c <+0>: stwu r1,-16(r1) 0x10000620 <+4>: mflr r0 0x10000624 <+8>: stw r0,20(r1) 0x10000628 <+12>: stw r31,12(r1) 0x1000062c <+16>: mr r31,r1 0x10000630 <+20>: bl 0x1001096c <libfunc@plt> 0x10000634 <+24>: mr r10,r3 0x10000638 <+28>: lis r9,4096 0x1000063c <+32>: addi r3,r9,2048 0x10000640 <+36>: mr r4,r10 0x10000644 <+40>: crclr 4*cr1+eq 0x10000648 <+44>: bl 0x10010964 <printf@plt> => 0x1000064c <+48>: li r9,1 0x10000650 <+52>: mr r3,r9 0x10000654 <+56>: addi r11,r31,16 0x10000658 <+60>: lwz r0,4(r11) 0x1000065c <+64>: mtlr r0 0x10000660 <+68>: lwz r31,-4(r11) 0x10000664 <+72>: mr r1,r11 0x10000668 <+76>: blr
with /proc/<pid>/maps
showing memory map of
00100000-00103000 r-xp 00000000 00:00 0 [vdso] 0fe40000-0ffb8000 r-xp 00000000 00:01 6285 /lib/libc-2.22.so 0ffb8000-0ffc7000 ---p 00178000 00:01 6285 /lib/libc-2.22.so 0ffc7000-0ffc9000 r--p 00177000 00:01 6285 /lib/libc-2.22.so 0ffc9000-0ffcd000 rwxp 00179000 00:01 6285 /lib/libc-2.22.so 0ffcd000-0ffcf000 rwxp 00000000 00:00 0 0ffdf000-0ffe0000 r-xp 00000000 00:01 5928 /lib/libmaintest.so 0ffe0000-0ffef000 ---p 00001000 00:01 5928 /lib/libmaintest.so 0ffef000-0fff0000 rwxp 00000000 00:01 5928 /lib/libmaintest.so 10000000-10001000 r-xp 00000000 00:01 5934 /root/main 10010000-10011000 rwxp 00000000 00:01 5934 /root/main b7860000-b7882000 r-xp 00000000 00:01 6240 /lib/ld-2.22.so b7890000-b7892000 rw-p 00000000 00:00 0 b7892000-b7893000 r--p 00022000 00:01 6240 /lib/ld-2.22.so b7893000-b7895000 rwxp 00023000 00:01 6240 /lib/ld-2.22.so bff1a000-bff3b000 rw-p 00000000 00:00 0 [stack]
which sticks both of plot jumps right middle of rwx
section. misinterpreting information?
i think might kernel limitation: see e.g. https://lkml.org/lkml/2016/8/8/354 - looks kernel maps things in ways wouldn't expect understand historical reasons.
it may changing soon, given patch above sent yesterday.
Comments
Post a Comment