public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.11: mount flag noexec still broken for VFAT partition
@ 2001-10-10 20:01 Andris Pavenis
  2001-10-10 21:13 ` Andreas Dilger
  0 siblings, 1 reply; 10+ messages in thread
From: Andris Pavenis @ 2001-10-10 20:01 UTC (permalink / raw)
  To: linux-kernel

Similary as with 2.4.10 mount flag noexec does not work for VFAT
partition. I have following in fstab

/dev/hda1      /c       vfat     noexec,gid=201,umask=002,quiet  1    0
/dev/hda5      /d       vfat     noexec,gid=201,umask=002,quiet  1    0

but I see that all files in corresponding filesystems are still 
exectuable

Andris


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

* Re: 2.4.11: mount flag noexec still broken for VFAT partition
  2001-10-10 20:01 2.4.11: mount flag noexec still broken for VFAT partition Andris Pavenis
@ 2001-10-10 21:13 ` Andreas Dilger
  2001-10-10 22:36   ` Marko Kreen
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Dilger @ 2001-10-10 21:13 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: linux-kernel

On Oct 10, 2001  23:01 +0300, Andris Pavenis wrote:
> Similary as with 2.4.10 mount flag noexec does not work for VFAT
> partition. I have following in fstab
> 
> /dev/hda1      /c       vfat     noexec,gid=201,umask=002,quiet  1    0
> /dev/hda5      /d       vfat     noexec,gid=201,umask=002,quiet  1    0
> 
> but I see that all files in corresponding filesystems are still 
> exectuable

Probably because your uid or gid match the above, so your access permission
is done by checking "user" or "group" and not "other".  Try "umask=113"
instead.

Cheers, Andreas
--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert


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

* Re: 2.4.11: mount flag noexec still broken for VFAT partition
  2001-10-10 21:13 ` Andreas Dilger
@ 2001-10-10 22:36   ` Marko Kreen
  2001-10-11  1:10     ` H. Peter Anvin
  2001-10-11  6:09     ` 2.4.11: mount flag noexec still broken for VFAT partition Andris Pavenis
  0 siblings, 2 replies; 10+ messages in thread
From: Marko Kreen @ 2001-10-10 22:36 UTC (permalink / raw)
  To: Andris Pavenis, linux-kernel

On Wed, Oct 10, 2001 at 03:13:33PM -0600, Andreas Dilger wrote:
> On Oct 10, 2001  23:01 +0300, Andris Pavenis wrote:
> > Similary as with 2.4.10 mount flag noexec does not work for VFAT
> > partition. I have following in fstab
> > 
> > /dev/hda1      /c       vfat     noexec,gid=201,umask=002,quiet  1    0
> > /dev/hda5      /d       vfat     noexec,gid=201,umask=002,quiet  1    0
> > 
> > but I see that all files in corresponding filesystems are still 
> > exectuable
> 
> Probably because your uid or gid match the above, so your access permission
> is done by checking "user" or "group" and not "other".  Try "umask=113"
> instead.

Um.  'noexec' does not touch flags, it only disallows exec'ing
on particular mountpoint.  So Andris, have you tried executing
anything on those partitions?

umask also sets directory permissions, so with umask=113 you
cant acces any dirs there...

-- 
marko


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

* Re: 2.4.11: mount flag noexec still broken for VFAT partition
  2001-10-10 22:36   ` Marko Kreen
@ 2001-10-11  1:10     ` H. Peter Anvin
  2001-10-11  2:04       ` Marko Kreen
  2001-10-11  2:07       ` [RFC] behaviour of stat() variants (was Re: 2.4.11: mount flag noexec still broken for VFAT partition) Alexander Viro
  2001-10-11  6:09     ` 2.4.11: mount flag noexec still broken for VFAT partition Andris Pavenis
  1 sibling, 2 replies; 10+ messages in thread
From: H. Peter Anvin @ 2001-10-11  1:10 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20011011003609.B18573@l-t.ee>
By author:    Marko Kreen <marko@l-t.ee>
In newsgroup: linux.dev.kernel
> 
> Um.  'noexec' does not touch flags, it only disallows exec'ing
> on particular mountpoint.
> 

It does on FAT filesystems (except UMSDOS), since they don't have real
flags.  Files and directories have syntesized attributes of
(0777 & ~umask); noexec is supposed to modify that to (0666 & ~umask)
for files but not directories.

That has been the Linux behaviour since the 0.x days.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

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

