mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
xfs: avoid UAF on sc->tempip in xrep_tempfile_create
LOLLM noticed a potential UAF if the tempfile creation code fails after
it set sc->tempip. Fix that.
Cc: stable@vger.kernel.org # v6.10
Fixes: 84c14ee39d ("xfs: create temporary files and directories for online repair")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
b1a296fc22
commit
0c88e10d12
|
|
@ -174,6 +174,7 @@ xrep_tempfile_create(
|
|||
xfs_iunlock(sc->tempip, XFS_ILOCK_EXCL);
|
||||
xfs_finish_inode_setup(sc->tempip);
|
||||
xchk_irele(sc, sc->tempip);
|
||||
sc->tempip = NULL;
|
||||
}
|
||||
out_release_dquots:
|
||||
xfs_qm_dqrele(udqp);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user