On Fri, Mar 09, 2018 at 07:17:14PM +0100, Andrey Konovalov wrote: > On Mon, Mar 5, 2018 at 3:36 PM, Mark Rutland <mark.rutland@xxxxxxx> wrote: > > On Fri, Mar 02, 2018 at 08:44:25PM +0100, Andrey Konovalov wrote: > >> KHWASAN uses the Top Byte Ignore feature of arm64 CPUs to store a pointer > >> tag in the top byte of each pointer. This commit enables the TCR_TBI1 bit, > >> which enables Top Byte Ignore for the kernel, when KHWASAN is used. > >> --- > >> arch/arm64/include/asm/pgtable-hwdef.h | 1 + > >> arch/arm64/mm/proc.S | 8 +++++++- > >> 2 files changed, 8 insertions(+), 1 deletion(-) > > > > Before it's safe to do this, I also think you'll need to fix up at > > least: > > * access_ok() > > This is used for accessing user addresses, and they are not tagged. Am > I missing something? No, I just confused myself. ;) I was converned that a kernel address with the top byte clear might spuriously pass access_ok(), but I was mistaken. Bit 55 of the address would be set, and this would fall outside of USER_DS (which is TASK_SIZE_64 - 1). So access_ok() should be fine as-is. Sorry for the noise! Mark.