arm64: fix current_thread_info()->addr_limit setup
hulk inclusion category: bugfix bugzilla: 51408 CVE: NA ------------------------------------------------------------------------- At elf loading in flush_old_exec() in fs/exec.c, generic code sets current_thread_info()->addr_limit to one that corresponds aarch64 value, and ignores compat mode there as corresponding status setup happens later on in load_elf_binary() by SET_PERSONALITY() macro. As result, compat task has wrong addr_limit, and it may cause various bugs. This patch fixes it. It also fixes USER_DS macro to return different values depending on compat at runtime. It was discovered during ilp32 development. See details here: https://lkml.org/lkml/2016/5/11/975 v2: flush tpidrro_el0 unconditionally in tls_thread_flush() as if exec() is called by aarch64 task, is_compat_task() fails even if new thread is aarch32. Signed-off-by:Yury Norov <ynorov@caviumnetworks> Signed-off-by:
Zhou Chengming <zhouchengming1@huawei.com> Signed-off-by:
Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by:
Xiongfeng Wang <wangxiongfeng2@huawei.com> Reviewed-by:
Hanjun Guo <guohanjun@huawei.com> Signed-off-by:
zhangyi (F) <yi.zhang@huawei.com> Conflicts: arch/arm64/include/asm/uaccess.h arch/arm64/kernel/process.c fs/exec.c [wang: expand macro USER_DS in entry.S according to commit: ee20d8797f06 ("arm64: Make USER_DS an inclusive limit")] Signed-off-by:
Xiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by:
Jiahao Chen <chenjiahao16@huawei.com> Reviewed-by:
Chang Liao <liaochang1@huawei.com> Signed-off-by:
Chen Jun <chenjun102@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment