lkml.org 
[lkml]   [2000]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From


On Wed, 6 Sep 2000, Alexander Viro wrote:

>
>
> On 6 Sep 2000, Linus Torvalds wrote:
>
> > However, what I think Al Viro dislikes about this is that it does tend
> > to leave code that won't compile, just because some of the accesses are
> > in places that the compiler doesn't see due to the pre-processor (or due
> > to other build-rules: like in architectures that aren't the one that the
> > developer uses).
>
> Add "and that broken code gets fixed in utterly bogus ways 20 versions
> down the road, when nobody remembers WTF had happened". Repeat several
> times (and rarely-used parts _will_ accumulate such crap) and you've got
> Lovecraftian beasts lurking in the tree. To some extent it's inevitable,
> but frequency of such events matters...

... or they get #if 0'd, as in the case below:
diff -urN rc8-5/arch/mips64/kernel/linux32.c rc8-5-mips/arch/mips64/kernel/linux32.c
--- rc8-5/arch/mips64/kernel/linux32.c Thu Jul 27 21:36:54 2000
+++ rc8-5-mips/arch/mips64/kernel/linux32.c Wed Sep 6 13:59:36 2000
@@ -275,30 +275,33 @@
int do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
{
struct linux_binprm bprm;
- struct dentry * dentry;
+ struct file *file;
int retval;
int i;

- bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
- memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
+ file = open_exec(filename);

- dentry = open_namei(filename, 0, 0);
- retval = PTR_ERR(dentry);
- if (IS_ERR(dentry))
+ retval = PTR_ERR(file);
+ if (IS_ERR(file))
return retval;

- bprm.dentry = dentry;
+ bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
+ memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
+
+ bprm.file = file;
bprm.filename = filename;
bprm.sh_bang = 0;
bprm.loader = 0;
bprm.exec = 0;
if ((bprm.argc = count32(argv, bprm.p / sizeof(u32))) < 0) {
- dput(dentry);
+ allow_write_access(file);
+ fput(file);
return bprm.argc;
}

if ((bprm.envc = count32(envp, bprm.p / sizeof(u32))) < 0) {
- dput(dentry);
+ allow_write_access(file);
+ fput(file);
return bprm.envc;
}

@@ -326,8 +329,9 @@

out:
/* Something went wrong, return the inode and free the argument pages*/
- if (bprm.dentry)
- dput(bprm.dentry);
+ allow_write_access(bprm.file);
+ if (bprm.file)
+ fput(bprm.file);

/* Assumes that free_page() can take a NULL argument. */
/* I hope this is ok for all architectures */
I suspect that after that patch #if 0 around the whole mess may go to
hell. Ralf?

Notice that in this case code simply was not available in the tree when
changes were done. Right now I've just repeated the grep done back in May
and it brought the instances above. Folks, it didn't compile for 4
months...

-
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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:2.142 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site