On 2023/9/19 6:39, Alex Williamson wrote: > On Sat, 9 Sep 2023 15:09:49 +0800 > Jinjie Ruan <ruanjinjie@xxxxxxxxxx> wrote: > >> There is a null-ptr-deref bug in strchr() of device_add(), if the kstrdup() >> fails in kobject_set_name_vargs() in dev_set_name(). This patchset fix >> the issues. >> >> Jinjie Ruan (3): >> vfio/mdpy: Fix the null-ptr-deref bug in mdpy_dev_init() >> vfio/mtty: Fix the null-ptr-deref bug in mtty_dev_init() >> vfio/mbochs: Fix the null-ptr-deref bug in mbochs_dev_init() >> >> samples/vfio-mdev/mbochs.c | 4 +++- >> samples/vfio-mdev/mdpy.c | 4 +++- >> samples/vfio-mdev/mtty.c | 4 +++- >> 3 files changed, 9 insertions(+), 3 deletions(-) >> > > These all target the wrong goto label, aiui we can't call put_device() > if we haven't called device_initialize(), so I think there needs to be > an intermediate label added before class_destroy(). Thanks, Thank you! Since commit fd6f7ad2fd4d ("driver core: return an error when dev_set_name() hasn't happened"), the above issues has been fixed. > > Alex >