mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Asadi <asadi.samuel@gmail.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Helge Deller <deller@gmx.de>, sam-the-6 <asadi.samuel@gmail.com>
Subject: [PATCH 85/94] parisc: fix fanotify_mark() syscall on 32bit compat kernel
Date: Tue, 15 Jul 2014 20:01:40 +0300	[thread overview]
Message-ID: <1405443709-15288-85-git-send-email-asadi.samuel@gmail.com> (raw)
In-Reply-To: <1405443709-15288-1-git-send-email-asadi.samuel@gmail.com>

From: Helge Deller <deller@gmx.de>

On parisc we can not use the existing compat implementation for fanotify_mark()
because for the 64bit mask parameter the higher and lower 32bits are ordered
differently than what the compat function expects from big endian
architectures.

Specifically:
It finally turned out, that on hppa we end up with different assignments
of parameters to kernel arguments depending on if we call the glibc
wrapper function
 int fanotify_mark (int __fanotify_fd, unsigned int __flags,
                    uint64_t __mask, int __dfd, const char *__pathname);
or directly calling the syscall manually
 syscall(__NR_fanotify_mark, ...)

Reason is, that the syscall() function is implemented as C-function and
because we now have the sysno as first parameter in front of the other
parameters the compiler will unexpectedly add an empty paramenter in
front of the u64 value to ensure the correct calling alignment for 64bit
values.
This means, on hppa you can't simply use syscall() to call the kernel
fanotify_mark() function directly, but you have to use the glibc
function instead.

This patch fixes the kernel in the hppa-arch specifc coding to adjust
the parameters in a way as if userspace calls the glibc wrapper function
fanotify_mark().

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # 3.13+
Signed-off-by: sam-the-6 <asadi.samuel@gmail.com>
---
 arch/parisc/kernel/sys_parisc32.c  |   10 ++++++++++
 arch/parisc/kernel/syscall_table.S |    2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index bb9f3b6..ec741fe 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -4,6 +4,7 @@
  * Copyright (C) 2000-2001 Hewlett Packard Company
  * Copyright (C) 2000 John Marvin
  * Copyright (C) 2001 Matthew Wilcox
+ * Copyright (C) 2014 Helge Deller <deller@gmx.de>
  *
  * These routines maintain argument size conversion between 32bit and 64bit
  * environment. Based heavily on sys_ia32.c and sys_sparc32.c.
@@ -57,3 +58,12 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
     	current->comm, current->pid, r20);
     return -ENOSYS;
 }
+
+asmlinkage long sys32_fanotify_mark(compat_int_t fanotify_fd, compat_uint_t flags,
+	compat_uint_t mask0, compat_uint_t mask1, compat_int_t dfd,
+	const char  __user * pathname)
+{
+	return sys_fanotify_mark(fanotify_fd, flags,
+			((__u64)mask1 << 32) | mask0,
+			 dfd, pathname);
+}
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index c5fa7a6..84c5d3a 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -418,7 +418,7 @@
 	ENTRY_SAME(accept4)		/* 320 */
 	ENTRY_SAME(prlimit64)
 	ENTRY_SAME(fanotify_init)
-	ENTRY_COMP(fanotify_mark)
+	ENTRY_DIFF(fanotify_mark)
 	ENTRY_COMP(clock_adjtime)
 	ENTRY_SAME(name_to_handle_at)	/* 325 */
 	ENTRY_COMP(open_by_handle_at)
