From: Andrew Morton <akpm@linux-foundation.org>
To: Liu Ye <liuye@kylinos.cn>
Cc: Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com,
jannh@google.com, vbabka@suse.cz, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/vma: Add VM_WARN_ON for commit_merge
Date: Wed, 15 Jan 2025 20:01:38 -0800 [thread overview]
Message-ID: <20250115200138.708adc518dd4f92f4fe7fae5@linux-foundation.org> (raw)
In-Reply-To: <20250116025005.55846-1-liuye@kylinos.cn>
On Thu, 16 Jan 2025 10:50:05 +0800 Liu Ye <liuye@kylinos.cn> wrote:
> Add VM_WARN_ON to prevent 'adjust' from accessing NULL pointers
> when 'adjust' is NULL and 'expanded' is false or 'adj_start' is
> not zero.
>
> ...
>
> --- a/mm/vma.c
> +++ b/mm/vma.c
> @@ -641,6 +641,7 @@ static int commit_merge(struct vma_merge_struct *vmg,
>
> init_multi_vma_prep(&vp, vmg->vma, adjust, remove, remove2);
>
> + VM_WARN_ON(!adjust && (!expanded || adj_start));
> VM_WARN_ON(vp.anon_vma && adjust && adjust->anon_vma &&
> vp.anon_vma != adjust->anon_vma);
>
This won't prevent a null deref. It will emit a warning which
duplicates all the information which we're about to emit from the oops
handler.
Are there any reports of an oops from a NULL deref of `adjust'?
next prev parent reply other threads:[~2025-01-16 4:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 2:50 Liu Ye
2025-01-16 4:01 ` Andrew Morton [this message]
2025-01-16 6:06 ` liuye
2025-01-16 7:44 ` Lorenzo Stoakes
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=20250115200138.708adc518dd4f92f4fe7fae5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Liam.Howlett@oracle.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=lorenzo.stoakes@oracle.com \
--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