From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"Hansen, Dave" <dave.hansen@intel.com>,
"bp@alien8.de" <bp@alien8.de>
Cc: "Wu, Yingcong" <yingcong.wu@intel.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCHv2] x86/mm: Fix VDSO and VVAR placement on 5-level paging machines
Date: Sat, 5 Aug 2023 00:13:19 +0000 [thread overview]
Message-ID: <1b847f492924a4ae3172fe83c1e259e6a2869149.camel@intel.com> (raw)
In-Reply-To: <20230803151609.22141-1-kirill.shutemov@linux.intel.com>
On Thu, 2023-08-03 at 18:16 +0300, Kirill A. Shutemov wrote:
> Yingcong has noticed that on the 5-level paging machine, VDSO and
> VVAR
> VMAs are placed above the 47-bit border:
>
> 8000001a9000-8000001ad000 r--p 00000000 00:00
> 0 [vvar]
> 8000001ad000-8000001af000 r-xp 00000000 00:00
> 0 [vdso]
>
> This might confuse users who are not aware of 5-level paging and
> expect
> all userspace addresses to be under the 47-bit border.
>
> So far problem has only been triggered with ASLR disabled, although
> it
> may also occur with ASLR enabled if the layout is randomized in a
> just
> right way.
>
> The problem happens due to custom placement for the VMAs in the VDSO
> code: vdso_addr() tries to place them above the stack and checks the
> result against TASK_SIZE_MAX, which is wrong. TASK_SIZE_MAX is set to
> the 56-bit border on 5-level paging machines. Use DEFAULT_MAP_WINDOW
> instead.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: Yingcong Wu <yingcong.wu@intel.com>
> Fixes: b569bab78d8d ("x86/mm: Prepare to expose larger address space
> to userspace")
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
prev parent reply other threads:[~2023-08-05 0:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 15:16 Kirill A. Shutemov
2023-08-05 0:13 ` Edgecombe, Rick P [this message]
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=1b847f492924a4ae3172fe83c1e259e6a2869149.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yingcong.wu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®