Re: [HPDD-discuss] [PATCH] staging: lustre: include: lustre_update.h: Fix for possible null pointer dereference

From: Drokin, Oleg
Date: Thu Jan 29 2015 - 15:26:27 EST


Hello!

On Jan 29, 2015, at 2:49 PM, Frank Zago wrote:
>>>> @@ -165,12 +165,14 @@ static inline int update_get_reply_buf(struct
>>>> update_reply *reply, void **buf,
>>>> int result;
>>>>
>>>> ptr = update_get_buf_internal(reply, index, &size);
>>>> +
>>>> + LASSERT((ptr != NULL && size >= sizeof(int)));
>>>
>>>
>>> Now size is tested before result. So it could assert if result < 0, while
>>> the function would have returned before.
>>
>> But if prt is null krachar on the line:
>> result = *(int *)ptr;
>>
>> Maybe there should be two LASSERT then.
>
>
> Yes, that would be safer.


Actually I just noticed this function does not appear to be used in the client code at all.
As such let's just remove update_get_reply_buf()?

In fat I bet this entire lustre_update.h contains server side updating code, and is unused anywhere in the client code,
so we might just be able to easily remove that.
I see the only includer is ./lustre/ptlrpc/layout.c that I don't think actually uses anything there?

Thanks.

Bye,
Oleg--
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/