Re: [PATCH v2] Fix NULL pointer dereference in read_cache_folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30/09/24 20:14, Matthew Wilcox wrote:
On Mon, Sep 30, 2024 at 11:02:26AM +0200, Gianfranco Trad wrote:
@@ -2360,6 +2360,8 @@ static int filemap_read_folio(struct file *file, filler_t filler,
  	/* Start the actual read. The read will unlock the page. */
  	if (unlikely(workingset))
  		psi_memstall_enter(&pflags);
+	if (!filler)
+		return -EIO;

This is definitely wrong because you enter memstall, but do not exit it.

Got it, thanks.


As Andrew says, the underlying problem is that the filesystem does not
implement ->read_folio.  Which filesystem is this?

Reproducer via procfs accesses a bpf map backed by an anonymous
inode (anon_inode_fs_type), with mapping->a_ops pointing to anon_aops,
hence, read_folio() undefined.


  	error = filler(file, folio);
  	if (unlikely(workingset))
  		psi_memstall_leave(&pflags);
--
2.43.0


I suppose the next step would be to contact the proper maintainers(?)
If you have any additional suggestions, I'd be more than glad to listen.

Thanks to both of you for your time,

--Gian





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux