lkml.org 
[lkml]   [2008]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] proc: advertise new restrictions on /proc/*/maps & /proc/*/smaps
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...


\
 
 \ /
  Last update: 2008-01-04 12:41    [W:0.066 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site