From 47fd48dc63c837f9ea827e6f37e3cbd2a10803cd Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Mon, 13 May 2013 17:58:28 +0800 Subject: [PATCH] Fix syscall(__NR_fanotify_mark,...) on arm 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 --- packaging/fix-syscall-NR_fanotify_mark-on-arm.patch | 13 +++++++++++++ packaging/systemd.spec | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 packaging/fix-syscall-NR_fanotify_mark-on-arm.patch diff --git a/packaging/fix-syscall-NR_fanotify_mark-on-arm.patch b/packaging/fix-syscall-NR_fanotify_mark-on-arm.patch new file mode 100644 index 0000000..d7f4d29 --- /dev/null +++ b/packaging/fix-syscall-NR_fanotify_mark-on-arm.patch @@ -0,0 +1,13 @@ +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]; diff --git a/packaging/systemd.spec b/packaging/systemd.spec index 8472293..cccc324 100644 --- a/packaging/systemd.spec +++ b/packaging/systemd.spec @@ -22,7 +22,8 @@ Patch9: main-allow-system-wide-limits-for-services.patch 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) @@ -178,6 +179,7 @@ This package includes the man pages for systemd. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %build cp %{SOURCE1001} . -- 2.7.4