Commit 78063a9d authored by Andrey Konovalov's avatar Andrey Konovalov Committed by Linus Torvalds
Browse files

tee/shm: untag user pointers in tee_shm_register

This patch is a part of a series that extends kernel ABI to allow to pass
tagged user pointers (with the top byte set to something else other than
0x00) as syscall arguments.

tee_shm_register()->optee_shm_unregister()->check_mem_type() uses provided
user pointers for vma lookups (via __check_mem_type()), which can only by
done with untagged pointers.

Untag user pointers in this function.


Signed-off-by: default avatarAndrey Konovalov <>
Reviewed-by: default avatarKees Cook <>
Acked-by: Jens Wiklander's avatarJens Wiklander <>
Cc: Al Viro <>
Cc: Catalin Marinas <>
Cc: Dave Hansen <>
Cc: Eric Auger <>
Cc: Felix Kuehling <>
Cc: Khalid Aziz <>
Cc: Mauro Carvalho Chehab <>
Cc: Mike Rapoport <>
Cc: Vincenzo Frascino <>
Cc: Will Deacon <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent e275faf3
......@@ -254,6 +254,7 @@ struct tee_shm *tee_shm_register(struct tee_context *ctx, unsigned long addr,
shm->teedev = teedev;
shm->ctx = ctx;
shm->id = -1;
addr = untagged_addr(addr);
start = rounddown(addr, PAGE_SIZE);
shm->offset = addr - start;
shm->size = length;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment