On Sat, Dec 22, 2018 at 1:14 PM Kevin 'ldir' Darbyshire-Bryant
<[email protected]> wrote:
>
>
>
> > On 22 Dec 2018, at 18:28, Hauke Mehrtens <[email protected]> wrote:
> >
> >
> > Hi Yousong,
> >
> > ASLR is currently not activated by default in OpenWrt, so the binary itself 
> > is not randomized. Activate CONFIG_PKG_ASLR_PIE to compile Openwrt with 
> > ASLR, but this increases the size of the binary.
> >
> > I haven't understood why some parts of the busybox binary and other 
> > binaries are mapped rwx, when I look into it with readelf no section is 
> > mapped rwx, but it looks like some sections are ending at an not page 
> > aligned offset and the next section starts directly after that. I assume 
> > that Linux merges the permissions when one page needs different permissions.
> >
> > I am still not sure if the common mips CPUs (24Kec, 74Kec) support 
> > restricting execution on pages anyway.
> >
> > Huake
>
> At the risk of going further down the rabbit hole/off topic, if you set the 
> cpu_has_rixi to 1 in  
> target/linux/ath79/patches-4.14/0014-MIPS-ath79-finetune-cpu-overrides.patch 
> and with PKG_ASLR_PIE [=y]
Hauke mentioned on IRC that CPU_MIPSR2 in the kernel's Kconfig enables
CPU_HAS_RIXI. grep the openwrt for RIXI to see what I mean.

HOWEVER, bcm47xx, ar71xx, ath79, mt7621, and a few others set
cpu_has_rixi to 0. This is significant as several CPUs in OpenWrt like
mt7620 should probably also be setting it if mt7621 is correct for
example.

This has to be bogus. I will definitely be run testing mt7621 device
to see if anything happens.
>
> you get:
> cat /proc/self/maps
> 00400000-0047a000 r-xp 00000000 1f:03 1825       /bin/busybox
> 00489000-0048a000 r--p 00079000 1f:03 1825       /bin/busybox
> 0048a000-0048b000 rw-p 0007a000 1f:03 1825       /bin/busybox
> 77e38000-77e5d000 r-xp 00000000 1f:03 2298       /lib/libgcc_s.so.1
> 77e5d000-77e5e000 rw-p 00015000 1f:03 2298       /lib/libgcc_s.so.1
> 77e5e000-77ef1000 r-xp 00000000 1f:03 2474       /lib/libc.so
> 77f00000-77f02000 rw-p 00092000 1f:03 2474       /lib/libc.so
> 77f02000-77f04000 rw-p 00000000 00:00 0
> 7f9bd000-7f9de000 rw-p 00000000 00:00 0          [stack]
> 7fefb000-7fefc000 r-xp 00000000 00:00 0
> 7ff68000-7ff69000 r--p 00000000 00:00 0          [vvar]
> 7ff69000-7ff6a000 r-xp 00000000 00:00 0          [vdso]
>
>
> The archer hasn’t blown up…….yet
>
> Cheers,
>
> Kevin D-B
>
> 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A
>
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to