* Re: 2.4.11: mount flag noexec still broken for VFAT partition
  2001-10-11  1:10     ` H. Peter Anvin
@ 2001-10-11  2:04       ` Marko Kreen
  2001-10-11  2:07       ` [RFC] behaviour of stat() variants (was Re: 2.4.11: mount flag noexec still broken for VFAT partition) Alexander Viro
  1 sibling, 0 replies; 10+ messages in thread
From: Marko Kreen @ 2001-10-11  2:04 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

On Wed, Oct 10, 2001 at 06:10:15PM -0700, H. Peter Anvin wrote:
> Followup to:  <20011011003609.B18573@l-t.ee>
> By author:    Marko Kreen <marko@l-t.ee>
> In newsgroup: linux.dev.kernel
> > 
> > Um.  'noexec' does not touch flags, it only disallows exec'ing
> > on particular mountpoint.
> > 
> 
> It does on FAT filesystems (except UMSDOS), since they don't have real
> flags.  Files and directories have syntesized attributes of
> (0777 & ~umask); noexec is supposed to modify that to (0666 & ~umask)
> for files but not directories.
> 
> That has been the Linux behaviour since the 0.x days.

Eh.  Seems my brain has managed to filter that out thus far.
Probably as "uninteresting" is the only thing I can say :)

What is interesting is that in current vfat I can toggle
+x bit on and off with chmod.  So it seems like VFS does
not consult with fs anymore about bits.  But you know
that already.

Oh well...

-- 
marko


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

* [RFC] behaviour of stat() variants (was Re: 2.4.11: mount flag noexec still broken for VFAT partition)
  2001-10-11  1:10     ` H. Peter Anvin
  2001-10-11  2:04       ` Marko Kreen
@ 2001-10-11  2:07       ` Alexander Viro
  1 sibling, 0 replies; 10+ messages in thread
From: Alexander Viro @ 2001-10-11  2:07 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel



On 10 Oct 2001, H. Peter Anvin wrote:

> flags.  Files and directories have syntesized attributes of
> (0777 & ~umask); noexec is supposed to modify that to (0666 & ~umask)
> for files but not directories.
> 
> That has been the Linux behaviour since the 0.x days.

It looks like a horrible kludge, but it can be restored.  Actually, that
brings another issue: stat(2) and friends.

We've got a lot of stat(2) versions.  9 in fs/stat.c are only a small part
of that - there is a plenty in arch/*.  They were mostly copied from
fs/stat.c and by now bitrot gave a lot of breakage - especially in handling
large UIDs and large files.  I have a preliminary patch that cleans that
stuff up and makes very nice tricks possible for filesystems, but it needs
sorting this out - I'm not too happy about guessing the intended behaviour
for dozens of broken stat() versions.  Below is the list (from -ac - one
for Linus' tree is a subset) and I would really like to hear comments from
the maintainers.

I've put here only stat() variants - corresponding l- and f- versions should
obviously behave the same way.  I've written down the current behaviour
(there may be a couple of places where I've been wrong - it had been a
lot of digging through include/asm-*/{stat,types}.h).  What I would like
to see is _intended_ behaviour of these beasts.  Notation:  UID - 16
is "folds to 16 bit", 32 - "stores 32bit value into apparently 32bit field",
truncated - the rest (32 bits into 16 bit field or blindly truncate to
16 bit and store the result).  Size - 64 is "64 bit field", LFS - "stores
into 32bit field if withing limits, -EOVERFLOW otherwise", truncated -
"blindly truncate to 32 bits and store the result".

Some of these are _obviously_ bogus - e.g. on x86-64 _all_ variants of
stat() fold UIDs to 16 bits, on ppc64 all variants available to 64bit
binaries blindly truncate the file sizes to 32 bits, etc.

Folks, please post the intended behaviour for these functions.  Preferably
as corrections to the list below...

function	UID	size

alpha:
sys_newstat	32	64
arm:
sys_newstat	16	LFS
sys_stat64	32	64
cris, i386, m68k, ppc, sh:
sys_stat	16	LFS
sys_newstat	16	LFS
sys_stat64	32	64
sparc:
sys_newstat	16	LFS
sys_stat64	32	64
mips:
sys_stat	32	LFS
sys_newstat	32	LFS
sys_stat64	32	64
irix_xstat	32	LFS
sparc64:
sys_newstat	32	64
sys32_newstat	16	truncated
sys_stat64	32	64
solaris_stat	32	truncated
solaris_stat64	32	64
ppc64:
sys_stat	truncated truncated
sys_newstat	truncated truncated
sys32_stat	16	truncated
sys32_newstat	16	truncated
sys_stat64	32	64
mips64:
sys_stat	32	64
sys_newstat	32	64
sys32_newstat	32	truncated
ia64:
sys_newstat	32	64
sys32_newstat	truncated truncated
ia64_oldstat	16	truncated
x86_64:
sys_newstat	16	64
sys32_newstat	16	truncated
sys32_stat64	16	64
parisc:
sys_newstat	32	64/LFS
hpux_stat64	32	64/LFS
s390:
sys_newstat	16	LFS
sys_stat64	32	64
s390x:
sys_newstat	32	64
sys32_newstat	16	truncated
sys32_stat64	32	64


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

* Re: 2.4.11: mount flag noexec still broken for VFAT partition
  2001-10-10 22:36   ` Marko Kreen
  2001-10-11  1:10     ` H. Peter Anvin
