-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply TBI to virtual addresses on aarch64. #310
Conversation
On non-KASAN configurations, this could lead us to read from bogus addresses with garbage in the most significant bits without realizing this, right? If there's an easy way to avoid this, it'd be nice to, but otherwise it's not a huge deal. I also wonder whether it makes sense to apply this mask earlier than in the page table iterator. |
In most cases with garbage addresses it seems unlikely that bits 56..63 will contain garbage without bits VA_BITS..55 also containing garbage, so I don't think we lose much by masking out these bits.
Yes, the KASAN state isn't really exposed very easily. We could do something like check for the presence of KASAN-specific symbols in the kernel symbol table, but with HW tags KASAN there's also a runtime component to whether KASAN is enabled (it can be disabled with
I think it makes sense. We could have something like an arch-specific hook for fixing up tagged addresses (similar to
For my remote target support, I just have one direct mapping in virtual space of size 4096 for the swapper page table and everything else uses the page table reader. I hadn't looked at the |
Done in the new patch. |
In tag-based KASAN modes, TCR_EL1.TBI1 is enabled, which causes the top 8 bits of virtual addresses to be ignored for address translation purposes. Do the same when reading from memory. There is no harm in doing so unconditionally, as the architecture does not support >56 bit VA sizes. Signed-off-by: Peter Collingbourne <[email protected]>
Rebased; ping. I needed to patch this in so that I could test #376 with tag-based KASAN. |
Thanks! |
In tag-based KASAN modes, TCR_EL1.TBI1 is enabled, which causes the top 8 bits of virtual addresses to be ignored for address translation purposes. Do the same in the page table iterator. There is no harm in doing so unconditionally, as the architecture does not support >56 bit VA sizes.