Re: [PATCH] ASLRv3: randomize_va_space=3 preventing offset2lib attack

From: Andy Lutomirski
Date: Fri Dec 12 2014 - 12:17:32 EST


On Dec 12, 2014 8:33 AM, "Hector Marco" <hecmargi@xxxxxx> wrote:
>
> Hello,
>
> I agree. I don't think a new randomization mode will be needed, just fix
> the current randomize_va_space=2. Said other way: fixing the offset2lib
> will not break any current program and so, no need to add additional
> configuration options. May be we shall wait for some inputs
> from the list (may be we are missing something).
>
>
> Regarding to VDSO, definitively, is not randomized enough in 64bits.
> Brute force attacks would be pretty fast even from the network.
> I have identified the bug and seems quite easy to fix it.
>
> On 32bit systems, this is not a issue because it is mapped in the
> mmap area. In order to fix the VDSO on 64bit, the following
> considerations shall
> be discussed:
>
>
> Performance:
> It seems (reading the kernel comments) that the random allocation
> algorithm tries to place the VDSO in the same PTE than the stack.

The comment is wrong. It means PTE table.

> But since the permissions of the stack and the VDSO are different
> it seems that are getting right the opposite.

Permissions have page granularity, so this isn't a problem.

>
> Effectively VDSO shall be correctly randomized because it contains
> enough useful exploitable stuff.
>
> I think that the possible solution is follow the x86_32 approach
> which consist on map the VDSO in the mmap area.
>
> It would be better fix VDSO in a different patch ? I can send a
> patch which fixes the VDSO on 64 bit.
>

What are the considerations for 64-bit memory layout? I haven't
touched it because I don't want to break userspace, but I don't know
what to be careful about.

--Andy

>
>
> Regards,
> Hector Marco.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/