lkml.org 
[lkml]   [2015]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [HPDD-discuss] [PATCH] staging: lustre: include: lustre_update.h: Fix for possible null pointer dereference
Date
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

\
 
 \ /
  Last update: 2015-01-29 21:41    [W:0.030 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site