Skip to content

Regression: Wrong file owner when using Sysbox CE 0.6.5 or 0.6.6 #922

Closed
nestybox/sysbox-libs
#60
@smarsching

Description

@smarsching

After upgrading from Sysbox CE 0.6.3 to 0.6.6, I experienced an issue with file ownership inside the container. I was able to determine that this problem was first introduced with version 0.6.5 (version 0.6.4 still works fine).

The issue can be demonstrated in the following way:

docker run --rm -it --runtime sysbox-runc ubuntu:noble-20250127 ls -l /usr/bin/perl5.38.2
-rwxr-xr-x 2 nobody nogroup 4019312 Apr  5  2024 /usr/bin/perl5.38.2

stat /usr/bin/perl*
  File: /usr/bin/perl
  Size: 3802104   	Blocks: 7432       IO Block: 4096   regular file
Device: 3dh/61d	Inode: 1314501     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-11-23 14:56:46.000000000 +0000
Modify: 2023-11-23 14:56:46.000000000 +0000
Change: 2025-03-28 13:02:32.849864194 +0000
 Birth: 2025-03-28 13:02:32.849864194 +0000
  File: /usr/bin/perl5.34.0
  Size: 3802104   	Blocks: 7432       IO Block: 4096   regular file
Device: 3dh/61d	Inode: 1064129     Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (65534/  nobody)   Gid: (65534/ nogroup)
Access: 2023-11-23 14:56:46.000000000 +0000
Modify: 2023-11-23 14:56:46.000000000 +0000
Change: 2025-03-01 16:21:07.687144619 +0000
 Birth: 2025-03-01 16:21:07.667144958 +0000

When using the regular runc runtime, the problem does not appear:

docker run --rm -it --runtime runc ubuntu:noble-20250127 ls -l /usr/bin/perl5.38.2
-rwxr-xr-x 2 root root 4019312 Apr  5  2024 /usr/bin/perl5.38.2

stat /usr/bin/perl*
  File: /usr/bin/perl
  Size: 3802104   	Blocks: 7432       IO Block: 4096   regular file
Device: 2eh/46d	Inode: 1064129     Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-11-23 14:56:46.000000000 +0000
Modify: 2023-11-23 14:56:46.000000000 +0000
Change: 2025-03-01 16:21:07.687144619 +0000
 Birth: 2025-03-01 16:21:07.667144958 +0000
  File: /usr/bin/perl5.34.0
  Size: 3802104   	Blocks: 7432       IO Block: 4096   regular file
Device: 2eh/46d	Inode: 1064129     Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-11-23 14:56:46.000000000 +0000
Modify: 2023-11-23 14:56:46.000000000 +0000
Change: 2025-03-01 16:21:07.687144619 +0000
 Birth: 2025-03-01 16:21:07.667144958 +0000

I am not entirely sure why the file /usr/bin/perl5.38.2 (and /usr/bin/gunzip). I suspect that the problem is related to the fact that these are hard links. With the regular runc runtime, both paths correctly refer to the same inode, but with sysbox-runc, the inode ID differs and the ownership differs as well.

When inspecting the image on the host, the ownership seems to be correct:

ls -l /var/lib/docker/overlay2/b859e9bbadcf1093e5fcfd997d4719de4ba633ec97b1517b46fd68a8b3d71c07/diff/usr/bin/perl5.38.2 
-rwxr-xr-x 2 root root 4019312 Apr  5  2024 /var/lib/docker/overlay2/b859e9bbadcf1093e5fcfd997d4719de4ba633ec97b1517b46fd68a8b3d71c07/diff/usr/bin/perl5.38.2

stat /var/lib/docker/overlay2/b859e9bbadcf1093e5fcfd997d4719de4ba633ec97b1517b46fd68a8b3d71c07/diff/usr/bin/perl*
  File: /var/lib/docker/overlay2/b859e9bbadcf1093e5fcfd997d4719de4ba633ec97b1517b46fd68a8b3d71c07/diff/usr/bin/perl
  Size: 4019312   	Blocks: 7856       IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 1069581     Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-04-05 21:57:12.000000000 +0200
Modify: 2024-04-05 21:57:12.000000000 +0200
Change: 2025-03-01 17:21:10.127103244 +0100
 Birth: 2025-03-01 17:21:10.099103719 +0100
  File: /var/lib/docker/overlay2/b859e9bbadcf1093e5fcfd997d4719de4ba633ec97b1517b46fd68a8b3d71c07/diff/usr/bin/perl5.38.2
  Size: 4019312   	Blocks: 7856       IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 1069581     Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-04-05 21:57:12.000000000 +0200
Modify: 2024-04-05 21:57:12.000000000 +0200
Change: 2025-03-01 17:21:10.127103244 +0100
 Birth: 2025-03-01 17:21:10.099103719 +0100

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions