dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Zack Rusin <zackr@vmware.com>
To: "willy@infradead.org" <willy@infradead.org>
Cc: "linmiaohe@huawei.com" <linmiaohe@huawei.com>,
	"jack@suse.cz" <jack@suse.cz>,
	"david@redhat.com" <david@redhat.com>,
	"neilb@suse.de" <neilb@suse.de>,
	"shy828301@gmail.com" <shy828301@gmail.com>,
	Michael Banack <banackm@vmware.com>,
	"mhocko@kernel.org" <mhocko@kernel.org>,
	"dhowells@redhat.com" <dhowells@redhat.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"khalid.aziz@oracle.com" <khalid.aziz@oracle.com>,
	Nadav Amit <namit@vmware.com>, "hch@lst.de" <hch@lst.de>,
	Maaz Mombasawala <mombasawalam@vmware.com>,
	"aarcange@redhat.com" <aarcange@redhat.com>,
	Martin Krastev <krastevm@vmware.com>,
	"jannh@google.com" <jannh@google.com>,
	"hughd@google.com" <hughd@google.com>,
	"zhangliang5@huawei.com" <zhangliang5@huawei.com>,
	"rppt@linux.ibm.com" <rppt@linux.ibm.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"rientjes@google.com" <rientjes@google.com>,
	"pedrodemargomes@gmail.com" <pedrodemargomes@gmail.com>,
	"riel@surriel.com" <riel@surriel.com>,
	"jhubbard@nvidia.com" <jhubbard@nvidia.com>,
	"shakeelb@google.com" <shakeelb@google.com>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"songmuchun@bytedance.com" <songmuchun@bytedance.com>,
	"surenb@google.com" <surenb@google.com>,
	"vbabka@suse.cz" <vbabka@suse.cz>,
	"zhanghongchen@loongson.cn" <zhanghongchen@loongson.cn>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"oleg@redhat.com" <oleg@redhat.com>,
	"minchan@kernel.org" <minchan@kernel.org>,
	"ddutile@redhat.com" <ddutile@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"guro@fb.com" <guro@fb.com>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"mike.kravetz@oracle.com" <mike.kravetz@oracle.com>
Subject: Re: [PATCH] mm: Fix a null ptr deref with CONFIG_DEBUG_VM enabled in wp_page_reuse
Date: Wed, 27 Jul 2022 19:31:34 +0000	[thread overview]
Message-ID: <66333fb601dfd3e487e856156988d91c05d94d9b.camel@vmware.com> (raw)
In-Reply-To: <YuGQ9tJPUcqnqvAV@casper.infradead.org>

On Wed, 2022-07-27 at 20:24 +0100, Matthew Wilcox wrote:
> On Wed, Jul 27, 2022 at 03:14:07PM -0400, Zack Rusin wrote:
> > From: Zack Rusin <zackr@vmware.com>
> > 
> > Write page faults on last references might not have a valid page anymore.
> > wp_page_reuse has always dealt with that scenario by making
> > sure the page isn't null (or the reference was shared) before doing
> > anything with it. Recently added checks in VM_BUG_ON (enabled by the
> > CONFIG_DEBUG_VM option) use PageAnon helpers which assume the passed
> > page is never null, before making sure there is a valid page to work
> > with.
> > 
> > Move the VM_BUG_ON, which unconditionally uses the page, after the
> > code that checks that we have a valid one.
> 
> Message-ID: <CAHk-=wh_TrgNm6vz7=7CgZppr0UrZ9TwLyb3dgPXyG-w=a8kJQ@mail.gmail.com>

Ah, great, thanks.

z

      reply	other threads:[~2022-07-27 19:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 19:14 [PATCH] mm: Fix a null ptr deref with CONFIG_DEBUG_VM enabled in wp_page_reuse Zack Rusin
2022-07-27 19:24 ` Matthew Wilcox
2022-07-27 19:31   ` Zack Rusin [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=66333fb601dfd3e487e856156988d91c05d94d9b.camel@vmware.com \
    --to=zackr@vmware.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=banackm@vmware.com \
    --cc=david@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=guro@fb.com \
    --cc=hch@lst.de \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=khalid.aziz@oracle.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=krastevm@vmware.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=minchan@kernel.org \
    --cc=mombasawalam@vmware.com \
    --cc=namit@vmware.com \
    --cc=neilb@suse.de \
    --cc=oleg@redhat.com \
    --cc=pedrodemargomes@gmail.com \
    --cc=peterx@redhat.com \
    --cc=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=rppt@linux.ibm.com \
    --cc=shakeelb@google.com \
    --cc=shy828301@gmail.com \
    --cc=songmuchun@bytedance.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    --cc=zhanghongchen@loongson.cn \
    --cc=zhangliang5@huawei.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;
as well as URLs for NNTP newsgroup(s).