From: Andrew Morton <akpm@linux-foundation.org>
To: Amerigo Wang <amwang@redhat.com>
Cc: linux-kernel@vger.kernel.org, esandeen@redhat.com,
eteo@redhat.com, eparis@redhat.com, amwang@redhat.com,
stable@kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [RESEND Patch v2] allow file truncations when both suid and write permissions set
Date: Fri, 24 Jul 2009 14:34:19 -0700 [thread overview]
Message-ID: <20090724143419.c479ab00.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090722091920.6642.43943.sendpatchset@localhost.localdomain>
On Wed, 22 Jul 2009 05:17:02 -0400
Amerigo Wang <amwang@redhat.com> wrote:
>
> V1 -> V2:
> Introduce dentry_remove_suid(), and use it in do_truncate().
> Thanks to Eric Paris.
>
>
> 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.
Thanks, I queued this up for Al's consideration.
> Signed-off-by: WANG Cong <amwang@redhat.com>
> Cc: stable@kernel.org
> Cc: Eric Sandeen <esandeen@redhat.com>
> Cc: Eric Paris <eparis@redhat.com>
> Cc: Eugene Teo <eteo@redhat.com>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
I removed the Cc:stable. I'm not really sure whether we want to
backport this.
In fact I'm not really sure that we want to merge it at all. It
introduces the risk that people will develope, test and ship
applications which malfunction when run on older kernels.
otoh we already have the risk that people's applications will run OK on
other OS's and will malfunction on Linux, and the patch fixes this.
prev parent reply other threads:[~2009-07-24 21:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 9:17 [RESEND Patch v2] allow file truncations when both suid and write permissions set Amerigo Wang
2009-07-24 21:34 ` Andrew Morton [this message]
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=20090724143419.c479ab00.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=amwang@redhat.com \
--cc=eparis@redhat.com \
--cc=esandeen@redhat.com \
--cc=eteo@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--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