generic/692: test group ownership change

When group ownership is changed a caller whose fsuid owns the inode can
change the group of the inode to any group they are a member of. When
searching through the caller's groups we failed to use the gid mapped
according to the idmapped mount otherwise we fail to change ownership.
Add a test for this.

Cc: Seth Forshee <>
Cc: Amir Goldstein <>
Cc: Christoph Hellwig <>
Cc: Aleksa Sarai <>
Cc: <>
Signed-off-by: Christian Brauner (Microsoft) <>
/* v2 */
- Zorro Lang <>:
  - various minor fixes

- Christian Brauner (Microsoft) <>:
  - Expand test to also cover overlayfs on top of idmapped mounts.

/* v3 */
- Amir Goldstein <>:
  - Switch from calls to the mount binary to _overlay_mount_dirs helper.

- Christian Brauner (Microsoft) <>:
  - Expand test to also cover non-idmapped mounts.
2 files changed