Re: [RFC 11/14] x86: add support for Dynamic Kernel Stacks

From: Nadav Amit
Date: Tue Mar 12 2024 - 03:21:04 EST




> On 12 Mar 2024, at 2:02, Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>
> Doesn't this buy a new problem? Install a page, run the thread without using the page but speculatively load the PTE as read-only into the TLB, context-switch out the thread, (entirely safely and correctly) determine that the page wasn't used, remove it from the PTE, use it for something else and fill it with things that aren't zero, run the thread again, and read from it. Now it has some other thread's data!

Yes, you are correct. Bad idea of mine. Regardless of data leak, it opens the door for subtle hard-to-analyze bugs where 2 reads return different values.