From: David Miller <davem@davemloft.net>
To: luto@amacapital.net
Cc: viro@zeniv.linux.org.uk, luto@kernel.org,
torvalds@linux-foundation.org, mingo@kernel.org, x86@kernel.org,
linux-arch@vger.kernel.org, linux-s390@vger.kernel.org,
keescook@chromium.org
Subject: Re: SPARC issue
Date: Tue, 19 Jan 2016 17:18:49 -0500 (EST) [thread overview]
Message-ID: <20160119.171849.2126169792640472591.davem@davemloft.net> (raw)
In-Reply-To: <CALCETrVso3Dd7qyf0FMDB7_nFK0wtX6_SrE7rcd48ZE_rOkFQw@mail.gmail.com>
From: Andy Lutomirski <luto@amacapital.net>
Date: Tue, 19 Jan 2016 14:14:43 -0800
> On Tue, Jan 19, 2016 at 1:55 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>> On Tue, Jan 19, 2016 at 01:47:24PM -0800, Andy Lutomirski wrote:
>>> Essentially all users of is_compat_task in the kernel are trying to
>>> determine whether they are executing in the context of a compat
>>> syscall. On at least x86_64 and sparc, these are not at all the
>>> same question.
>>>
>>> On x86_64 and sparc, therefore, is_compat_task doesn't return the
>>> overall compat state of the task; it returns true if the task is
>>> currently in a compat syscall.
>>
>> The hell it does. Andy, TIF_32BIT is *NOT* set on syscall entry; it is
>> set by execve(). And 64bit task (with that bit clear) can bloody well
>> issue 32bit syscalls. Really.
>
> It does on x86. It does not on sparc. But syscall_get_arch on sparc
> *also* doesn't appear to work right.
>
> davem, how can I check the current syscall bitness on sparc? It's not
> obvious to me that it's possible.
You have to do it by context if it's important.
In addition to the example Al gave, 32-bit processes can make 64-bit
syscalls too. GDB and other ptrace() using applications can use this
to trace 64-bit programs from 32-bit tracer apps.
next prev parent reply other threads:[~2016-01-19 22:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 22:14 SPARC issue (Re: [PATCH] Rename is_compat_task to in_compat_syscall) Andy Lutomirski
2016-01-19 22:18 ` David Miller [this message]
2016-01-19 23:11 ` SPARC issue Andy Lutomirski
2016-01-19 23:37 ` Andy Lutomirski
2016-01-20 2:33 ` David Miller
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=20160119.171849.2126169792640472591.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=keescook@chromium.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).