From patchwork Fri Feb 23 14:27:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 129368 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp667969lja; Fri, 23 Feb 2018 06:27:45 -0800 (PST) X-Google-Smtp-Source: AH8x2258bGU01lhAbMal1yyaETKeoLOuuQ/qwuU7PrGCoUySDG+dHtg3tNBh8QBf8jwaJ9BEAY5N X-Received: by 10.98.67.78 with SMTP id q75mr1947378pfa.98.1519396065367; Fri, 23 Feb 2018 06:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519396065; cv=none; d=google.com; s=arc-20160816; b=GqpnoCnthPsqmTrp6KAIRVfJHSS56ELjU/7v0v/hKNBDZ7anLHHYhtKoHgAykDeDnh OFol9vGx+70PuKHOoSc8hFSG0SeTv0JHE4ma+ozHZEY/B6skM5YUHWD248hRO7uGH3vR cXuR5AU2did4KgHHhzjYxLEXKGlhiyHbJ8n9wX2ZVDk5TBrZ2RATsHmD7un7lUeXLk+H Oz25x9+wQ7TlMjL6IwCq33OMnU/9cvyAQ7qL4xo1610Kme4+m2pmR+ySha4a0oqFEzZk 4649DfQqEHMpXeyk/1BU0zUfrr0JwZ3bmcrtVh5Gub4yUB41/gsn+WJ268zOz8wGcpv8 /leg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=Sp/790WR3Lw2rA78dGSxwUbQKRm4jzpuHDau1gvNi1M=; b=UvDtfS0s9+J/FHKyf/Us4sfPLmEsrvz+/6aiCIn6D+m1zkPJ6W+W5tR0qir3W7yd9F iMfOpkongccHZouS5tZHajgAFereLlxXBozirzXXqr/vwaLAZtHcQUgOUxZGzrZ/0u/D XVQCQT3rP84s1SQmy1Dw5Y8CZ4UutMBgf8TRlSDnqTvoSoeDNlUKUhcbSE2XUyL5RA9+ a9EcCIyudflLFfNJ5NDykUhg5ehwUY2/MVhUOf09GjgL2C4WialEIVUHIK+5WDaEiHTL dLI7GISTKcOIMbq5IxHOEmLM1KLJCnrtDK1uwiO50EMBoe+QBomdcEBVAJ2TDKZJGD8O OdQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=iAIdwn9o; spf=pass (google.com: domain of gcc-patches-return-473755-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-473755-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a2si1593667pgd.452.2018.02.23.06.27.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 06:27:45 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-473755-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=iAIdwn9o; spf=pass (google.com: domain of gcc-patches-return-473755-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-473755-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; q=dns; s=default; b=SohCaEgCb7EQr3h SgybhX5MgAztxPiCQmUJccrz0VJSm8vcudYbM6v4mtmRKMAtKjRivSO0oNPWeFvP zHg9aGI0I9/xQMnzYD1fnuL04Es7LMiD5/ibd9f4Gc7Qm6Okj9QItz7pjcyJsURn D4KmtLtqnrjyTdWtFrkfGXNXXegY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; s=default; bh=Pt0fO8u2YqMevSdKXjPRv Do9KJM=; b=iAIdwn9olhIwIiKE8WJHb9pBPIb3z9NFaVENx62bAFC2NzL1KA7mm xMYckkwpB4Omc73FEBcs9vzWXCnPnnpq38l2WPWSzi0hlq/PAsAo6VFFQFFTHTHd f6vhB4a4fRXGL7db1abNa8tXmSgN9kyJOC86+FgvP738BETLdQ4qqY= Received: (qmail 72821 invoked by alias); 23 Feb 2018 14:27:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 72806 invoked by uid 89); 23 Feb 2018 14:27:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=44511, whence X-HELO: mail-vk0-f66.google.com Received: from mail-vk0-f66.google.com (HELO mail-vk0-f66.google.com) (209.85.213.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Feb 2018 14:27:28 +0000 Received: by mail-vk0-f66.google.com with SMTP id y127so5448013vky.9 for ; Fri, 23 Feb 2018 06:27:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Sp/790WR3Lw2rA78dGSxwUbQKRm4jzpuHDau1gvNi1M=; b=M3O+9DeFZaAvNgstFOLsit/dszhJvi19bwBpmv15FPImz1edA9PEK9sPaph301smYL JFLeSRQP2MtBQKM1wPeXcPOFm4meREf9Rf2NlEns878OS/TNmPTux3KrtDBtHaG/gvVT kL1Zu/j4pfR7gFQeCfI3KAifbG4yxI/0rTjRn8AaIoa/E1dN6Ekl6tNn6zugob7DUrZh dVAFccZCwMpp0Dxq3YHdMplwGsPbPUdqKd0waRySgQHqrPGo+Cxk0kon/JXqlbJmODG0 G5cmOHHD4K9swX3weBc4sRWPQauiGecByxnAzrEmcA8iwwCKgy2z603xRXTD5cE2eYOV UZ3w== X-Gm-Message-State: APf1xPAiIF+XCNqao1RUrBsglTxGhzGQU/13ndWvEnC4d77mX6nTNayk nzhVxL2J+Fpwzd+/3/FuCQFlvx8aQuU= X-Received: by 10.31.181.213 with SMTP id e204mr1225377vkf.122.1519396046593; Fri, 23 Feb 2018 06:27:26 -0800 (PST) Received: from localhost.localdomain ([179.159.9.95]) by smtp.googlemail.com with ESMTPSA id i64sm530969vkg.39.2018.02.23.06.27.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Feb 2018 06:27:26 -0800 (PST) From: Adhemerval Zanella To: gcc-patches@gcc.gnu.org Subject: [PATCH] Add sanitizer support for AArch64 ILP32 Date: Fri, 23 Feb 2018 11:27:19 -0300 Message-Id: <1519396039-22827-1-git-send-email-adhemerval.zanella@linaro.org> X-IsSubscribed: yes This patch adds asan support for aarch64 ilp32. It is based on 'official' glibc support branch [1] (which is in turn based on Linux branch [2]). Main changes for libsanitizer is the kernel ABI support for internal syscalls. Different than x32, ILP32 tries to leverage 32-bits syscalls with kernel ABI for 64 bit argument passing (ftruncate for instance) are passed using the new Linux generic way for 32 bits (by splitting high and low in two registers). So instead of adding more adhoc defines to ILP32 this patch extends the SANITIZER_USES_CANONICAL_LINUX_SYSCALLS to represent both 64 bits argument syscalls (value of 1) and 32 bits (value of 2). The shadow offset used is similar to the arm one (29). I did a sanity check on aarch64-linux-gnu and x86_64-linux-gnu without any regressions. PS: I sent this change llvm-commit, but it got stalled because llvm lack aarch64 ilp32 support and noone could confirm no breakage due missing buildbot. Also the idea is not sync it back to libsanitizer. gcc/ * gcc/config/aarch64/aarch64.c (aarch64_asan_shadow_offset): Add TARGET_ILP32 support. libsanitizer/ * libsanitizer/sanitizer_common/sanitizer_internal_defs.h (uhwptr, OFF_T, operator_new_size_type): Define for SANITIZER_AARCH64_ILP32. * libsanitizer/sanitizer_common/sanitizer_linux.cc (SYSCALL_LL64): New define: wrap a 64-bit argument for syscall. (internal_ftruncate, internal_stat, internal_lstat, internal_unlink, internal_rename, internal_lseek): Add support for SANITIZER_USES_CANONICAL_LINUX_SYSCALLS equal to 2. (FileExists): Use internal_stat regardless. * libsanitizer/sanitizer_common/sanitizer_platform.h (SANITIZER_AARCH64_ILP32): Define. (SANITIZER_USES_CANONICAL_LINUX_SYSCALLS): Define to 1 or 2 depending of the expected architecture ABI. * libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc (CHECK_SIZE_AND_OFFSET(ipc_perm,mode): Define for AArch64 ILP32. * libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h (struct_kernel_stat_sz, struct_kernel_stat64_sz, __sanitizer___kernel_uid_t, __sanitizer___kernel_gid_t): Likewise. [__sanitizer_dirent] (d_ino, d_off): Likewise. [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/arm/ilp32 [2] git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git --- gcc/config/aarch64/aarch64.c | 5 ++- .../sanitizer_common/sanitizer_internal_defs.h | 12 +++---- libsanitizer/sanitizer_common/sanitizer_linux.cc | 40 ++++++++++++++++++---- libsanitizer/sanitizer_common/sanitizer_platform.h | 15 ++++++-- .../sanitizer_platform_limits_posix.cc | 3 +- .../sanitizer_platform_limits_posix.h | 13 +++++-- 6 files changed, 69 insertions(+), 19 deletions(-) -- 2.7.4 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 33c90ef..eebf85b 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -16171,7 +16171,10 @@ aarch64_split_dimode_const_store (rtx dst, rtx src) static unsigned HOST_WIDE_INT aarch64_asan_shadow_offset (void) { - return (HOST_WIDE_INT_1 << 36); + if (TARGET_ILP32) + return (HOST_WIDE_INT_1 << 29); + else + return (HOST_WIDE_INT_1 << 36); } static rtx diff --git a/libsanitizer/sanitizer_common/sanitizer_internal_defs.h b/libsanitizer/sanitizer_common/sanitizer_internal_defs.h index edd6a21..aef83c2 100644 --- a/libsanitizer/sanitizer_common/sanitizer_internal_defs.h +++ b/libsanitizer/sanitizer_common/sanitizer_internal_defs.h @@ -117,9 +117,9 @@ typedef signed long long sptr; // NOLINT typedef unsigned long uptr; // NOLINT typedef signed long sptr; // NOLINT #endif // defined(_WIN64) -#if defined(__x86_64__) -// Since x32 uses ILP32 data model in 64-bit hardware mode, we must use -// 64-bit pointer to unwind stack frame. +#if defined(__x86_64__) || SANITIZER_AARCH64_ILP32 +// Since x32 adn AArch64 ILP32 use ILP32 data model in 64-bit hardware mode, +// we must use 64-bit pointer to unwind stack frame. typedef unsigned long long uhwptr; // NOLINT #else typedef uptr uhwptr; // NOLINT @@ -144,7 +144,7 @@ typedef int error_t; typedef int pid_t; #if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_MAC || \ - (SANITIZER_LINUX && defined(__x86_64__)) + (SANITIZER_LINUX && (defined(__x86_64__) || SANITIZER_AARCH64_ILP32)) typedef u64 OFF_T; #else typedef uptr OFF_T; @@ -154,8 +154,8 @@ typedef u64 OFF64_T; #if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC typedef uptr operator_new_size_type; #else -# if defined(__s390__) && !defined(__s390x__) -// Special case: 31-bit s390 has unsigned long as size_t. +# if (defined(__s390__) && !defined(__s390x__)) || SANITIZER_AARCH64_ILP32 +// Special case: 31-bit s390 and AArch64 ILP32 have unsigned long as size_t. typedef unsigned long operator_new_size_type; # else typedef u32 operator_new_size_type; diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc index 2826cc8..31f60ff 100644 --- a/libsanitizer/sanitizer_common/sanitizer_linux.cc +++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc @@ -123,8 +123,16 @@ const int FUTEX_WAKE = 1; #if SANITIZER_LINUX && (defined(__x86_64__) || defined(__powerpc64__) || \ SANITIZER_WORDSIZE == 64) # define SANITIZER_LINUX_USES_64BIT_SYSCALLS 1 +# define SYSCALL_LL64(val) (val) #else # define SANITIZER_LINUX_USES_64BIT_SYSCALLS 0 +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define SYSCALL_LL64(val) \ + (long) ((OFF64_T)(val) & 0xffffffff), (long) ((OFF64_T)(val) >> 32) +# else +# define SYSCALL_LL64(val) \ + (long) ((OFF64_T)val >> 32), (long) ((OFF64_T)(val) & 0xffffffff) +# endif #endif #if defined(__x86_64__) || SANITIZER_MIPS64 @@ -227,8 +235,13 @@ uptr internal_ftruncate(fd_t fd, uptr size) { #if SANITIZER_NETBSD HANDLE_EINTR(res, internal_syscall(SYSCALL(ftruncate), fd, 0, (s64)size)); #else +# if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 2 + HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate64), fd, + SYSCALL_LL64((OFF_T)size))); +# else HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd, (OFF_T)size)); +# endif #endif return res; } @@ -304,9 +317,12 @@ uptr internal_stat(const char *path, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_NETBSD return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); -#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 1 return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 2 + return internal_syscall(SYSCALL(fstatat64), AT_FDCWD, (uptr)path, + (uptr)buf, 0); #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS # if defined(__mips64) // For mips64, stat syscall fills buffer in the format of kernel_stat @@ -331,9 +347,12 @@ uptr internal_lstat(const char *path, void *buf) { #elif SANITIZER_FREEBSD return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); -#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 1 return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 2 + return internal_syscall(SYSCALL(fstatat64), AT_FDCWD, (uptr)path, + (uptr)buf, AT_SYMLINK_NOFOLLOW); #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS # if SANITIZER_MIPS64 // For mips64, lstat syscall fills buffer in the format of kernel_stat @@ -406,9 +425,12 @@ uptr internal_unlink(const char *path) { } uptr internal_rename(const char *oldpath, const char *newpath) { -#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 1 return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD, (uptr)newpath); +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 2 + return internal_syscall(SYSCALL(renameat2), AT_FDCWD, (uptr)oldpath, AT_FDCWD, + (uptr)newpath, 0); #else return internal_syscall(SYSCALL(rename), (uptr)oldpath, (uptr)newpath); #endif @@ -445,11 +467,7 @@ uptr internal_execve(const char *filename, char *const argv[], // ----------------- sanitizer_common.h bool FileExists(const char *filename) { struct stat st; -#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS - if (internal_syscall(SYSCALL(newfstatat), AT_FDCWD, filename, &st, 0)) -#else if (internal_stat(filename, &st)) -#endif return false; // Sanity check: filename is a regular file. return S_ISREG(st.st_mode); @@ -729,7 +747,15 @@ uptr internal_lseek(fd_t fd, OFF_T offset, int whence) { #if SANITIZER_NETBSD return internal_syscall64(SYSCALL(lseek), fd, 0, offset, whence); #else +# if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS == 2 + int64_t res; + int rc = internal_syscall(SYSCALL(llseek), fd, + (long) (((u64)(offset)) >> 32), + (long) offset, &res, whence); + return rc ? rc : res; +# else return internal_syscall(SYSCALL(lseek), fd, offset, whence); +# endif #endif } diff --git a/libsanitizer/sanitizer_common/sanitizer_platform.h b/libsanitizer/sanitizer_common/sanitizer_platform.h index 1eb4d0c..3963d09 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform.h @@ -179,6 +179,12 @@ # define SANITIZER_ARM 0 #endif +#if defined(__aarch64__) && defined(__ILP32__) +# define SANITIZER_AARCH64_ILP32 1 +#else +# define SANITIZER_AARCH64_ILP32 0 +#endif + // By default we allow to use SizeClassAllocator64 on 64-bit platform. // But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64 // does not work well and we need to fallback to SizeClassAllocator32. @@ -207,10 +213,15 @@ // The AArch64 linux port uses the canonical syscall set as mandated by // the upstream linux community for all new ports. Other ports may still -// use legacy syscalls. +// use legacy syscalls. Also AArch64 ILP32 uses canonical syscall set +// 32 bits ports. #ifndef SANITIZER_USES_CANONICAL_LINUX_SYSCALLS # if defined(__aarch64__) && SANITIZER_LINUX -# define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 1 +# if defined(__ILP32__) +# define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 2 +# else +# define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 1 +# endif # else # define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 0 # endif diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index 858bb21..ee4f74f 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -1136,7 +1136,8 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); CHECK_SIZE_AND_OFFSET(ipc_perm, gid); CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); -#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) +#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) \ + && !defined(__ILP32__) /* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ CHECK_SIZE_AND_OFFSET(ipc_perm, mode); #endif diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h index 4d11d07..fbdf3d5 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h @@ -74,7 +74,10 @@ namespace __sanitizer { #elif defined(__arm__) const unsigned struct_kernel_stat_sz = 64; const unsigned struct_kernel_stat64_sz = 104; -#elif defined(__aarch64__) +#elif defined(__aarch64__) && defined(__ILP32__) + const unsigned struct_kernel_stat_sz = 80; + const unsigned struct_kernel_stat64_sz = 104; +#elif defined(__aarch64__) && defined(__LP64__) const unsigned struct_kernel_stat_sz = 128; const unsigned struct_kernel_stat64_sz = 104; #elif defined(__powerpc__) && !defined(__powerpc64__) @@ -506,8 +509,13 @@ namespace __sanitizer { }; #else struct __sanitizer_dirent { +# if SANITIZER_AARCH64_ILP32 + unsigned long long d_ino; + unsigned long long d_off; +# else uptr d_ino; uptr d_off; +# endif unsigned short d_reclen; // more fields that we don't care about }; @@ -537,7 +545,8 @@ namespace __sanitizer { #if SANITIZER_LINUX || SANITIZER_FREEBSD #if defined(_LP64) || defined(__x86_64__) || defined(__powerpc__)\ - || defined(__mips__) + || defined(__mips__) \ + || (defined(__aarch64__) && defined(__ILP32__)) typedef unsigned __sanitizer___kernel_uid_t; typedef unsigned __sanitizer___kernel_gid_t; #else