Skip to content

Commit eea7feb

Browse files
committed
ocfs2: Fix use after free on remount read-only
We also have to cancel quota syncing thread on remount read only because at that moment quota is being turned off. Otherwise quota syncing thread will try to access already freed quota structures. Signed-off-by: Jan Kara <jack@suse.cz>
1 parent f4b87de commit eea7feb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎fs/ocfs2/super.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,15 @@ static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend)
883883
sb_dqopt(sb)->files[type],
884884
type, QFMT_OCFS2,
885885
DQUOT_SUSPENDED);
886-
else
886+
else {
887+
struct ocfs2_mem_dqinfo *oinfo;
888+
889+
/* Cancel periodic syncing before suspending */
890+
oinfo = sb_dqinfo(sb, type)->dqi_priv;
891+
cancel_delayed_work_sync(&oinfo->dqi_sync_work);
887892
status = vfs_quota_disable(sb, type,
888893
DQUOT_SUSPENDED);
894+
}
889895
if (status < 0)
890896
break;
891897
}

0 commit comments

Comments
 (0)