From: Chen Jiahao chenjiahao16@huawei.com
hulk inclusion category: bugfix bugzilla: 174525 https://gitee.com/openeuler/kernel/issues/I4DDEL
--------
In arm64be_ilp32 platform, audit could not record log in some case, because syscall_get_arch() in arch/arm64 returns AUDIT_ARCH_AARCH64ILP32, which fits the arm32 platform. Audit will gets a fault arch in this situation and hence mismatch some syscall numbers in audit_match_perm().
This patch fixes it, and use the arch AUDIT_ARCH_AARCH64 which matches all syscall numbers in arm64be_ilp32 platform.
Fixes: 0fe4141ba63a ("[Backport] arm64: introduce AUDIT_ARCH_AARCH64ILP32 for ilp32") Signed-off-by: Chen Jiahao chenjiahao16@huawei.com Reviewed-by: Liao Chang liaochang1@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com --- arch/arm64/include/asm/syscall.h | 3 --- include/uapi/linux/audit.h | 1 - 2 files changed, 4 deletions(-)
diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 6e546ec398b3..579300bb03fe 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -95,9 +95,6 @@ static inline int syscall_get_arch(struct task_struct *task) if (is_a32_compat_thread(task_thread_info(task))) return AUDIT_ARCH_ARM;
- else if (is_ilp32_compat_task()) - return AUDIT_ARCH_AARCH64ILP32; - return AUDIT_ARCH_AARCH64; }
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index b585d043a44a..cd2d8279a5e4 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -381,7 +381,6 @@ enum { #define __AUDIT_ARCH_LE 0x40000000
#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) -#define AUDIT_ARCH_AARCH64ILP32 (EM_AARCH64|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARCOMPACT (EM_ARCOMPACT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARCOMPACTBE (EM_ARCOMPACT)