-- 
1.7.10.4


  parent reply	other threads:[~2014-07-15 17:08 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 17:00 [PATCH 01/94] ARM: shmobile: Add DT and defconfigs to MAINTAINERS Sam Asadi
2014-07-15 17:00 ` [PATCH 02/94] clk: ti: apll: not allocating enough data Sam Asadi
2014-07-15 17:00 ` [PATCH 03/94] clk: ti: dra7: return error code in failure case Sam Asadi
2014-07-15 17:00 ` [PATCH 04/94] clk: ti: am43x: Fix boot with CONFIG_SOC_AM33XX disabled Sam Asadi
2014-07-15 17:00 ` [PATCH 05/94] clk: ti: set CLK_SET_RATE_NO_REPARENT for ti,mux-clock Sam Asadi
2014-07-15 17:00 ` [PATCH 06/94] clk: samsung: fix several typos to fix boot on s3c2410 Sam Asadi
2014-07-15 17:00 ` [PATCH 07/94] clk: samsung: add more aliases for s3c24xx Sam Asadi
2014-07-15 17:00 ` [PATCH 08/94] clk: samsung: exynos4: Remove SRC_MASK_ISP gates Sam Asadi
2014-07-15 17:00 ` [PATCH 09/94] clk: s3c64xx: Hookup SPI clocks correctly Sam Asadi
2014-07-15 17:00 ` [PATCH 10/94] clk/exynos5250: fix bit number for tv sysmmu clock Sam Asadi
2014-07-15 17:00 ` [PATCH 11/94] clk: exynos5420: Remove aclk66_peric from the clock tree description Sam Asadi
2014-07-15 17:00 ` [PATCH 12/94] dma: cppi41: handle 0-length packets Sam Asadi
2014-07-15 17:00 ` [PATCH 13/94] Update imx-sdma cyclic handling to report residue Sam Asadi
2014-07-15 17:00 ` [PATCH 14/94] clk: s2mps11: Fix double free corruption during driver unbind Sam Asadi
2014-07-15 17:00 ` [PATCH 15/94] clk: sunxi: fix devm_ioremap_resource error detection code Sam Asadi
2014-07-15 17:00 ` [PATCH 16/94] ARM: kprobes: Prevent known test failures stopping other tests running Sam Asadi
2014-07-15 17:00 ` [PATCH 17/94] ARM: kprobes: Disallow instructions with PC and register specified shift Sam Asadi
2014-07-15 17:00 ` [PATCH 18/94] ARM: kprobes: Fix test code compilation errors for ARMv4 targets Sam Asadi
2014-07-15 17:00 ` [PATCH 19/94] clk: qcom: HDMI source sel is 3 not 2 Sam Asadi
2014-07-15 17:00 ` [PATCH 20/94] ARM: dts: dra7xx-clocks: Fix the l3 and l4 clock rates Sam Asadi
2014-07-15 17:00 ` [PATCH 21/94] ARM: EXYNOS: Fix the check for non-smp configuration Sam Asadi
2014-07-15 17:00 ` [PATCH 22/94] ARM: dts: fix pwm-cells in pwm node for exynos4 Sam Asadi
2014-07-15 17:00 ` [PATCH 23/94] clocksource: exynos_mct: Fix ftrace Sam Asadi
2014-07-15 17:00 ` [PATCH 24/94] clocksource: exynos_mct: Register the timer for stable udelay Sam Asadi
2014-07-15 17:00 ` [PATCH 25/94] iio: hid-sensor-press: Fix return values Sam Asadi
2014-07-15 17:00 ` [PATCH 26/94] iio: hid-sensor-accel-3d: " Sam Asadi
2014-07-15 17:00 ` [PATCH 27/94] iio: hid-sensor-magn-3d: " Sam Asadi
2014-07-15 17:00 ` [PATCH 28/94] iio: hid-sensor-als: " Sam Asadi
2014-07-15 17:00 ` [PATCH 29/94] iio: hid-sensor-gyro-3d: " Sam Asadi
2014-07-15 17:00 ` [PATCH 30/94] iio: hid-sensor-prox: " Sam Asadi
2014-07-15 17:00 ` [PATCH 31/94] ext4: fix unjournalled bg descriptor while initializing inode bitmap Sam Asadi
2014-07-15 17:00 ` [PATCH 32/94] ext4: clarify error count warning messages Sam Asadi
2014-07-15 17:00 ` [PATCH 33/94] ext4: clarify ext4_error message in ext4_mb_generate_buddy_error() Sam Asadi
2014-07-15 17:00 ` [PATCH 34/94] ext4: disable synchronous transaction batching if max_batch_time==0 Sam Asadi
2014-07-15 17:00 ` [PATCH 35/94] ARM: OMAP3: PRM/CM: Add back macros used by TI DSP/Bridge driver Sam Asadi
2014-07-15 17:00 ` [PATCH 36/94] ARM: DRA7: hwmod: Fixup SATA hwmod Sam Asadi
2014-07-15 17:00 ` [PATCH 37/94] ARM: DRA7: hwmod: Add SYSCONFIG for usb_otg_ss Sam Asadi
2014-07-15 17:00 ` [PATCH 38/94] ARM: OMAP2+: clock/dpll: fix _dpll_test_fint arithmetics overflow Sam Asadi
2014-07-15 17:00 ` [PATCH 39/94] iio:tcs3472: Check for buffer enabled and locking Sam Asadi
2014-07-15 17:00 ` [PATCH 40/94] USB: cp210x: add support for Corsair usb dongle Sam Asadi
2014-07-15 17:00 ` [PATCH 41/94] usb: option: Add ID for Telewell TW-LTE 4G v2 Sam Asadi
2014-07-15 17:00 ` [PATCH 42/94] ARM: DRA7/AM43XX: fix header definition for omap44xx_restart Sam Asadi
2014-07-15 17:00 ` [PATCH 43/94] ARM: dts: dra7-evm: Make VDDA_1V8_PHY supply always on Sam Asadi
2014-07-15 17:00 ` [PATCH 44/94] ARM: OMAP2+: create dsp device only on OMAP3 SoCs Sam Asadi
2014-07-15 17:01 ` [PATCH 45/94] ARM: OMAP2+: Make GPMC skip disabled devices Sam Asadi
2014-07-15 17:01 ` [PATCH 46/94] ARM: dts: am335x-evm: Enable the McASP FIFO for audio Sam Asadi
2014-07-16  5:40   ` Peter Ujfalusi
2014-07-15 17:01 ` [PATCH 47/94] ARM: dts: am335x-evmsk: " Sam Asadi
2014-07-15 17:01 ` [PATCH 48/94] ARM: dts: Fix TI CPSW Phy mode selection on IGEP COM AQUILA Sam Asadi
2014-07-15 17:01 ` [PATCH 49/94] ARM: l2c: fix revision checking Sam Asadi
2014-07-15 17:01 ` [PATCH 50/94] ARM: EXYNOS: Update secondary boot addr for secure mode Sam Asadi
2014-07-15 17:01 ` [PATCH 51/94] ARM: dts: Update the parent for Audss clocks in Exynos5420 Sam Asadi
2014-07-15 17:01 ` [PATCH 52/94] ARM: imx: fix shared gate clock Sam Asadi
2014-07-15 17:01 ` [PATCH 53/94] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization Sam Asadi
2014-07-15 17:01 ` [PATCH 54/94] iio: ti_am335x_adc: Fix: Use same step id at FIFOs both ends Sam Asadi
2014-07-15 17:01 ` [PATCH 55/94] Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code Sam Asadi
2014-07-15 17:01 ` [PATCH 56/94] Drivers: hv: util: Fix a bug in the KVP code Sam Asadi
2014-07-15 17:01 ` [PATCH 57/94] USB: ftdi_sio: Add extra PID Sam Asadi
2014-07-15 17:01 ` [PATCH 58/94] i8k: Fix non-SMP operation Sam Asadi
2014-08-18 23:19   ` i8k: Don't revert affinity in i8k_smm Con Kolivas
2014-08-19  2:32     ` Guenter Roeck
2014-08-19 12:34       ` Con Kolivas
2014-07-15 17:01 ` [PATCH 59/94] m68k: Fix boot regression on machines with RAM at non-zero Sam Asadi
2014-07-15 17:01 ` [PATCH 60/94] ARM: EXYNOS: Add support for clock handling in power domain Sam Asadi
2014-07-15 17:01 ` [PATCH 61/94] clk: exynos5420: Add IDs for clocks used in PD mfc Sam Asadi
2014-07-15 17:01 ` [PATCH 62/94] ARM: dts: Add clock property for mfc_pd in exynos5420 Sam Asadi
2014-07-15 17:01 ` [PATCH 63/94] ARM: EXYNOS: Register cpuidle device only on exynos4210 and 5250 Sam Asadi
2014-07-15 17:01 ` [PATCH 64/94] serial: Test for no tx data on tx restart Sam Asadi
2014-07-15 17:01 ` [PATCH 65/94] serial: arc_uart: Use uart_circ_empty() for open-coded comparison Sam Asadi
2014-07-15 17:01 ` [PATCH 66/94] m68k: Export mach_random_get_entropy to modules Sam Asadi
2014-07-15 17:01 ` [PATCH 67/94] ext4: revert commit which was causing fs corruption after journal replays Sam Asadi
2014-07-15 17:01 ` [PATCH 68/94] serial: imx: Fix build breakage Sam Asadi
2014-07-15 17:01 ` [PATCH 69/94] serial: sh-sci: Add device tree support for r8a7{778,740,3a4} and sh73a0 Sam Asadi
2014-07-15 17:01 ` [PATCH 70/94] USB: serial: ftdi_sio: Add Infineon Triboard Sam Asadi
2014-07-15 17:01 ` [PATCH 71/94] phy: sun4i: depend on RESET_CONTROLLER Sam Asadi
2014-07-15 17:01 ` [PATCH 72/94] phy: omap-usb2: fix devm_ioremap_resource error detection code Sam Asadi
2014-07-15 17:01 ` [PATCH 73/94] drivers: phy: phy-samsung-usb2.c: Add missing MODULE_DEVICE_TABLE Sam Asadi
2014-07-15 17:01 ` [PATCH 74/94] phy: core: Fix error path in phy_create() Sam Asadi
2014-07-15 17:01 ` [PATCH 75/94] phy: omap-usb2: Balance pm_runtime_enable() on probe failure and remove Sam Asadi
2014-07-15 17:01 ` [PATCH 76/94] ARM: at91: at91sam9x5: add clocks for usb device Sam Asadi
2014-07-15 17:01 ` [PATCH 77/94] Documentation/Changes: clean up mcelog paragraph Sam Asadi
2014-07-15 17:01 ` [PATCH 78/94] scripts/kernel-doc: handle object-like macros Sam Asadi
2014-07-15 17:01 ` [PATCH 79/94] DocBook: fix mtdnand typos Sam Asadi
2014-07-15 17:01 ` [PATCH 80/94] DocBook: fix various typos Sam Asadi
2014-07-15 17:01 ` [PATCH 81/94] Documenation/laptops: rename and update hpfall.c Sam Asadi
2014-07-15 17:01 ` [PATCH 82/94] ext4: fix a potential deadlock in __ext4_es_shrink() Sam Asadi
2014-07-15 17:01 ` [PATCH 83/94] ext4: fix potential null pointer dereference in ext4_free_inode Sam Asadi
2014-07-15 17:01 ` [PATCH 84/94] parisc: add serial ports of C8000/1GHz machine to hardware database Sam Asadi
2014-07-15 17:01 ` Sam Asadi [this message]
2014-07-15 17:01 ` [PATCH 86/94] parisc: drop unused defines and header includes Sam Asadi
2014-07-15 17:01 ` [PATCH 87/94] clk: spear3xx: Use proper control register offset Sam Asadi
2014-07-15 17:01 ` [PATCH 88/94] clk: spear3xx: Set proper clock parent of uart1/2 Sam Asadi
2014-07-15 17:01 ` [PATCH 89/94] Linux 3.16-rc5 Sam Asadi
2014-07-15 17:37   ` Valdis.Kletnieks
2014-07-15 17:01 ` [PATCH 90/94] Staging: comedi: 8253.h fixed by removing 'return' from generic func Sam Asadi
2014-07-15 17:01 ` [PATCH 91/94] Staging: comedi: 8255: fixed by adding an empthy line Sam Asadi
2014-07-15 17:01 ` [PATCH 92/94] Staging: comedi: adl_pci9118: fixed style issues Sam Asadi
2014-07-15 17:01 ` [PATCH 93/94] Staging: comedi: 3 files revised " Sam Asadi
2014-07-15 17:01 ` [PATCH 94/94] Staging: commedi: 8253.h: style issue fixed Sam Asadi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405443709-15288-85-git-send-email-asadi.samuel@gmail.com \
    --to=asadi.samuel@gmail.com \
    --cc=deller@gmx.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome