Skip to content

fs: Fixes for removing xid bits and security labels

Jan Kara linux-fsdevel stable 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 0 repliesNew
  2. v35 patches 2 repliesSuperseded
  3. v2 posting 2/25 patches 5 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/25 patches1 replySuperseded
v15 patches7 repliesSuperseded

Changes in v4 from the cover letter

* Updated changelogs and some comments to speak about capabilities and not security labels.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5fs: Fix S_NOSEC handlingfs/inode.c+2 -20 replies
2/5fs: Rename file_remove_suid() to file_remove_privs()fs/btrfs/file.c fs/ceph/file.c fs/fuse/file.c +5 more+15 -120 replies
3/5fs: Provide function telling whether file_remove_privs() will do anythingfs/inode.c include/linux/fs.h+33 -120 replies
4/5fs: Call security_ops->inode_killpriv on truncatefs/inode.c fs/open.c include/linux/fs.h+11 -60 replies
5/5xfs: Correctly lock inode when removing suid and file capabilitiesfs/xfs/xfs_file.c+10 -10 replies
5/5xfs: Correctly lock inode when removing suid and security marksfs/xfs/xfs_file.c+10 -10 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchDave Chinner
1/5
2/5
3/5
4/5
5/5R-b R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH 0/5 v4] fs: Fixes for removing xid bits and security labels

Hello,

This is the fourth version of my patches to fix handling of s[ug]id bits and
capabilities xattrs in VFS. There are a few issues I found:

1) MS_NOSEC handling is broken - we set it after each file_remove_suid() call. However we needn't have removed suid bit simply because we have CAP_SYS_FSID and further writes to the file from processes without this capability still need to clear the suid bit.
2) file_remove_suid() is a misnomer since it also handles removing of file capabilities. It is even more confusing because should_remove_suid() doesn't return whether file_remove_suid() is needed or not.
3) On truncate we do clear suid bits but not file capabilities.
4) ocfs2 doesn't clear capability xattrs - hard to fix, I left it alone for now.
5) XFS didn't provide proper exclusion for clearing mode bits.

This series aims at fixing above issues. Al, can you please merge the
patches? Thanks!

Changes since v3:
* Updated changelogs and some comments to speak about capabilities and not security labels.

Changes since v2:
* Rebased on top of current Linus' tree
* Improved patch 1 to use inode_has_no_xattr() as Linus suggested

Changes since v1:
* Removed bogus patch changing inode_set_flags()
* Updated changelog of patch 4/5 to better explain why ->inode_killpriv should be called
* Included a fix for MS_NOSEC handling in this series.

Honza