Thread (17 messages) flat view 17 messages, 5 authors, 2018-06-29

Re: [RFC PATCH for 4.18 1/2] rseq: validate rseq_cs fields are < TASK_SIZE

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2018-06-29 00:18:38
Also in: lkml

On Thu, Jun 28, 2018 at 4:30 PM Andy Lutomirski [off-list ref] wrote:
The idea is that, if someone screws up and sticks a number like
0xbaadf00d00045678 into their rseq abort_ip in a 32-bit x86 program
(when they actually mean 0x00045678), we want to something consistent.
I think the "something consistent" is perfectly fine with just "it won't work".

Make it do

        if (rseq_cs->abort_ip != (unsigned long)rseq_cs->abort_ip)
                return -EINVAL;

at abort time.

Done.

If it's a 32-bit kernel, the above will reject the thing, and if it's
a 64-bit kernel, it will be a no-op, but the abort won't work in a
32-bit caller.

Problem solved.

             Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help