From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>,
Ruslan Kabatsayev <b7.10110111@gmail.com>,
X86 ML <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Borislav Petkov <bp@alien8.de>,
Pavel Emelyanov <xemul@parallels.com>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: Getting rid of dynamic TASK_SIZE (on x86, at least)
Date: Tue, 10 May 2016 19:30:45 +0300 [thread overview]
Message-ID: <20160510163045.GH14377@uranus.lan> (raw)
In-Reply-To: <CALCETrWWZy0hngPU8MCiQvnH+s0awpFE8wNBrYsf_c+nz6ZsDg@mail.gmail.com>
On Tue, May 10, 2016 at 09:07:49AM -0700, Andy Lutomirski wrote:
> Hi all-
>
> I'm trying to get rid of x86's dynamic TASK_SIZE and just redefine it
> to TASK_SIZE_MAX. So far, these are the TASK_SIZE users that actually
> seem to care about the task in question:
>
> get_unmapped_area. This is used by mmap, mremap, exec, uprobe XOL,
> and maybe some other things.
>
> - mmap, mremap, etc: IMO this should check in_compat_syscall, not
> TIF_ADDR32. If a 64-bit task does an explicit 32-bit mmap (using int
> $0x80, for example), it should get a 32-bit address back.
>
> - xol_add_vma: This one is weird: uprobes really is doing something
> behind the task's back, and the addresses need to be consistent with
> the address width. I'm not quite sure what to do here.
>
> - exec. This wants to set up mappings that are appropriate for the new task.
>
> My inclination would be add a new 'limit' parameter to all the
> get_unmapped_area variants and possible to vm_brk and friends and to
> thus push the decision into the callers. For the syscalls, we could
> add:
>
> static inline unsigned long this_syscall_addr_limit(void) { return TASK_SIZE; }
>
> and override it on x86.
>
> I'm not super excited to write that patch, though...
Andy, could you please highlight what's wrong with TASK_SIZE helper
in first place? The idea behind is to clean up the code or there
some real problem?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>,
Ruslan Kabatsayev <b7.10110111@gmail.com>,
X86 ML <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Borislav Petkov <bp@alien8.de>,
Pavel Emelyanov <xemul@parallels.com>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: Getting rid of dynamic TASK_SIZE (on x86, at least)
Date: Tue, 10 May 2016 19:30:45 +0300 [thread overview]
Message-ID: <20160510163045.GH14377@uranus.lan> (raw)
In-Reply-To: <CALCETrWWZy0hngPU8MCiQvnH+s0awpFE8wNBrYsf_c+nz6ZsDg@mail.gmail.com>
On Tue, May 10, 2016 at 09:07:49AM -0700, Andy Lutomirski wrote:
> Hi all-
>
> I'm trying to get rid of x86's dynamic TASK_SIZE and just redefine it
> to TASK_SIZE_MAX. So far, these are the TASK_SIZE users that actually
> seem to care about the task in question:
>
> get_unmapped_area. This is used by mmap, mremap, exec, uprobe XOL,
> and maybe some other things.
>
> - mmap, mremap, etc: IMO this should check in_compat_syscall, not
> TIF_ADDR32. If a 64-bit task does an explicit 32-bit mmap (using int
> $0x80, for example), it should get a 32-bit address back.
>
> - xol_add_vma: This one is weird: uprobes really is doing something
> behind the task's back, and the addresses need to be consistent with
> the address width. I'm not quite sure what to do here.
>
> - exec. This wants to set up mappings that are appropriate for the new task.
>
> My inclination would be add a new 'limit' parameter to all the
> get_unmapped_area variants and possible to vm_brk and friends and to
> thus push the decision into the callers. For the syscalls, we could
> add:
>
> static inline unsigned long this_syscall_addr_limit(void) { return TASK_SIZE; }
>
> and override it on x86.
>
> I'm not super excited to write that patch, though...
Andy, could you please highlight what's wrong with TASK_SIZE helper
in first place? The idea behind is to clean up the code or there
some real problem?
next prev parent reply other threads:[~2016-05-10 16:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 16:07 Getting rid of dynamic TASK_SIZE (on x86, at least) Andy Lutomirski
2016-05-10 16:07 ` Andy Lutomirski
2016-05-10 16:30 ` Cyrill Gorcunov [this message]
2016-05-10 16:30 ` Cyrill Gorcunov
2016-05-10 16:45 ` Andy Lutomirski
2016-05-10 16:45 ` Andy Lutomirski
2016-05-10 17:05 ` Cyrill Gorcunov
2016-05-10 17:05 ` Cyrill Gorcunov
2016-05-10 17:26 ` Andy Lutomirski
2016-05-10 17:26 ` Andy Lutomirski
2016-05-10 17:49 ` Cyrill Gorcunov
2016-05-10 17:49 ` Cyrill Gorcunov
2016-05-10 21:11 ` Andy Lutomirski
2016-05-10 21:11 ` Andy Lutomirski
2016-05-11 5:59 ` Cyrill Gorcunov
2016-05-11 5:59 ` Cyrill Gorcunov
2016-05-10 18:20 ` Oleg Nesterov
2016-05-10 18:20 ` Oleg Nesterov
2016-05-10 20:29 ` Andy Lutomirski
2016-05-10 20:29 ` Andy Lutomirski
2016-05-11 18:08 ` Oleg Nesterov
2016-05-11 18:08 ` Oleg Nesterov
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=20160510163045.GH14377@uranus.lan \
--to=gorcunov@gmail.com \
--cc=0x7f454c46@gmail.com \
--cc=b7.10110111@gmail.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
--cc=oleg@redhat.com \
--cc=x86@kernel.org \
--cc=xemul@parallels.com \
/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.