* [PATCH] missing checks in exec_permission_light()
@ 2002-05-01 3:41 Alexander Viro
2002-05-01 8:03 ` Daniel Pittman
2002-05-03 8:03 ` Pavel Machek
0 siblings, 2 replies; 6+ messages in thread
From: Alexander Viro @ 2002-05-01 3:41 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
Missing checks added...
diff -urN C12-0/fs/namei.c C12-current/fs/namei.c
--- C12-0/fs/namei.c Tue Apr 30 20:23:38 2002
+++ C12-current/fs/namei.c Tue Apr 30 23:37:15 2002
@@ -324,6 +324,12 @@
if (mode & MAY_EXEC)
return 0;
+ if ((inode->i_mode & S_IXUGO) && capable(CAP_DAC_OVERRIDE))
+ return 0;
+
+ if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
+ return 0;
+
return -EACCES;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] missing checks in exec_permission_light()
2002-05-01 3:41 [PATCH] missing checks in exec_permission_light() Alexander Viro
@ 2002-05-01 8:03 ` Daniel Pittman
2002-05-03 8:03 ` Pavel Machek
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Pittman @ 2002-05-01 8:03 UTC (permalink / raw)
To: Alexander Viro; +Cc: linux-kernel
On Tue, 30 Apr 2002, Alexander Viro wrote:
> Missing checks added...
>
> diff -urN C12-0/fs/namei.c C12-current/fs/namei.c
> --- C12-0/fs/namei.c Tue Apr 30 20:23:38 2002
> +++ C12-current/fs/namei.c Tue Apr 30 23:37:15 2002
> @@ -324,6 +324,12 @@
> if (mode & MAY_EXEC)
> return 0;
>
> + if ((inode->i_mode & S_IXUGO) && capable(CAP_DAC_OVERRIDE))
> + return 0;
> +
> + if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
> + return 0;
> +
> return -EACCES;
> }
Looking at this it seems that it would explain the odd set of errors I
got reported during bootup under 2.5.12 -- a set of "permission denied"
errors from find(1) where, under 2.5.6, none had occurred.
These were on directories that are not owner by root, with the process
running as root.
I can look deeper into the problem, though, if you don't think that this
is the cause of it.
Regards,
Daniel
--
It is easier to build strong children than to repair broken men.
-- Frederick Douglas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] missing checks in exec_permission_light()
2002-05-01 3:41 [PATCH] missing checks in exec_permission_light() Alexander Viro
2002-05-01 8:03 ` Daniel Pittman
@ 2002-05-03 8:03 ` Pavel Machek
2002-05-03 8:36 ` Alexander Viro
1 sibling, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2002-05-03 8:03 UTC (permalink / raw)
To: Alexander Viro; +Cc: Linus Torvalds, linux-kernel
Hi!
> + if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
> + return 0;
Is this right? This means that root can do cat /, no? That does not
seem like expected behaviour.
Pavel
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] missing checks in exec_permission_light()
2002-05-03 8:03 ` Pavel Machek
@ 2002-05-03 8:36 ` Alexander Viro
2002-05-03 8:40 ` Pavel Machek
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Viro @ 2002-05-03 8:36 UTC (permalink / raw)
To: Pavel Machek; +Cc: Linus Torvalds, linux-kernel
On Fri, 3 May 2002, Pavel Machek wrote:
> Hi!
>
> > + if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
> > + return 0;
>
> Is this right? This means that root can do cat /, no? That does not
> seem like expected behaviour.
1) it's permission(..., MAY_EXEC)
2) in any case, root _can_ open "/" with O_RDONLY. Always could. That's
what you do for ls /, after all - open(2) followed by getdents(2). Now,
read(2) will fail (check what ->read() for directories is set to), but
that has nothing to permission checks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] missing checks in exec_permission_light()
2002-05-03 8:36 ` Alexander Viro
@ 2002-05-03 8:40 ` Pavel Machek
0 siblings, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2002-05-03 8:40 UTC (permalink / raw)
To: Alexander Viro; +Cc: Pavel Machek, Linus Torvalds, linux-kernel
Hi!
> > > + if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
> > > + return 0;
> >
> > Is this right? This means that root can do cat /, no? That does not
> > seem like expected behaviour.
>
> 1) it's permission(..., MAY_EXEC)
Okay, sorry.
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] missing checks in exec_permission_light()
[not found] <0C01A29FBAE24448A792F5C68F5EA47D27C6C7@nasdaq.ms.ensim.com>
@ 2002-05-03 8:36 ` pmenage
0 siblings, 0 replies; 6+ messages in thread
From: pmenage @ 2002-05-03 8:36 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-kernel, viro
In article <0C01A29FBAE24448A792F5C68F5EA47D27C6C7@nasdaq.ms.ensim.com>,
you write:
>Hi!
>
>> + if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
>> + return 0;
>
>Is this right? This means that root can do cat /, no? That does not
>seem like expected behaviour.
> Pavel
exec_permission_lite() is only used for MAY_EXEC checks.
Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-03 8:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-01 3:41 [PATCH] missing checks in exec_permission_light() Alexander Viro
2002-05-01 8:03 ` Daniel Pittman
2002-05-03 8:03 ` Pavel Machek
2002-05-03 8:36 ` Alexander Viro
2002-05-03 8:40 ` Pavel Machek
[not found] <0C01A29FBAE24448A792F5C68F5EA47D27C6C7@nasdaq.ms.ensim.com>
2002-05-03 8:36 ` pmenage
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®