linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	vbabka@suse.cz, lorenzo.stoakes@oracle.com, linux-mm@kvack.org,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Jann Horn <jannh@google.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH hotfix 6.12 v2] mm/mlock: set the correct prev on failure
Date: Mon, 28 Oct 2024 02:47:53 +0000	[thread overview]
Message-ID: <20241028024753.yqteimzthoj2rmmi@master> (raw)
In-Reply-To: <20241027175347.af0faeac9fdfc2fc8ae051e9@linux-foundation.org>

On Sun, Oct 27, 2024 at 05:53:47PM -0700, Andrew Morton wrote:
>On Sun, 27 Oct 2024 12:33:21 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:
>
>> After commit 94d7d9233951 ("mm: abstract the vma_merge()/split_vma()
>> pattern for mprotect() et al."), if vma_modify_flags() return error, the
>> vma is set to an error code. This will lead to an invalid prev be
>> returned.
>> 
>> Generally this shouldn't matter as the caller should treat an error as
>> indicating state is now invalidated, however unfortunately
>> apply_mlockall_flags() does not check for errors and assumes that
>> mlock_fixup() correctly maintains prev even if an error were to occur.
>
>And what is the userspace-visible effect when this occurs?
>

When error occurs, prev would be set to (-ENOMEM). And accessing this address
would lead to a kernel crash.

So looks no userspace-visible effect for this.

-- 
Wei Yang
Help you, Help me


  reply	other threads:[~2024-10-28  2:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-27 12:33 Wei Yang
2024-10-27 13:32 ` Lorenzo Stoakes
2024-10-28  0:53 ` Andrew Morton
2024-10-28  2:47   ` Wei Yang [this message]
2024-10-28 15:00 ` Liam R. Howlett
2024-10-29  1:24   ` Wei Yang

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=20241028024753.yqteimzthoj2rmmi@master \
    --to=richard.weiyang@gmail.com \
    --cc=Liam.Howlett@Oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=stable@vger.kernel.org \
    --cc=vbabka@suse.cz \
    /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