[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 2/2] Do not send random bytes in message



On Wed, Mar 02, 2011 at 07:09:08PM +0100, Zdenek Kabelac wrote:
> struct clvm_header contains 'char args[1]' - so adding '+ 1' here
> for the message length calculation is not correct - we end up with longer
> message where last byte is uninitialized and passed to write function.
 
That size calcluation is unclear to me: I doubt that args[1] was the reason for
the +1.  As long as you have confirmed there are no types/combinations of
messages or architectures that need it, ack.

> xid and clintid are initialized to 0.
> 
> Memory allocation is checked for NULL - though it's not really clear what
> should happen in this case - so just log the message - probably it will 
> fail few moments later...
 
I think it's important here that malloc cannot fail:)
(Does it inherit the right lock-into-memory settings from its lvm linking or
is something missing?)

Ack.

Alasdair


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]