Re: [PATCH 3/5] blktrace: fix off-by-one bug

From: Li Zefan
Date: Tue Mar 24 2009 - 04:41:22 EST


Li Zefan wrote:
>>> - if (unlikely(what == 0 || what > ARRAY_SIZE(what2act)))
>>> + if (unlikely(what == 0 || what >= ARRAY_SIZE(what2act)))
>> ah, nice. How did you notice - did we miss "remap" events due to
>> this bug?
>>

forgot to mention, we didn't miss any "remap" events.

>
> By code review, but we can get NULL dereference bug if we receive an
> "abort" event, this event may be generated only when using device-mapper.
>

and not NULL dereference, but accessing invalid memory.

what2act["abort"]->print(...)

and "abort" == ARRAY_SIZE(what2act).

> We don't print out this event currently, neither does the userspace
> blktrace, which should be fixed.
>


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