Re: buffer overflow in /proc/sys/sunrpc/transports

From: Vegard Nossum
Date: Sat Aug 30 2008 - 15:34:34 EST


On Sat, Aug 30, 2008 at 9:21 PM, Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:
> | Hm. I think this is wrong. Shouldn't we copy as many bytes as the user
> | indicated?
>
> Well, hard to say what user-space programmer is expecting from us.
> I mean - maybe he (reader) wants only part of results not the whole
> contents BUT by this way he never know what the whole conetnts would be
> until trying to read more (ie to check if there no more data from
> kernel side). What is preferred behaviour - i don't know :)

For any other file, read(1) + read(1) should be exactly equivalent to
a read(2). What's the difference here?

(Btw, thanks for the quick reply :-))


Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/