event tracing, ringbuffer and RB_MAX_SMALL_DATA

From: Johannes Berg
Date: Tue Jul 14 2009 - 13:18:50 EST


Hi,

By code inspection, I think there's a bug if your event contains only

__dynamic_array(u8, buf, buflen)

and your buflen is only, say, 3. Then the event size will be the common
event size (12 bytes) plus this, so 15, which is well below
RB_MAX_SMALL_DATA (4*28 = 112), so it'll be divided by four to be stored
into type_len. At this point, however, you've lost the information that
your dynamic array was only three bytes, and it'll be considered _four_
bytes long by parsers as far as I can tell?

johannes

Attachment: signature.asc
Description: This is a digitally signed message part