Re: BUG/PATCH: include/asm-*/fcntl.h

From: kisch@gmx.li
Date: Sat Aug 26 2000 - 07:05:13 EST


Alber D. Cahalan writes:

> Bernd Kischnick writes:
>
> > An hour ago I posted a patch for asm-ppc/fcntl.h.
> > Now I scanned the other asm-directories and found the same bug in
> ..
> > +struct flock64 {
> > + short l_type;
> > + short l_whence;
> > + loff_t l_start;
> > + loff_t l_len;
> > + pid_t l_pid;
>
> Noooo!!!!!
>
> Your struct likely looks like this on some systems:
>
> 2 bytes l_type
> 2 bytes l_whence
> 4 bytes COMPILER GENERATED CRAP <-- Eeew, gross.
> 8 bytes l_start
> 8 bytes l_len
> 4 bytes l_pid
>
> You didn't follow the rules. (Remember that flamewar?)

Well, sorry :-(

> You waste space and, maybe, leak secret data out of the kernel.
> (if you copy the whole thing, with uninitialized data...)

I didn't invent the definition for struct flock64.
The definition is in the test7-patch, and it's identical in
include/asm-i386/fcntl.h and in include/asm-sparc/fcntl.h
That's why I assumed that this definition might be used for the other
architectures as well (where it was missing in the test7-patch).

If there are problems with the struct, maybe we should consider changing
it for all architectures?

- Bernd

-- 
- Bernd Kischnick

email kisch@mindless.com tel +49-(0)511-18375

Sent through GMX FreeMail - http://www.gmx.net

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



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:17 EST