@ 2001-10-11  6:09     ` Andris Pavenis
  2001-10-11  8:14       ` linux-2.4.11-dontuse Why? Sergey S. Kostyliov
  2001-10-11 19:18       ` 2.4.11: mount flag noexec still broken for VFAT partition Peter Bornemann
  1 sibling, 2 replies; 10+ messages in thread
From: Andris Pavenis @ 2001-10-11  6:09 UTC (permalink / raw)
  To: Marko Kreen; +Cc: linux-kernel




On Thu, 11 Oct 2001, Marko Kreen wrote:

> On Wed, Oct 10, 2001 at 03:13:33PM -0600, Andreas Dilger wrote:
> > On Oct 10, 2001  23:01 +0300, Andris Pavenis wrote:
> > > Similary as with 2.4.10 mount flag noexec does not work for VFAT
> > > partition. I have following in fstab
> > > 
> > > /dev/hda1      /c       vfat     noexec,gid=201,umask=002,quiet  1    0
> > > /dev/hda5      /d       vfat     noexec,gid=201,umask=002,quiet  1    0
> > > 
> > > but I see that all files in corresponding filesystems are still 
> > > exectuable
> > 
> > Probably because your uid or gid match the above, so your access permission
> > is done by checking "user" or "group" and not "other".  Try "umask=113"
> > instead.
> 
> Um.  'noexec' does not touch flags, it only disallows exec'ing
> on particular mountpoint.  So Andris, have you tried executing
> anything on those partitions?
> 
> umask also sets directory permissions, so with umask=113 you
> cant acces any dirs there...
> 

Yes I cannot really execute them (or some Linux executable if I copy it
there). I didn't verify it earlier. Anyway I better liked behaviour of 2.2
kernels and also 2.4 kernels up to rather recent time when 
'ls -l' listed files as not executable (the same with mc)

Andris



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

* linux-2.4.11-dontuse Why?
  2001-10-11  6:09     ` 2.4.11: mount flag noexec still broken for VFAT partition Andris Pavenis
@ 2001-10-11  8:14       ` Sergey S. Kostyliov
  2001-10-11 10:12         ` Morten Helgesen
  2001-10-11 19:18       ` 2.4.11: mount flag noexec still broken for VFAT partition Peter Bornemann
  1 sibling, 1 reply; 10+ messages in thread
From: Sergey S. Kostyliov @ 2001-10-11  8:14 UTC (permalink / raw)
  To: linux-kernel


http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.11-dontuse.tar.gz

What the hell is goin on?

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

* Re: linux-2.4.11-dontuse Why?
  2001-10-11  8:14       ` linux-2.4.11-dontuse Why? Sergey S. Kostyliov
@ 2001-10-11 10:12         ` Morten Helgesen
  0 siblings, 0 replies; 10+ messages in thread
From: Morten Helgesen @ 2001-10-11 10:12 UTC (permalink / raw)
  To: Sergey S. Kostyliov; +Cc: linux-kernel

Have a look at what Linus posted a couple of minutes ago.

== Morten

On Thu, Oct 11, 2001 at 12:14:40PM +0400, Sergey S. Kostyliov wrote:
> 
> http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.11-dontuse.tar.gz
> 
> What the hell is goin on?
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
mvh
Morten Helgesen 
UNIX System Administrator & C Developer 
Nextframe AS
admin@nextframe.net / 93445641
http://www.nextframe.net

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

* Re: 2.4.11: mount flag noexec still broken for VFAT partition
  2001-10-11  6:09     ` 2.4.11: mount flag noexec still broken for VFAT partition Andris Pavenis
  2001-10-11  8:14       ` linux-2.4.11-dontuse Why? Sergey S. Kostyliov
@ 2001-10-11 19:18       ` Peter Bornemann
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Bornemann @ 2001-10-11 19:18 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: linux-kernel



> Yes I cannot really execute them (or some Linux executable if I copy it
> there). I didn't verify it earlier. Anyway I better liked behaviour of 2.2
> kernels and also 2.4 kernels up to rather recent time when
> 'ls -l' listed files as not executable (the same with mc)

Somebody on this list posted a rather clean solution: there is a
"showexec"-flag for MS-filesystems, which shows only files .exe, .com or
.bat extensions as executable. This is a better thing than to play with
umask I think. Umask will give problems with wine and (maybe) dosemu.

Best wishes

Peter B


Microsoft is not the solution, it is the problem.


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

end of thread, other threads:[~2001-10-11 19:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-10 20:01 2.4.11: mount flag noexec still broken for VFAT partition Andris Pavenis
2001-10-10 21:13 ` Andreas Dilger
2001-10-10 22:36   ` Marko Kreen
2001-10-11  1:10     ` H. Peter Anvin
2001-10-11  2:04       ` Marko Kreen
2001-10-11  2:07       ` [RFC] behaviour of stat() variants (was Re: 2.4.11: mount flag noexec still broken for VFAT partition) Alexander Viro
2001-10-11  6:09     ` 2.4.11: mount flag noexec still broken for VFAT partition Andris Pavenis
2001-10-11  8:14       ` linux-2.4.11-dontuse Why? Sergey S. Kostyliov
2001-10-11 10:12         ` Morten Helgesen
2001-10-11 19:18       ` 2.4.11: mount flag noexec still broken for VFAT partition Peter Bornemann

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