Переглянути джерело

xfs: fix quotacheck dquot id overflow infinite loop

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 <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Brian Foster 8 роки тому
батько
коміт
cfaf2d0343
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      fs/xfs/xfs_qm.c

+ 3 - 0
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) {