lkml.org 
[lkml]   [2017]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v9 for 4.15 01/14] Restartable sequences system call
From
Date
On 10/13/2017 03:40 PM, Mathieu Desnoyers wrote:
> The proposed ABI does not require to store any function pointer. For a given
> rseq_finish() critical section, pointers to specific instructions (within a
> function) are emitted at link-time into a struct rseq_cs:
>
> struct rseq_cs {
> RSEQ_FIELD_u32_u64(start_ip);
> RSEQ_FIELD_u32_u64(post_commit_ip);
> RSEQ_FIELD_u32_u64(abort_ip);
> uint32_t flags;
> } __attribute__((aligned(4 * sizeof(uint64_t))));
>
> Then, at runtime, the fast-path stores the address of that struct rseq_cs
> into the TLS struct rseq "rseq_cs" field.
>
> So all we store at runtime is a pointer to data, not a pointer to functions.
>
> But you seem to hint that having a pointer to data containing pointers to code
> may still be making it easier for exploit writers. Can you elaborate on the
> scenario ?

I'm concerned that the exploit writer writes a totally made up struct
rseq_cs object into writable memory, along with function pointers, and
puts the address of that in to the rseq_cs field.

This would be comparable to how C++ vtable pointers are targeted
(including those in the glibc libio implementation of stdio streams).

Does this answer your questions?

Thanks,
Florian

\
 
 \ /
  Last update: 2017-10-13 15:57    [W:0.100 / U:40.672 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site