[PATCH] [ASAN/AArch64] Fix kernel_old_Xid_t type

Christophe Lyon christophe.lyon at linaro.org
Wed Oct 29 06:00:54 PDT 2014


Hi kcc, rengolin,

Some people have complained because libsanitizer for AArch64 no longer builds when using "old" kernel headers.

Indeed, the kernel was modified here:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34c65c4

In practice, I've noticed that the change appeared in linux-3.15.3,
but users have reported using 3.10 and 3.14 stable ones on aarch64
machines.

I want to fix this, and I have a patch ready, but it does not seem to
follow the libsanitizer conventions:
in sanitizer_platform_limits_posix.h, we currently have:
#if defined(__powerpc__) || defined(__aarch64__) || defined(__mips__)
  typedef unsigned int __sanitizer___kernel_old_uid_t;
  typedef unsigned int __sanitizer___kernel_old_gid_t;
#else
  typedef unsigned short __sanitizer___kernel_old_uid_t;
  typedef unsigned short __sanitizer___kernel_old_gid_t;
#endif

Why not simply have an unconditional
#if SANITIZER_LINUX
#include <linux/posix_types.h>
#endif

typedef __kernel_old_uid_t __sanitizer___kernel_old_uid_t;
typedef __kernel_old_gid_t __sanitizer___kernel_old_gid_t;

(I don't know what the corresponding FREEBSD code would be though).

Sorry if the question is obvious, but why are many types/sizes
hardcodes in sanitizer_platform_limits_posix.h rather than inherited?

Thanks,

Christophe.

http://reviews.llvm.org/D6026

Files:
  lib/sanitizer_common/sanitizer_platform_limits_posix.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6026.15548.patch
Type: text/x-patch
Size: 1002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141029/290fdaaf/attachment.bin>


More information about the llvm-commits mailing list