From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitri Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] kill suid bit only for regular files
Date: Sun, 26 Oct 2008 21:47:41 -0700 [thread overview]
Message-ID: <20081026214741.332c7656.akpm@linux-foundation.org> (raw)
In-Reply-To: <1224424839-3892-1-git-send-email-dmonakhov@openvz.org>
On Sun, 19 Oct 2008 18:00:39 +0400 Dmitri Monakhov <dmonakhov@openvz.org> wrote:
> We don't have to do it because it is useless for non regular files.
Are we sure that should_remove_suid() is not and never will used for
directories?
> In fact block device may trigger this path without dentry->d_inode->i_mutex.
What's wrong with blockdevs triggering this path?
Better changelogs, please.
> Signed-off-by: Dmitri Monakhov <dmonakhov@openvz.org>
> ---
> mm/filemap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/filemap.c b/mm/filemap.c
> index a2907d5..3d5a2e7 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -1767,7 +1767,7 @@ int should_remove_suid(struct dentry *dentry)
> if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
> kill |= ATTR_KILL_SGID;
>
> - if (unlikely(kill && !capable(CAP_FSETID)))
> + if (unlikely(kill && !capable(CAP_FSETID) && S_ISREG(mode)))
> return kill;
>
> return 0;
next prev parent reply other threads:[~2008-10-27 4:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-19 14:00 [PATCH] kill suid bit only for regular files Dmitri Monakhov
2008-10-27 4:47 ` Andrew Morton [this message]
2008-10-27 7:41 ` Dmitri Monakhov
2008-10-27 15:19 ` Krzysztof Halasa
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=20081026214741.332c7656.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dmonakhov@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).