Re: 2.6.6-rc3: modular DVB tda1004x broken

Jörn Engel
2004-05-03T22:43:27Z

On Mon, 3 May 2004 22:54:34 +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
>
> Let's see... Leaving aside obvious userland code (arch/*/boot/*, scripts/*,
> drivers/char/ip2/ helpers) and arch/um/* instances that are, AFAICS, in
> userland code too and refer to libc open(2), we have
> a) drivers/media/dvb/frontends pile (AFAICS, loading firmware)
> b) systemcfg_init() in asm-ppc64/systemcfg.h (WTF is that about?)
> c) sound/isa/wavefront/wavefront_synth.c (loading firmware)
> d) sound/oss/wavfront.c (loading firmware)
> e) odd calls of sys_close() in binfmt_elf.c, eventpoll.c and socket.c
> f) potentially racy flush_unauthorized_files() in selinux code - uses
> sys_close() in a strange way.
>
> That's it. And I suspect that we ought to switch the firmware loaders to
> use of existing helper.

That cannot be all. What about these two? Not sure if my patch is
correct or it should rather s/O_RDONLY/FMODE_READ/.

Jörn

--
It does not matter how slowly you go, so long as you do not stop.
-- Confucius

exec.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

--- linux-2.6.5cow/fs/exec.c~exec_thinko 2004-03-28 21:51:52.000000000 +0200
+++ linux-2.6.5cow/fs/exec.c 2004-05-02 11:47:46.000000000 +0200
@@ -135,7 +135,8 @@
if (error)
goto exit;

- file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
+ /* dentry_open used FMODE_(READ|WRITE) instead of the O_* flags. */
+ file = dentry_open(nd.dentry, nd.mnt, 0);
error = PTR_ERR(file);
if (IS_ERR(file))
goto out;
@@ -489,7 +490,8 @@
err = -EACCES;
file = ERR_PTR(err);
if (!err) {
- file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
+ /* dentry_open used FMODE_(READ|WRITE) instead of the O_* flags. */
+ file = dentry_open(nd.dentry, nd.mnt, 0);
if (!IS_ERR(file)) {
err = deny_write_access(file);
if (err) {