[dm-devel] [PATCH v2] libmultipath: check udev_device_get_* return value to avoid segfault

lixiaokeng lixiaokeng at huawei.com
Mon Sep 21 09:52:17 UTC 2020


Hi Martin,
   Thanks for your careful review. In path_discover() and declare_sysfs_get_str(),
NULL will not be dereferenced. I just check all return value that will cause
segfault. But you are right, the other invocations of udev_device_get_XYZ()
should be checked too.

Regards,
Lixiaokeng



On 2020/9/21 17:14, Martin Wilck wrote:
> On Mon, 2020-09-21 at 12:00 +0800, lixiaokeng wrote:
>> The udev_device_get_* function may return NULL, and it will be
>> deregerenced in str* and sscanf func. We check the return value
>> to avoid segfault. Fix all.
>>
> 
> Thanks. Let me remark that this patch does _not_ fix all invocations of
> udev_device_get_XYZ() (I suppose you meant something else with "Fix
> all.", but please be more specific next time then).
> See path_discover(), declare_sysfs_get_str(), for instance.
> 
> Anyway, that can be fixed later, so:
> 
> Reviewed-by: Martin Wilck <mwilck at suse.com>
> 
> 
> .
> 




More information about the dm-devel mailing list