From: Amerigo Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: esandeen@redhat.com, eteo@redhat.com, eparis@redhat.com,
Amerigo Wang <amwang@redhat.com>,
linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org,
sds@tycho.nsa.gov, hirofumi@mail.parknet.co.jp,
viro@zeniv.linux.org.uk
Subject: [V5 Patch 0/2] fix file truncations when both suid and write permissions set
Date: Wed, 19 Aug 2009 00:44:33 -0400 [thread overview]
Message-ID: <20090819044658.5380.43869.sendpatchset@localhost.localdomain> (raw)
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!
next reply other threads:[~2009-08-19 4:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-19 4:44 Amerigo Wang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090819044658.5380.43869.sendpatchset@localhost.localdomain \
--to=amwang@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=eparis@redhat.com \
--cc=esandeen@redhat.com \
--cc=eteo@redhat.com \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).