Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1560996 > unrolled thread

Re: [PATCHv2 3/5] x86/mm: fix native mmap() in compat bins and vice-versa

Started byAndy Lutomirski <luto@amacapital.net>
First post2017-01-17 21:40 +0100
Last post2017-01-17 21:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCHv2 3/5] x86/mm: fix native mmap() in compat bins and vice-versa Andy Lutomirski <luto@amacapital.net> - 2017-01-17 21:40 +0100

#1560996 — Re: [PATCHv2 3/5] x86/mm: fix native mmap() in compat bins and vice-versa

FromAndy Lutomirski <luto@amacapital.net>
Date2017-01-17 21:40 +0100
SubjectRe: [PATCHv2 3/5] x86/mm: fix native mmap() in compat bins and vice-versa
Message-ID<t0IHU-3fQ-11@gated-at.bofh.it>
On Mon, Jan 16, 2017 at 4:33 AM, Dmitry Safonov <dsafonov@virtuozzo.com> wrote:
> Fix 32-bit compat_sys_mmap() mapping VMA over 4Gb in 64-bit binaries
> and 64-bit sys_mmap() mapping VMA only under 4Gb in 32-bit binaries.
> Changed arch_get_unmapped_area{,_topdown}() to recompute mmap_base
> for those cases and use according high/low limits for vm_unmapped_area()
> The recomputing of mmap_base may make compat sys_mmap() in 64-bit
> binaries a little slower than native, which uses already known from exec
> time mmap_base - but, as it returned buggy address, that case seemed
> unused previously, so no performance degradation for already used ABI.

This looks plausibly correct but rather weird -- why does this code
need to distinguish between all four cases (pure 32-bit, pure 64-bit,
64-bit mmap layout doing 32-bit call, 32-bit layout doing 64-bit
call)?

> Can be optimized in future by introducing mmap_compat_{,legacy}_base
> in mm_struct.

Hmm.  Would it make sense to do it this way from the beginning?

If adding an in_32bit_syscall() helper would help, then by all means
please do so.

--Andy

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web