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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Cyrill Gorcunov <gorcunov@...>
Cc: Tom Tucker <tom@...>, Neil Brown <neilb@...>, Chuck Lever <chuck.lever@...>, Greg Banks <gnb@...>, J. Bruce Fields <bfields@...>, <linux-kernel@...>
Date: Saturday, August 30, 2008 - 3:42 pm

On Sat, Aug 30, 2008 at 9:06 PM, Cyrill Gorcunov <gorcunov@gmail.com> wrote:

BTW, look at this:

    $ od -A x -t x1z /proc/sys/sunrpc/transports
    000000 74 63 70 20 31 30 34 38 35 37 36 0a 75 64 70 20  >tcp 1048576.udp <
    000010 33 32 37 36 38 0a 00 00 00 00 00 00 00 00 00 00  >32768...........<
    000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
    *
    0003e0 00 00 00 00 00 00 00 00 00 00                    >..........<
    0003ea

...and:

    $ strace -e trace=read cat /proc/sys/sunrpc/transports > /dev/null
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@G\316E4\0\0\0"...,
512) = 512
    read(3, "tcp 1048576\nudp 32768\n\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4074
    read(3, "", 4096)                       = 0

...why does it have a huge return value? The output is only about 40
bytes... why add all the \0? Would your patch also fix this?


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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
buffer overflow in /proc/sys/sunrpc/transports, Vegard Nossum, (Sat Aug 30, 2:44 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 3:06 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Vegard Nossum, (Sat Aug 30, 3:42 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 3:56 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Vegard Nossum, (Sat Aug 30, 3:59 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 4:04 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Vegard Nossum, (Sat Aug 30, 4:13 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 4:29 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 4:15 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 3:45 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Vegard Nossum, (Sat Aug 30, 3:15 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 3:21 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Vegard Nossum, (Sat Aug 30, 3:34 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 3:44 pm)
Re: buffer overflow in /proc/sys/sunrpc/transports, Cyrill Gorcunov, (Sat Aug 30, 3:23 pm)