linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [V5 Patch 0/2] fix file truncations when both suid and write permissions set
@ 2009-08-19  4:44 Amerigo Wang
  2009-08-19  4:44 ` [Patch 1/2] selinux: adjust rules for ATTR_FORCE Amerigo Wang
  2009-08-19  4:44 ` [Patch 2/2] vfs: allow file truncations when both suid and write permissions set Amerigo Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Amerigo Wang @ 2009-08-19  4:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: esandeen, eteo, eparis, Amerigo Wang, linux-fsdevel, akpm, sds,
	hirofumi, viro


Andrew, these two patches can replace the -mm patch
"vfs-allow-file-truncations-when-both-suid-and-write-permissions-set.patch".


When suid is set and the non-owner user has write permission,
any writing into this file should be allowed and suid should be
removed after that.

However, current kernel only allows writing without truncations,
when we do truncations on that file, we get EPERM. This is a bug.

Steps to reproduce this bug:

% ls -l rootdir/file1
-rwsrwsrwx 1 root root 3 Jun 25 15:42 rootdir/file1
% echo h > rootdir/file1
zsh: operation not permitted: rootdir/file1
% ls -l rootdir/file1
-rwsrwsrwx 1 root root 3 Jun 25 15:42 rootdir/file1
% echo h >> rootdir/file1
% ls -l rootdir/file1
-rwxrwxrwx 1 root root 5 Jun 25 16:34 rootdir/file1

This patch fixes it.

Signed-off-by: WANG Cong <amwang@redhat.com>

Thanks!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-19  4:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-19  4:44 [V5 Patch 0/2] fix file truncations when both suid and write permissions set Amerigo Wang
2009-08-19  4:44 ` [Patch 1/2] selinux: adjust rules for ATTR_FORCE Amerigo Wang
2009-08-19  4:44 ` [Patch 2/2] vfs: allow file truncations when both suid and write permissions set Amerigo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).