Commit b08c8fc
committed
bpf: Re-support uid and gid when mounting bpffs
For a clean, conflict-free revert of the token-related patches in commit
d17aff8 ("Revert BPF token-related functionality"), the bpf fs commit
750e785 ("bpf: Support uid and gid when mounting bpffs") was undone
temporarily as well.
This patch manually re-adds the functionality from the original one back
in 750e785, no other functional changes intended.
Testing:
# mount -t bpf -o uid=65534,gid=65534 bpffs ./foo
# ls -la . | grep foo
drwxrwxrwt 2 nobody nogroup 0 Dec 20 13:16 foo
# mount -t bpf
bpffs on /root/foo type bpf (rw,relatime,uid=65534,gid=65534)
Also, passing invalid arguments for uid/gid are properly rejected as expected.
Fixes: d17aff8 ("Revert BPF token-related functionality")
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Christian Brauner <[email protected]>
Cc: Jie Jiang <[email protected]>
Cc: Andrii Nakryiko <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/bpf/[email protected]1 parent fc3a553 commit b08c8fc
1 file changed
+51
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
603 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
604 | 611 | | |
605 | 612 | | |
606 | 613 | | |
| |||
625 | 632 | | |
626 | 633 | | |
627 | 634 | | |
| 635 | + | |
| 636 | + | |
628 | 637 | | |
629 | 638 | | |
630 | 639 | | |
631 | 640 | | |
| 641 | + | |
| 642 | + | |
632 | 643 | | |
633 | 644 | | |
634 | 645 | | |
635 | 646 | | |
636 | 647 | | |
| 648 | + | |
| 649 | + | |
637 | 650 | | |
638 | 651 | | |
639 | 652 | | |
640 | 653 | | |
641 | 654 | | |
642 | 655 | | |
643 | 656 | | |
| 657 | + | |
| 658 | + | |
644 | 659 | | |
645 | 660 | | |
646 | 661 | | |
| |||
662 | 677 | | |
663 | 678 | | |
664 | 679 | | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
665 | 708 | | |
666 | 709 | | |
667 | 710 | | |
668 | 711 | | |
669 | 712 | | |
670 | 713 | | |
| 714 | + | |
| 715 | + | |
671 | 716 | | |
672 | 717 | | |
673 | 718 | | |
| |||
750 | 795 | | |
751 | 796 | | |
752 | 797 | | |
| 798 | + | |
| 799 | + | |
753 | 800 | | |
754 | 801 | | |
755 | 802 | | |
| |||
785 | 832 | | |
786 | 833 | | |
787 | 834 | | |
| 835 | + | |
| 836 | + | |
788 | 837 | | |
789 | 838 | | |
790 | 839 | | |
| |||
0 commit comments