When an unprivileged process attempts to modify a file that has the
setuid or setgid bits set, the VFS will attempt to clear these bits. The
VFS will set the ATTR_KILL_SUID or ATTR_KILL_SGID bits in the ia_valid
mask, and then call notify_change to clear these bits and set the mode
accordingly.
Make notify_change not clear the ATTR_KILL_S*ID bits in the ia_vaid that
gets passed to the setattr inode operation. This allows the filesystems
to reinterpret whether this mode change is simply intended to clear the
setuid/setgid bits.
This means that notify_change should never be called with
If the ATTR_KILL_S*ID bits are set then any mode change is only for
clearing the setuid/setgid bits. For NFS skip the mode change and
let the server handle it.
Signed-off-by: Jeff Layton [EMAIL PROTECTED]
---
fs/nfs/inode.c |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff
If the ATTR_KILL_S*ID bits are set then any mode change is only for
clearing the setuid/setgid bits. For NFS, skip the mode change and
let the server handle it.
Signed-off-by: Jeff Layton [EMAIL PROTECTED]
---
fs/cifs/inode.c |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
diff
Make sure ecryptfs doesn't trip the BUG() in notify_change. This also
allows the lower filesystem to interpret these bits in their own way.
Signed-off-by: Jeff Layton [EMAIL PROTECTED]
---
fs/ecryptfs/inode.c |8
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git
It's theoretically possible for a single SETATTR call to come in that
sets the mode and the uid/gid. In that case, assume the mode is
correct and don't set the ATTR_KILL_S*ID bits. Doing so would trip the
BUG() in notify_change.
Signed-off-by: Jeff Layton [EMAIL PROTECTED]
---
fs/nfsd/vfs.c |
reiserfs_setattr can call notify_change recursively using the same
iattr struct. This could cause it to trip the BUG() in notify_change.
Fix reiserfs to clear those bits near the beginning of the function.
Signed-off-by: Jeff Layton [EMAIL PROTECTED]
---
fs/reiserfs/inode.c |6 +-
1
Don't allow either function to trip the BUG() in notify_change. For
unionfs_setattr, clear ATTR_MODE if the either ATTR_KILL_S*ID is set.
unionfs_create is setting the mode explicitly already. Don't set
ATTR_KILL_S*ID. Just fix up the mode to have the same effect. Also, move
locking the i_mutex
On Sep 03, 2007 20:03 +0200, Jan Kara wrote:
I've finally got to writing up some proposal how could look system calls
allowing for online filesystem defragmentation and generally moving file
blocks around for improving performance. Comments are welcome.
int sys_movedata(int datafd, int