Within the vfs test for idmapped mounts, the function nested_userns()
is using an incorrect array index when attempting to set up the mapping
for the 4th nested user ns within hierarchy[4]. The correct index that
belongs to the 4th nested user ns is actually hierarchy[3].
And hierarchy[4] is reserved for the dummy entry that marks the end
of the array.
Signed-off-by: Taylor Jackson <tjackson9431@gmail.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
}
/* Don't write a mapping in the 4th userns. */
- list_empty(&hierarchy[4].id_map);
+ list_empty(&hierarchy[3].id_map);
/* Create the actual userns hierarchy. */
ret = create_userns_hierarchy(hierarchy);