From: Al Viro <viro@ZenIV.linux.org.uk>
To: Guillaume Chazarain <guichaz@yahoo.fr>
Cc: Rik van Riel <riel@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: advertise new restrictions on /proc/*/maps & /proc/*/smaps
Date: Fri, 4 Jan 2008 11:38:47 +0000 [thread overview]
Message-ID: <20080104113847.GZ27894@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20080104121502.2e6ccaa1@inria.fr>
On Fri, Jan 04, 2008 at 12:15:02PM +0100, Guillaume Chazarain wrote:
> Al Viro <viro@ZenIV.linux.org.uk> wrote:
>
> > The whole point is that we have to reject it at read() time, not open()
> > time.
>
> Yes, my patch was a complement to yours to propagate the -EPERM in easy
> cases. As you noted it added restrictions on reading /proc/*/maps, even
> though I found them acceptable.
>
> How about this instead?
>
> Maybe you'd prefer to propagate the actual -EPERM from
> __ptrace_may_attach but that would be more invasive.
>
> Sidenote: do you think a sparse annotation to check IS_ERR/PTR_ERR
> usage would make sense?
>
> proc: return -EPERM when preventing read of /proc/*/maps
>
> Return an error instead of successfully reading an empty file.
You are overcomplicating it - if ->start() returns ERR_PTR(), it's over;
read() will fail with that error and that's it. No need to mess with
->next(), etc. - it'll never see that ERR_PTR(-EPERM). Drop these chunks
and you've got an ACK...
prev parent reply other threads:[~2008-01-04 11:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-03 23:51 [PATCH] proc: advertise new restrictions on /proc/*/maps & /proc/*/smaps Guillaume Chazarain
2008-01-03 23:57 ` Al Viro
2008-01-04 11:15 ` Guillaume Chazarain
2008-01-04 11:38 ` Al Viro [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=20080104113847.GZ27894@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=guichaz@yahoo.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@redhat.com \
/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