Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b26384dc authored by Eric Sandeen's avatar Eric Sandeen Committed by Dave Chinner
Browse files

xfs: fix NULL pointer dereference in xfs_filestream_lookup_ag()



If xfs_filestream_get_parent() fails, we have a null pip,
goto out, and attempt to IRELE(NULL).  This causes a null
pointer dereference and BUG().

Fix this by directly returning NULLAGNUMBER in this case.

Reported-by: default avatarAdrien Nader <adrien@notk.org>
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent d64588ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -322,7 +322,7 @@ xfs_filestream_lookup_ag(


	pip = xfs_filestream_get_parent(ip);
	pip = xfs_filestream_get_parent(ip);
	if (!pip)
	if (!pip)
		goto out;
		return NULLAGNUMBER;


	mru = xfs_mru_cache_lookup(mp->m_filestream, pip->i_ino);
	mru = xfs_mru_cache_lookup(mp->m_filestream, pip->i_ino);
	if (mru) {
	if (mru) {