lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0906231019250.3240@localhost.localdomain>
Date:	Tue, 23 Jun 2009 10:34:49 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	David Howells <dhowells@...hat.com>
cc:	Miklos Szeredi <miklos@...redi.hu>, alan@...rguk.ukuu.org.uk,
	hch@...radead.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, viro@...IV.linux.org.uk,
	adilger@....com, akpm@...ux-foundation.org
Subject: Re: [RFC] O_NOACC: open without any access



On Tue, 23 Jun 2009, David Howells wrote:

> Miklos Szeredi <miklos@...redi.hu> wrote:
> 
> > Define O_NOACC as 3.  On open(..., O_FILESYSTEM | O_NOACC) require no
> > privileges on the file.
> 
> It must also work with O_NOFOLLOW, which I think your suggestion will.

This does sound like a fairly natural extension of what we already do.

We essentially already have O_NOACCESS (3), and use it exactly because we 
need to do operations on a file descriptor without "real" accesses 
(notably things like accessing /dev/cdrom without waiting/checking for the 
disk being present etc).

O_FILESYSTEM I don't like as a name (to me, it doesn't say _what_ it is 
doing - of course an open works on a filesystem!), but the concept of 
saying "don't follow device nodes - just open the node itself" makes 
perfect sense. Together with O_NOFOLLOW it also fairly naturally means 
"give me the actual symlink _node_, don't return error or follow it".

And we can trivially test at a higher level that O_FILESYSTEM (with a 
better name, please), is always paired with O_NOACCESS (not O_NOACC: we do 
not try to save three letters, there is no shortage). Because the raw node 
obviously must never really be "accessed" (ie you can't do read/write etc 
on it).

That said, I do _not_ like the notion of

	> Add a new inode->i_filesystem_fop pointer

regardless of whether it's in inode->i_op or wherever. I think we should 
just handle this in the regular "inode->f_op->open" routine, the same way 
we handle FMODE_EXCLUSIVE (O_EXCL), FMODE_NDELAY (O_NONBLOCK) and lack of 
access rights (O_NOACCESS) in the driver open routines that currently 
handle those specially (O_NDELAY is spe

Al?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