Commit d0deeb8
committed
Merge tag 'vfs-6.19-rc1.ovl' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull overlayfs cred guard conversion from Christian Brauner:
"This converts all of overlayfs to use credential guards, eliminating
manual credential management throughout the filesystem.
Credential guard conversion:
- Convert all of overlayfs to use credential guards, replacing the
manual ovl_override_creds()/ovl_revert_creds() pattern with scoped
guards.
This makes credential handling visually explicit and eliminates a
class of potential bugs from mismatched override/revert calls.
(1) Basic credential guard (with_ovl_creds)
(2) Creator credential guard (ovl_override_creator_creds):
Introduced a specialized guard for file creation operations
that handles the two-phase credential override (mounter
credentials, then fs{g,u}id override). The new pattern is much
clearer:
with_ovl_creds(dentry->d_sb) {
scoped_class(prepare_creds_ovl, cred, dentry, inode, mode) {
if (IS_ERR(cred))
return PTR_ERR(cred);
/* creation operations */
}
}
(3) Copy-up credential guard (ovl_cu_creds):
Introduced a specialized guard for copy-up operations,
simplifying the previous struct ovl_cu_creds helper and
associated functions.
Ported ovl_copy_up_workdir() and ovl_copy_up_tmpfile() to this
pattern.
Cleanups:
- Remove ovl_revert_creds() after all callers converted to guards
- Remove struct ovl_cu_creds and associated functions
- Drop ovl_setup_cred_for_create() after conversion
- Refactor ovl_fill_super(), ovl_lookup(), ovl_iterate(),
ovl_rename() for cleaner credential guard scope
- Introduce struct ovl_renamedata to simplify rename handling
- Don't override credentials for ovl_check_whiteouts() (unnecessary)
- Remove unneeded semicolon"
* tag 'vfs-6.19-rc1.ovl' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (54 commits)
ovl: remove unneeded semicolon
ovl: remove struct ovl_cu_creds and associated functions
ovl: port ovl_copy_up_tmpfile() to cred guard
ovl: mark *_cu_creds() as unused temporarily
ovl: port ovl_copy_up_workdir() to cred guard
ovl: add copy up credential guard
ovl: drop ovl_setup_cred_for_create()
ovl: port ovl_create_or_link() to new ovl_override_creator_creds cleanup guard
ovl: mark ovl_setup_cred_for_create() as unused temporarily
ovl: reflow ovl_create_or_link()
ovl: port ovl_create_tmpfile() to new ovl_override_creator_creds cleanup guard
ovl: add ovl_override_creator_creds cred guard
ovl: remove ovl_revert_creds()
ovl: port ovl_fill_super() to cred guard
ovl: refactor ovl_fill_super()
ovl: port ovl_lower_positive() to cred guard
ovl: port ovl_lookup() to cred guard
ovl: refactor ovl_lookup()
ovl: port ovl_copyfile() to cred guard
ovl: port ovl_rename() to cred guard
...10 files changed
Lines changed: 629 additions & 672 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
724 | 724 | | |
725 | 725 | | |
726 | 726 | | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
| 727 | + | |
733 | 728 | | |
| 729 | + | |
734 | 730 | | |
735 | 731 | | |
736 | | - | |
737 | | - | |
| 732 | + | |
738 | 733 | | |
739 | | - | |
| 734 | + | |
740 | 735 | | |
741 | | - | |
742 | | - | |
| 736 | + | |
| 737 | + | |
743 | 738 | | |
744 | | - | |
| 739 | + | |
745 | 740 | | |
746 | 741 | | |
747 | | - | |
| 742 | + | |
748 | 743 | | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
753 | 748 | | |
754 | 749 | | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
755 | 754 | | |
756 | 755 | | |
757 | 756 | | |
| |||
763 | 762 | | |
764 | 763 | | |
765 | 764 | | |
766 | | - | |
767 | 765 | | |
768 | 766 | | |
769 | 767 | | |
| |||
772 | 770 | | |
773 | 771 | | |
774 | 772 | | |
775 | | - | |
776 | | - | |
777 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
778 | 776 | | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
783 | 781 | | |
784 | 782 | | |
785 | 783 | | |
| |||
857 | 855 | | |
858 | 856 | | |
859 | 857 | | |
860 | | - | |
861 | 858 | | |
862 | 859 | | |
863 | | - | |
864 | | - | |
865 | | - | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
866 | 868 | | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | 869 | | |
872 | 870 | | |
873 | 871 | | |
| |||
1203 | 1201 | | |
1204 | 1202 | | |
1205 | 1203 | | |
1206 | | - | |
1207 | 1204 | | |
1208 | 1205 | | |
1209 | 1206 | | |
| |||
1223 | 1220 | | |
1224 | 1221 | | |
1225 | 1222 | | |
1226 | | - | |
1227 | 1223 | | |
1228 | 1224 | | |
1229 | 1225 | | |
| |||
1243 | 1239 | | |
1244 | 1240 | | |
1245 | 1241 | | |
1246 | | - | |
| 1242 | + | |
| 1243 | + | |
1247 | 1244 | | |
1248 | 1245 | | |
1249 | 1246 | | |
1250 | 1247 | | |
1251 | | - | |
1252 | 1248 | | |
1253 | 1249 | | |
1254 | 1250 | | |
| |||
0 commit comments