In fanotify_mark definition, the third parameter __u64 mask should be
passed by r2/r3 on arm architecture. However, without a correct libc
wrapper, if it invoked directly by syscall, since FAN_OPEN defined as
uint32_t, it will pass the forth parameter through r3. So the kernel
will get wrong __u64 mask like below
sys_fanotify_mark: fanotify_fd=3 flags=1 dfd=33916 pathname= (null) mask=
ffffff9c00000020
The expected one should looks like
sys_fanotify_mark: fanotify_fd=3 flags=1 dfd=-100 pathname=
00008488 mask=20
Please refer to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%
23618562
Change-Id: I0cbce0e05bdaa6a709406089c172ec09fab69d04
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
--- /dev/null
+diff --git a/src/missing.h b/src/missing.h
+index 213ef2f..c8f91ae 100644
+--- a/src/missing.h
++++ b/src/missing.h
+@@ -133,7 +133,7 @@ static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags)
+
+ static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t mask,
+ int dfd, const char *pathname) {
+-#if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32
++#if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32 || defined __arm__ && !defined __aarch64__
+ union {
+ uint64_t _64;
+ uint32_t _32[2];
Patch10: enable-core-dumps-globally.patch
Patch11: SMACK-Add-configuration-options.-v3.patch
Patch12: reboot_syscall_param.patch
-Patch13: default_oom_score.patch
+Patch13: default_oom_score.patch
+Patch14: fix-syscall-NR_fanotify_mark-on-arm.patch
BuildRequires: pkgconfig(dbus-1) >= 1.4.0
BuildRequires: pkgconfig(dbus-glib-1)
%patch11 -p1
%patch12 -p1
%patch13 -p1
+%patch14 -p1
%build
cp %{SOURCE1001} .