From: Sam Ravnborg <sam@ravnborg.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
x86@kernel.org, linux-arch <linux-arch@vger.kernel.org>,
David Miller <davem@davemloft.net>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
Chris Metcalf <cmetcalf@ezchip.com>,
linux-parisc@vger.kernel.org, linux-mips@linux-mips.org,
sparclinux@vger.kernel.org
Subject: Re: [PATCH v2 02/16] sparc/compat: Provide an accurate in_compat_syscall implementation
Date: Tue, 26 Jan 2016 07:29:51 +0100 [thread overview]
Message-ID: <20160126062951.GA17107@ravnborg.org> (raw)
In-Reply-To: <e520030f750b29d14486aa1e99c271a0fa18f19e.1453759363.git.luto@kernel.org>
On Mon, Jan 25, 2016 at 02:24:16PM -0800, Andy Lutomirski wrote:
> On sparc64 compat-enabled kernels, any task can make 32-bit and
> 64-bit syscalls. is_compat_task returns true in 32-bit tasks, which
> does not necessarily imply that the current syscall is 32-bit.
>
> Provide an in_compat_syscall implementation that checks whether the
> current syscall is compat.
>
> As far as I know, sparc is the only architecture on which
> is_compat_task checks the compat status of the task and on which the
> compat status of a syscall can differ from the compat status of the
> task. On x86, is_compat_task checks the syscall type, not the task
> type.
>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
> arch/sparc/include/asm/compat.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
> index 830502fe62b4..5467404857fc 100644
> --- a/arch/sparc/include/asm/compat.h
> +++ b/arch/sparc/include/asm/compat.h
> @@ -307,4 +307,10 @@ static inline int is_compat_task(void)
> return test_thread_flag(TIF_32BIT);
> }
>
> +static inline bool in_compat_syscall(void)
> +{
> + return pt_regs_trap_type(current_pt_regs()) == 0x110;
Could you please add a comment about where 0x110 comes from.
I at least failed to track this down.
Sam
WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
x86@kernel.org, linux-arch <linux-arch@vger.kernel.org>,
David Miller <davem@davemloft.net>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
Chris Metcalf <cmetcalf@ezchip.com>,
linux-parisc@vger.kernel.org, linux-mips@linux-mips.org,
sparclinux@vger.kernel.org
Subject: Re: [PATCH v2 02/16] sparc/compat: Provide an accurate in_compat_syscall implementation
Date: Tue, 26 Jan 2016 06:29:51 +0000 [thread overview]
Message-ID: <20160126062951.GA17107@ravnborg.org> (raw)
In-Reply-To: <e520030f750b29d14486aa1e99c271a0fa18f19e.1453759363.git.luto@kernel.org>
On Mon, Jan 25, 2016 at 02:24:16PM -0800, Andy Lutomirski wrote:
> On sparc64 compat-enabled kernels, any task can make 32-bit and
> 64-bit syscalls. is_compat_task returns true in 32-bit tasks, which
> does not necessarily imply that the current syscall is 32-bit.
>
> Provide an in_compat_syscall implementation that checks whether the
> current syscall is compat.
>
> As far as I know, sparc is the only architecture on which
> is_compat_task checks the compat status of the task and on which the
> compat status of a syscall can differ from the compat status of the
> task. On x86, is_compat_task checks the syscall type, not the task
> type.
>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
> arch/sparc/include/asm/compat.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
> index 830502fe62b4..5467404857fc 100644
> --- a/arch/sparc/include/asm/compat.h
> +++ b/arch/sparc/include/asm/compat.h
> @@ -307,4 +307,10 @@ static inline int is_compat_task(void)
> return test_thread_flag(TIF_32BIT);
> }
>
> +static inline bool in_compat_syscall(void)
> +{
> + return pt_regs_trap_type(current_pt_regs()) = 0x110;
Could you please add a comment about where 0x110 comes from.
I at least failed to track this down.
Sam
next prev parent reply other threads:[~2016-01-26 6:29 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 22:24 [PATCH v2 00/16] compat: Introduce and use in_compat_syscall Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 01/16] compat: Add in_compat_syscall to ask whether we're in a compat syscall Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 02/16] sparc/compat: Provide an accurate in_compat_syscall implementation Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:51 ` David Miller
2016-01-25 22:51 ` David Miller
2016-01-26 6:29 ` Sam Ravnborg [this message]
2016-01-26 6:29 ` Sam Ravnborg
2016-01-26 6:51 ` David Miller
2016-01-26 6:51 ` David Miller
2016-01-26 17:44 ` Sam Ravnborg
2016-01-26 17:44 ` Sam Ravnborg
2016-01-26 17:48 ` Andy Lutomirski
2016-01-26 17:48 ` Andy Lutomirski
2016-01-26 18:04 ` David Miller
2016-01-26 18:04 ` David Miller
2016-01-25 22:24 ` [PATCH v2 03/16] sparc/syscall: Fix syscall_get_arch Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 04/16] seccomp: Check in_compat_syscall, not is_compat_task, in strict mode Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 05/16] ptrace: in PEEK_SIGINFO, check syscall bitness, not task bitness Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 06/16] auditsc: For seccomp events, log syscall compat state using in_compat_syscall Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 07/16] staging/lustre: Switch from is_compat_task to in_compat_syscall Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 08/16] ext4: In ext4_dir_llseek, check syscall bitness directly Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 09/16] net/sctp: Use in_compat_syscall for sctp_getsockopt_connectx3 Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 10/16] net/xfrm_user: Use in_compat_syscall to deny compat syscalls Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 11/16] firewire: Use in_compat_syscall to check ioctl compatness Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 12/16] efivars: Use in_compat_syscall to check for compat callers Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 13/16] amdkfd: Use in_compat_syscall to check open() caller type Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 14/16] input: Redefine INPUT_COMPAT_TEST as in_compat_syscall() Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-27 19:17 ` Dmitry Torokhov
2016-01-27 19:17 ` Dmitry Torokhov
2016-01-27 20:29 ` Andy Lutomirski
2016-01-27 20:29 ` Andy Lutomirski
2016-01-27 21:06 ` Dmitry Torokhov
2016-01-27 21:06 ` Dmitry Torokhov
2016-03-22 20:51 ` Andrew Morton
2016-03-22 20:51 ` Andrew Morton
2016-03-23 18:42 ` Dmitry Torokhov
2016-03-23 18:42 ` Dmitry Torokhov
2016-01-25 22:24 ` [PATCH v2 15/16] uhid: Check write() bitness using in_compat_syscall Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
2016-01-25 22:24 ` [PATCH v2 16/16] x86/compat: Remove is_compat_task Andy Lutomirski
2016-01-25 22:24 ` Andy Lutomirski
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=20160126062951.GA17107@ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@linux-foundation.org \
--cc=cmetcalf@ezchip.com \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=luto@kernel.org \
--cc=sparclinux@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.