[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] libxl: Don't segfault on soft-reset failure


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Fri, 1 Apr 2022 15:42:43 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 01 Apr 2022 14:47:06 +0000
  • Ironport-data: A9a23:l7e7v6nEbHMJtUBEGi4xVuro5gyWJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJOCmGAa6nZZGv8f9p2PI2+pkgF6JPVn94xHQRk+X8zRCMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EoLd9IR2NYy24DlW1rV4 7senuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYVjtxBJGVpPUhfSJbKCBnL5FA4+7lPi3q2SCT5xWun3rExvxvCAc9PJEC+/YxCmZLn RAaAGlTNFbZ3bvwme/lDLk37iggBJCD0Ic3s3d8zTbfHLA+TIrKWani7t5ExjYgwMtJGJ4yY uJGMWMxMU+QPHWjPH8sMZxhwvnwuUX/WBtzsAO6+oM040HMmVkZPL/Fb4OOJ43iqd9utlmcj nLL+SL+GB5yHN6Q0z2e6Vq3m/TC2yj8Xeo6FrS++uR7nV67yWkaCRlQXly+ydGph0j7V99BJ kg8/is1sbN05EGtVsP6XRCzvDiDpBF0ZjZLO7RkskfXkPOSulvHQDhfJtJcVDA4nNAKHQYWj 2OYo/3SBgduqa+pT2nM1KjB+FteJhMpBWMFYCYFSy4M7N/ivJw/g3rzczpzLEKmpoarQG+tm lhmuAB73uxO1pBTi81X6Hid21qRSo71ohnZD+k9dkas9UtHaYGsfOREAnCLvK8bfO51orRs1 UXoevRyDshTVflhdwTXGY3h+Y1FAd7fb1UwZnY1Q/EcG8yFoSLLQGypyGgWyL1VGsgFYyT1R 0TYpBlc4pReVFPzM/MnPN/rUZx7nPW9fTgAahwyRoARCnSWXFXalByCmGbKhzy9+KTSuf9X1 WinnTaEUi9BVPUPIMueTOYBy747rh3SNkuILa0XOy+PiOLEDFbMEO9tGALXMogRsfPVyC2Io o03H5bblH1ivBjWP3C/HXg7dgtRcxDWxPne9qRqSwJ0ClE4QDt4Ua+AnOtJlk4Mt/09q9okN 0qVAidwoGcTT1WaQelWQhiPsI/SYKs=
  • Ironport-hdrordr: A9a23:yRiGuazG+PbV3w8zBQ6tKrPwIL1zdoMgy1knxilNoHtuA66lfq GV7ZcmPHDP6Qr5NEtOpTniAsW9qBHnhPtICOAqVN/INmTbUQOTXeVfBODZowEIdReRygYDvp 0QFJSWoueAa2RHsQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Apr 01, 2022 at 10:32:56AM -0400, Jason Andryuk wrote:
> If domain_soft_reset_cb can't rename the save file, it doesn't call
> initiate_domain_create() and calls domcreate_complete().
> 
> Skipping initiate_domain_create() means dcs->console_wait is
> uninitialized and all 0s.
> 
> We have:
>   domcreate_complete()
>     libxl__xswait_stop()
>       libxl__ev_xswatch_deregister().
> 
> The uninitialized slotnum 0 is considered valid (-1 is the invalid
> sentinel), so the NULL pointer path to passed to xs_unwatch() which
> segfaults.
> 
> libxl__ev_xswatch_deregister:watch w=0x12bc250 wpath=(null) token=0/0: 
> deregister slotnum=0
> 
> Move dcs->console_xswait initialization into the callers of
> initiate_domain_create, do_domain_create() and do_domain_soft_reset(),
> so it is initialized along with the other dcs state.
> 
> Fixes: c57e6ebd8c3e ("(lib)xl: soft reset support")
> Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>

Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.