Commit 983fdfeb authored by Chen Jiahao's avatar Chen Jiahao Committed by Jinjie Ruan
Browse files

arm64: fix image size inflation with CONFIG_COMPAT_TASK_SIZE

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8JVJ3


CVE: NA

-------------------------------

Previous patch 605330751290 ("[Huawei] arm64: set 32-bit compatible
TASK_SIZE_MAX to fix U32 libc_write_01 error") has fixed libc_write_01
testcase failed in U32 mode.

However above patch introduced image size inflation when CONFIG_ARM64_ILP32
and CONFIG_AARCH32_EL0 both set. Here fix the problem by testing
current_thread_info()->flags with (_TIF_32BIT | _TIF_32BIT_AARCH64),
rather than calling test_thread_flag() twice.

Fixes: 605330751290 ("[Huawei] arm64: set 32-bit compatible TASK_SIZE_MAX to fix U32 libc_write_01 error")
Signed-off-by: default avatarChen Jiahao <chenjiahao16@huawei.com>
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent 880fd21c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -63,7 +63,12 @@ static inline int is_ilp32_compat_thread(struct thread_info *thread)

static inline int is_compat_task(void)
{
#if defined(CONFIG_ARM64_ILP32) && defined(CONFIG_AARCH32_EL0)
	return READ_ONCE(current_thread_info()->flags) &
		(_TIF_32BIT | _TIF_32BIT_AARCH64);
#else
	return is_a32_compat_task() || is_ilp32_compat_task();
#endif
}

#endif /* CONFIG_COMPAT */