linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: kernel test robot <yujie.liu@intel.com>
Cc: Christoph Hellwig <hch@lst.de>, <oe-lkp@lists.linux.dev>,
	<lkp@intel.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	"Andreas Gruenbacher" <agruenba@redhat.com>,
	Hugh Dickins <hughd@google.com>,
	"Matthew Wilcox" <willy@infradead.org>,
	<linux-afs@lists.infradead.org>, <linux-ext4@vger.kernel.org>,
	<linux-xfs@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	<linux-nfs@vger.kernel.org>, <linux-nilfs@vger.kernel.org>,
	<cgroups@vger.kernel.org>
Subject: Re: [linux-next:master] [mm] 480c454ff6: BUG:kernel_NULL_pointer_dereference
Date: Mon, 13 Mar 2023 19:19:31 -0700	[thread overview]
Message-ID: <20230313191931.f84776cb09dc8c4b50673a76@linux-foundation.org> (raw)
In-Reply-To: <202303140916.5e8e96b2-yujie.liu@intel.com>

On Tue, 14 Mar 2023 10:10:42 +0800 kernel test robot <yujie.liu@intel.com> wrote:

> Greeting,
> 
> Previous report:
> https://lore.kernel.org/oe-lkp/202303100947.9b421b1c-yujie.liu@intel.com
> 
> FYI, we noticed BUG:kernel_NULL_pointer_dereference,address due to commit (built with gcc-11):
> 
> commit: 480c454ff64b734a35677ee4b239e32143a4235c ("mm: return an ERR_PTR from __filemap_get_folio")
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
> 
> [test failed on linux-next/master 24469a0e5052ba01a35a15f104717a82b7a4798b]
> 
> in testcase: trinity
> version: trinity-x86_64-e63e4843-1_20220913
> with following parameters:
> 
> 	runtime: 300s
> 	group: group-04
> 
> test-description: Trinity is a linux system call fuzz tester.
> test-url: http://codemonkey.org.uk/projects/trinity/
> 
> on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G
> 
> caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
> 
> 
> [   29.300153][ T6430] BUG: kernel NULL pointer dereference, address: 0000000000000000

Thanks, I expect this is fixed by

commit 151dff099e8e6d9c8efcc75ad0ad3b8eead58704
Author: Christoph Hellwig <hch@lst.de>
Date:   Fri Mar 10 08:00:23 2023 +0100

    mm-return-an-err_ptr-from-__filemap_get_folio-fix
    
    fix null-pointer deref
    
    Link: https://lkml.kernel.org/r/20230310070023.GA13563@lst.de
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Reported-by: Naoya Horiguchi <naoya.horiguchi@linux.dev>
      Link: https://lkml.kernel.org/r/20230310043137.GA1624890@u2004
    Cc: Andreas Gruenbacher <agruenba@redhat.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

diff --git a/mm/swap_state.c b/mm/swap_state.c
index c7160070b9da..b76a65ac28b3 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -390,6 +390,8 @@ struct folio *filemap_get_incore_folio(struct address_space *mapping,
 	struct swap_info_struct *si;
 	struct folio *folio = filemap_get_entry(mapping, index);
 
+	if (!folio)
+		return ERR_PTR(-ENOENT);
 	if (!xa_is_value(folio))
 		return folio;
 	if (!shmem_mapping(mapping))




  reply	other threads:[~2023-03-14  2:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14  2:10 [linux-next:master] [mm] 480c454ff6: BUG:kernel_NULL_pointer_dereference kernel test robot
2023-03-14  2:19 ` Andrew Morton [this message]
2023-03-14  5:50   ` Christoph Hellwig

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=20230313191931.f84776cb09dc8c4b50673a76@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=agruenba@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=hughd@google.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=willy@infradead.org \
    --cc=yujie.liu@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;
as well as URLs for NNTP newsgroup(s).