public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [patch] Re: [patch-2.4.0-test12-pre6] truncate(2) permissions
@ 2000-12-08  2:35 Andries.Brouwer
  2000-12-08  2:59 ` Alexander Viro
  0 siblings, 1 reply; 12+ messages in thread
From: Andries.Brouwer @ 2000-12-08  2:35 UTC (permalink / raw)
  To: aeb, viro; +Cc: linux-kernel

> BTW, if you still have 1.7, 1.10, 1.13 and 1.14...

See ftp://ftp.cwi.nl/pub/aeb/manpages/ (will soon disappear again).

> BTW, could we finally lose mpx(2)?

Maybe we lost it - I find sys_mpx only in a comment in arch/arm/kernel/calls.S

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [patch-2.4.0-test12-pre6] truncate(2) permissions
@ 2000-12-06 22:38 Alexander Viro
  2000-12-07 10:18 ` [patch] " Tigran Aivazian
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Viro @ 2000-12-06 22:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Tigran Aivazian, linux-kernel



On Wed, 6 Dec 2000, Linus Torvalds wrote:

> 
> 
> On Wed, 6 Dec 2000, Tigran Aivazian wrote:
> > 
> > This patch combines your previous patch with 2 changes I have just
> > suggested. Both changes are obvious (and correct).
> 
> Why remove the EROFS test?

Tigran has a point - permission() does

        if ((mask & S_IWOTH) && IS_RDONLY(inode) &&
                 (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
                return -EROFS; /* Nobody gets write access to a read-only fs */

so do_sys_truncate() has no chance in hell to trigger its own check for
IS_RDONLY() - we have

        if (!S_ISREG(inode->i_mode))
                goto dput_and_out;

        error = permission(inode,MAY_WRITE);
        if (error)
                goto dput_and_out;

        error = -EROFS;
        if (IS_RDONLY(inode))
                goto dput_and_out;

there, so if it's not a regular file we die before the call of permission(),
if it is and fs is readonly - we get -EROFS from permission() and die
there. In either case we don't get to the IS_RDONLY() check...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2000-12-08 11:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-08  2:35 [patch] Re: [patch-2.4.0-test12-pre6] truncate(2) permissions Andries.Brouwer
2000-12-08  2:59 ` Alexander Viro
2000-12-08 11:25   ` Marko Kreen
  -- strict thread matches above, loose matches on Subject: below --
2000-12-06 22:38 Alexander Viro
2000-12-07 10:18 ` [patch] " Tigran Aivazian
2000-12-07 10:53   ` Tigran Aivazian
2000-12-07 13:23   ` Alexander Viro
2000-12-07 13:48     ` Tigran Aivazian
2000-12-07 15:03     ` Tigran Aivazian
2000-12-07 15:24       ` Alexander Viro
2000-12-07 16:16         ` Andries Brouwer
2000-12-07 22:15           ` Alexander Viro
2000-12-07 16:06     ` Andries Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox