From: Brian Foster Date: Sun, 17 Sep 2017 21:06:39 +0000 (-0700) Subject: xfs: fix quotacheck dquot id overflow infinite loop X-Git-Tag: archive/raspbian/4.9.51-1+rpi1~7^2~37 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=81e27c94f9ab86c04ba4ca5f1d2bcf9e61f7b5af;p=linux-4.9.git xfs: fix quotacheck dquot id overflow infinite loop commit cfaf2d034360166e569a4929dd83ae9698bed856 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: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 8068867a8183..1fdd3face2d9 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -111,6 +111,9 @@ restart: skipped = 0; break; } + /* we're done if id overflows back to zero */ + if (!next_index) + break; } if (skipped) {