linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Dmitry Safonov <dsafonov@virtuozzo.com>,
	Borislav Petkov <bp@suse.de>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	stable <stable@vger.kernel.org>, Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH] x86/mm: Fix personality(ADDR_NO_RANDOMIZE)
Date: Mon, 14 Aug 2017 19:22:21 +0300	[thread overview]
Message-ID: <20170814162221.auvjsbrrqhs2sl2j@node.shutemov.name> (raw)
In-Reply-To: <20170814161347.GO2005@uranus.lan>

On Mon, Aug 14, 2017 at 07:13:47PM +0300, Cyrill Gorcunov wrote:
> On Mon, Aug 14, 2017 at 06:57:19PM +0300, Kirill A. Shutemov wrote:
> > In v4.12, during rework of infrastructure around mmap_base, disable-ASLR
> > personality flag got accidentally broken.
> > 
> > Let's make it work again.
> > 
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > Fixes: 1b028f784e8c ("x86/mm: Introduce mmap_compat_base() for 32-bit mmap()")
> > Cc: stable <stable@vger.kernel.org> [4.12+]
> > ---
> >  arch/x86/mm/mmap.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
> > index 229d04a83f85..779bdbe5e424 100644
> > --- a/arch/x86/mm/mmap.c
> > +++ b/arch/x86/mm/mmap.c
> > @@ -127,6 +127,8 @@ static unsigned long mmap_legacy_base(unsigned long rnd,
> >  static void arch_pick_mmap_base(unsigned long *base, unsigned long *legacy_base,
> >  		unsigned long random_factor, unsigned long task_size)
> >  {
> > +	if (!(current->flags & PF_RANDOMIZE))
> > +		random_factor = 0;
> >  	*legacy_base = mmap_legacy_base(random_factor, task_size);
> >  	if (mmap_is_legacy())
> >  		*base = *legacy_base;
> 
> Didn't Oleg's patch does the same?

Yes, it does. And it looks cleaner than my attempt.

> https://patchwork.kernel.org/patch/9832697/
> 
> for some reason it's not yet merged.

-- 
 Kirill A. Shutemov

--
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>

      parent reply	other threads:[~2017-08-14 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 15:57 Kirill A. Shutemov
2017-08-14 16:13 ` Cyrill Gorcunov
2017-08-14 16:20   ` Oleg Nesterov
2017-08-14 16:26     ` Kirill A. Shutemov
2017-08-14 16:28     ` Cyrill Gorcunov
2017-08-14 16:22   ` Kirill A. Shutemov [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=20170814162221.auvjsbrrqhs2sl2j@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=dsafonov@virtuozzo.com \
    --cc=gorcunov@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --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