diff options
| author | Andy Lutomirski <luto@kernel.org> | 2016-03-22 17:24:43 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-22 18:36:02 -0400 |
| commit | 5180e3e24fd3e8e7ea46fbe21e10f5ea3fb1edaa (patch) | |
| tree | ba5283961497ff4608eecf8e620ffbd1fd4b2462 /include/linux/compat.h | |
| parent | b4aa14a63cb3194d8eab355fcee194838ab09121 (diff) | |
compat: add in_compat_syscall to ask whether we're in a compat syscall
A lot of code currently abuses is_compat_task to determine this.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: David Airlie <airlied@linux.ie>
Cc: David Herrmann <dh.herrmann@googlemail.com>
Cc: David Miller <davem@davemloft.net>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Eric Paris <eparis@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/compat.h')
| -rw-r--r-- | include/linux/compat.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index fe4ccd0c748a..f964ef79e0ad 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | * syscall compatibility layer. | 5 | * syscall compatibility layer. |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/types.h> | ||
| 9 | |||
| 8 | #ifdef CONFIG_COMPAT | 10 | #ifdef CONFIG_COMPAT |
| 9 | 11 | ||
| 10 | #include <linux/stat.h> | 12 | #include <linux/stat.h> |
| @@ -719,9 +721,22 @@ asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, | |||
| 719 | 721 | ||
| 720 | asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32, | 722 | asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32, |
| 721 | int, const char __user *); | 723 | int, const char __user *); |
| 724 | |||
| 725 | /* | ||
| 726 | * For most but not all architectures, "am I in a compat syscall?" and | ||
| 727 | * "am I a compat task?" are the same question. For architectures on which | ||
| 728 | * they aren't the same question, arch code can override in_compat_syscall. | ||
| 729 | */ | ||
| 730 | |||
| 731 | #ifndef in_compat_syscall | ||
| 732 | static inline bool in_compat_syscall(void) { return is_compat_task(); } | ||
| 733 | #endif | ||
| 734 | |||
| 722 | #else | 735 | #else |
| 723 | 736 | ||
| 724 | #define is_compat_task() (0) | 737 | #define is_compat_task() (0) |
| 738 | static inline bool in_compat_syscall(void) { return false; } | ||
| 725 | 739 | ||
| 726 | #endif /* CONFIG_COMPAT */ | 740 | #endif /* CONFIG_COMPAT */ |
| 741 | |||
| 727 | #endif /* _LINUX_COMPAT_H */ | 742 | #endif /* _LINUX_COMPAT_H */ |
