Commit 81e27c94 authored by Brian Foster's avatar Brian Foster Committed by Greg Kroah-Hartman

xfs: fix quotacheck dquot id overflow infinite loop

commit cfaf2d03 upstream.

If a dquot has an id of U32_MAX, the next lookup index increment
overflows the uint32_t back to 0. This starts the lookup sequence
over from the beginning, repeats indefinitely and results in a
livelock.

Update xfs_qm_dquot_walk() to explicitly check for the lookup
overflow and exit the loop.
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 01bc1320
...@@ -111,6 +111,9 @@ xfs_qm_dquot_walk( ...@@ -111,6 +111,9 @@ xfs_qm_dquot_walk(
skipped = 0; skipped = 0;
break; break;
} }
/* we're done if id overflows back to zero */
if (!next_index)
break;
} }
if (skipped) { if (skipped) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment