dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: lixiaokeng <lixiaokeng@huawei.com>
To: Martin Wilck <mwilck@suse.com>, Benjamin Marzinski <bmarzins@redhat.com>
Cc: linfeilong <linfeilong@huawei.com>,
	dm-devel mailing list <dm-devel@redhat.com>,
	"liuzhiqiang (I)" <liuzhiqiang26@huawei.com>
Subject: Re: [PATCH 0/6] libmultipath: check udev* func return value
Date: Fri, 18 Sep 2020 16:39:45 +0800	[thread overview]
Message-ID: <3735c20d-a0fd-ca41-be9a-0df679022668@huawei.com> (raw)
In-Reply-To: <011310221c816f3c3573d96d91aca3e0a48fb80d.camel@suse.com>

Hi Martin,

On 2020/9/18 15:37, Martin Wilck wrote:
> On Thu, 2020-09-17 at 21:26 -0500, Benjamin Marzinski wrote:
>> On Tue, Sep 15, 2020 at 12:38:27PM +0800, lixiaokeng wrote:
>>> Hi,
>>>   The udev* function may return NULL,and it will be
>>> dereferenced in str* and sscanf func. For example,
>>> there is a coredump caused in add func, which show in
>>> be7a043(commit id) in upstream-queue. We check the
>>> return value to avoid dereference NULL.
>>>
>>> repo: openSUSE/multipath-tools
>>> repo link: https://github.com/openSUSE/multipath-tools
>>> branch: upstream-queue
>>>
>> For the set
>> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> 
> Well, the set got the logic wrong in 3 out of 6 patches :-)
> 
> In general, as these fixes are all very similar, I would prefer
> bundling them together into one patch, and I would like to make sure
> (and assert in the commit message) that the set fixes
> *all* possible NULL pointer dereferences related to accessing udev
> properties (I haven't checked whether this is the case for the set).
> 
> Also, while I'd ack this set if the logic was correct, I think that in
> a way it's papering over the actual problem. udev_device_get_XYZ()
> functions fail *only* if the underlying sysfs directory has vanished
> (well, perhaps for out-of-memory, too, but let's put that aside for a
> moment). It that case, we should actually not just return an error code

   Here we use multipath-tools basing on iscsi. When iscsi logout, the path
will disappear in sysfs and a uevent will cause. Before uevent processed,
some coredump will happen but if coredump is solved the multipathd will
deal with the disappeared path latter.
  In this set, the funcs will not be processed when multipath-tools bases
on iscsi. However, I think multipathd will deal with the disappeared path
like basing on iscsi. So I just check them. Anyway, if you have any better
idea, please tell me.

> - we should realize that there's a problem with the device (it probably
> has been deleted from the system and shouldn't be used any more in any
> way), and that we need to deal with it somehow. This is a fundamental
> problem for all user space programs that use udev_devices for more than
> a few CPU cycles. That doesn't mean the set is wrong, but we should
> keep this in mind. I have something cooking for a more complete
> solution, which isn't ready yet.
> 
> Finally, @lixiaokeng, please check your inbox once more. You still
> haven't fixed #11/14 of your previous series.
> 

I will modify patch 11/14 and send it.

> Regards,
> Martin
> 
> 
> .
> 

  reply	other threads:[~2020-09-18  8:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  4:38 [PATCH 0/6] libmultipath: check udev* func return value lixiaokeng
2020-09-15  4:39 ` [PATCH 1/6] libmultipath: check uedv* return value in sysfs_get_host_pci_name lixiaokeng
2020-09-18  7:34   ` Martin Wilck
2020-09-15  4:39 ` [PATCH 2/6] libmultipath: check udev* return value in ccw_sysfs_pathinfo lixiaokeng
2020-09-18  7:01   ` Martin Wilck
2020-09-15  4:40 ` [PATCH 3/6] libmultipath: check udev* return value in sysfs_get_tgt_nodename lixiaokeng
2020-09-15  4:41 ` [PATCH 4/6] libmultipath: check udev* return value in trigger_partitions_udev_change lixiaokeng
2020-09-15  4:41 ` [PATCH 5/6] libmultipath: check udev* renturn value in get_ctrl_blkdev lixiaokeng
2020-09-18  6:59   ` Martin Wilck
2020-09-15  4:42 ` [PATCH 6/6] libmultipath: check udev* return value in _find_path_by_syspath lixiaokeng
2020-09-18  6:58   ` Martin Wilck
2020-09-18  2:26 ` [PATCH 0/6] libmultipath: check udev* func return value Benjamin Marzinski
2020-09-18  7:37   ` Martin Wilck
2020-09-18  8:39     ` lixiaokeng [this message]
2020-09-18 11:15       ` Martin Wilck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3735c20d-a0fd-ca41-be9a-0df679022668@huawei.com \
    --to=lixiaokeng@huawei.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linfeilong@huawei.com \
    --cc=liuzhiqiang26@huawei.com \
    --cc=mwilck@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).