Commit 9cf74e4
committed
Fix for Sysbox issue #712.
The problem manifested itself when Docker Engine (>= v24.0), running inside a
Sysbox container, created a bind-mount using a source path such as
/proc/self/task/<tid>/ns/net. That mount unexpectedly failed with EPERM.
Turns out the problem was caused by a bug in sysbox-fs' mount syscall
interception, where it was not properly resolving mount paths such as
"/proc/self/task/<tid>/...". The reason is that <tid> is a thread-ID in the
container's pid-namespace, not in sysbox's pid-namespace, so sysbox-fs could not
resolve it properly in function process.ResolveProcSelf() (i.e., when it did
stat() on the path it failed).
I've not found a proper way to translate the <tid> from the container's pid-ns
to Sysbox's pid-ns. That would have been the proper fix.
For now, this commit works around the problem by assuming that <tid> = <pid>;
that's not ideal, but it's usually (likely always) the case for mount syscalls
we normally intercept.
Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>1 parent 31f6da4 commit 9cf74e4
3 files changed
+67
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
635 | 652 | | |
636 | 653 | | |
637 | 654 | | |
| |||
643 | 660 | | |
644 | 661 | | |
645 | 662 | | |
646 | | - | |
647 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
648 | 673 | | |
649 | 674 | | |
650 | 675 | | |
| |||
654 | 679 | | |
655 | 680 | | |
656 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
657 | 693 | | |
658 | 694 | | |
659 | 695 | | |
| |||
669 | 705 | | |
670 | 706 | | |
671 | 707 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 708 | + | |
| 709 | + | |
678 | 710 | | |
679 | 711 | | |
680 | 712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
923 | 947 | | |
| 948 | + | |
924 | 949 | | |
925 | 950 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
0 commit comments