aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compat.h
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2018-07-11 14:56:51 +0100
committerWill Deacon <will.deacon@arm.com>2018-07-12 14:49:48 +0100
commit9b54bf9d6a5b30e2cc22b18793e9a4158c5b4882 (patch)
tree2239cebf690d0e02e630567eec999229d27e74cf /include/linux/compat.h
parentkernel: add ksys_personality() (diff)
downloadlinux-dev-9b54bf9d6a5b30e2cc22b18793e9a4158c5b4882.tar.xz
linux-dev-9b54bf9d6a5b30e2cc22b18793e9a4158c5b4882.zip
kernel: add kcompat_sys_{f,}statfs64()
Using this helper allows us to avoid the in-kernel calls to the compat_sys_{f,}statfs64() sycalls, as are necessary for parameter mangling in arm64's compat handling. Following the example of ksys_* functions, kcompat_sys_* functions are intended to be a drop-in replacement for their compat_sys_* counterparts, with the same calling convention. This is necessary to enable conversion of arm64's syscall handling to use pt_regs wrappers. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to '')
-rw-r--r--include/linux/compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index c68acc47da57..43f4ed44c5d5 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -1028,6 +1028,17 @@ static inline struct compat_timeval ns_to_compat_timeval(s64 nsec)
return ctv;
}
+/*
+ * Kernel code should not call compat syscalls (i.e., compat_sys_xyzyyz())
+ * directly. Instead, use one of the functions which work equivalently, such
+ * as the kcompat_sys_xyzyyz() functions prototyped below.
+ */
+
+int kcompat_sys_statfs64(const char __user * pathname, compat_size_t sz,
+ struct compat_statfs64 __user * buf);
+int kcompat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
+ struct compat_statfs64 __user * buf);
+
#else /* !CONFIG_COMPAT */
#define is_compat_task() (0)