SELinuxProject / selinux-testsuite

This is the upstream SELinux testsuite which is designed as a basic set of regression tests for the SELinux kernel functionality.
GNU General Public License v2.0
53 stars 43 forks source link

tests/binder: Build only for 4.11 and later kernels #78

Closed Raverstern closed 2 years ago

Raverstern commented 2 years ago

Following compilation errors occur when building the tests with userspace headers exported from kernel 4.4:

binder_common.c:111:14: error: ‘const struct flat_binder_object’ has no
member named ‘hdr’
   switch (obj->hdr.type) {
              ^
client.c:58:9: error: dereferencing pointer to incomplete type
  if (obj->hdr.type != BINDER_TYPE_FD) {
         ^

It's been checked that member hdr of struct flat_binder_object and struct binder_fd_object were both introduced by commit feba3900cabb ("binder: Split flat_binder_object") in kernel v4.11-rc1. Fix this by adding kernel version check at compile time.

pcmoore commented 2 years ago

On-list patch via patchwork: