Message ID | 20240326-mount-setattr-test-v1-1-c061b040d0f7@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Patches to update xfs test "generic/645" for mount_setattr | expand |
On Tue, Mar 26, 2024 at 08:33:51PM +0000, Taylor Jackson via B4 Relay wrote: > From: Taylor Jackson <tjackson9431@gmail.com> > > 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> > --- Ah, thanks for fixing this! Reviewed-by: Christian Brauner <brauner@kernel.org>
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);