From: Taylor Jackson Date: Tue, 26 Mar 2024 20:33:51 +0000 (+0000) Subject: vfs/idmapped_mounts.c: Incorrect array index for nested user ns X-Git-Tag: v2024.03.31~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c4d6d42f2109a8447796436d7d1ba4e3fa5256b3;p=xfstests-dev.git vfs/idmapped_mounts.c: Incorrect array index for nested user ns 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 Reviewed-by: Christian Brauner Signed-off-by: Zorro Lang --- diff --git a/src/vfs/idmapped-mounts.c b/src/vfs/idmapped-mounts.c index 547182fe..34052ca3 100644 --- a/src/vfs/idmapped-mounts.c +++ b/src/vfs/idmapped-mounts.c @@ -6556,7 +6556,7 @@ static int nested_userns(const struct vfstest_info *info) } /* 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);