NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/41875: pax_aslr_elf() use wrong lsb number

>Number:         41875
>Category:       kern
>Synopsis:       pax_aslr_elf() use wrong lsb number
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 12 10:50:00 +0000 2009
>Originator:     Manuel Bouyer
>Release:        NetBSD 5.0_STABLE
System: NetBSD disco 5.0_STABLE NetBSD 5.0_STABLE (DISCO) #3: Fri Aug 7 
08:59:42 MEST 2009 
bouyer@disco:/home/bouyer/src-5/src/sys/arch/i386/compile/obj/DISCO i386
Architecture: i386
Machine: i386
        In pax_aslr_elf() we read:

        if (pax_align == 0)
                pax_align = PGSHIFT;
        uprintf("r=0x%x a=0x%x p=0x%x Delta=0x%lx\n", r,
            ilog2(pax_align), PGSHIFT, PAX_ASLR_DELTA(r,
                ilog2(pax_align), PAX_ASLR_DELTA_EXEC_LEN));
        pax_offset = ELF_TRUNC(PAX_ASLR_DELTA(r,
            ilog2(pax_align), PAX_ASLR_DELTA_EXEC_LEN), pax_align);

        PAX_ASLR_DELTA() expects a number of bits so should get
        pax_align, not ilog2(pax_align).
        ELF_TRUNC() expects a size in bytes, so should get (1 << pax_align)
        not pax_align.

        code inspection
                pax_align = PGSHIFT;
                pax_align = NBPG;
        maybe ?

Home | Main Index | Thread Index | Old Index