From nobody Wed May 15 22:54:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585951479; cv=none; d=zohomail.com; s=zohoarc; b=hZz6M7pLs90Ny/VqWAmQFWLdNPl1lfAADOIRiNpX4+IYrnT1/MQJpvReEwkOsKK+8YwE8CO40/B8Sh29IDAPaGqYa372qieI+56xDmqxwtzy0VB49rK2xDBRjDhKTMWYbbr6Oy+ohpX1PwM574AFTgGtFzg6U0k38b/M0gKdtMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585951479; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=YzIemvXBH8iuzLOjXK13AbKM3d+gYDVvseI+f+MbuPM=; b=e67FaJJQ4wruaSXv00ypkPaW0NIUil/g4+x/iRspxqPF4+eGl1E7PcX1Qr1DCDcFOlWI/H2xfQlCBPgCp9OOdG+2UFjP9LJcTEy9ZD71RFqb1s1PahRfTCVsnLicQq8nQz7a9IPrHV5SUl1GDntyYrzyxxKjGbg4lM0d6WX6v9A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1585951479478410.8268761049775; Fri, 3 Apr 2020 15:04:39 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-BybV8kLZM_CCfH1qbjK7UA-1; Fri, 03 Apr 2020 18:04:35 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD86B8017CE; Fri, 3 Apr 2020 22:04:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE0765C28F; Fri, 3 Apr 2020 22:04:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E501E4E455; Fri, 3 Apr 2020 22:04:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 033M4KKC021362 for ; Fri, 3 Apr 2020 18:04:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1EE4113D6F4; Fri, 3 Apr 2020 22:04:20 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A44B13BBA4 for ; Fri, 3 Apr 2020 22:04:17 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8718B8FF66C for ; Fri, 3 Apr 2020 22:04:17 +0000 (UTC) Received: from m4a0073g.houston.softwaregrp.com (m4a0073g.houston.softwaregrp.com [15.124.2.131]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-KMrXo9ZUNnKIeqtFR9LpAw-1; Fri, 03 Apr 2020 18:04:08 -0400 Received: FROM m4a0073g.houston.softwaregrp.com (15.120.17.146) BY m4a0073g.houston.softwaregrp.com WITH ESMTP FOR libvir-list@redhat.com; Fri, 3 Apr 2020 22:02:01 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 3 Apr 2020 22:02:14 +0000 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (15.124.72.12) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Fri, 3 Apr 2020 22:02:14 +0000 Received: from BY5PR18MB3315.namprd18.prod.outlook.com (2603:10b6:a03:196::12) by BY5PR18MB3282.namprd18.prod.outlook.com (2603:10b6:a03:1ac::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Fri, 3 Apr 2020 22:02:14 +0000 Received: from BY5PR18MB3315.namprd18.prod.outlook.com ([fe80::6157:7c41:b13d:23f5]) by BY5PR18MB3315.namprd18.prod.outlook.com ([fe80::6157:7c41:b13d:23f5%3]) with mapi id 15.20.2878.016; Fri, 3 Apr 2020 22:02:13 +0000 Received: from linux-tbji.provo.novell.com (75.169.23.17) by SN4PR0501CA0123.namprd05.prod.outlook.com (2603:10b6:803:42::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.11 via Frontend Transport; Fri, 3 Apr 2020 22:02:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585951478; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YzIemvXBH8iuzLOjXK13AbKM3d+gYDVvseI+f+MbuPM=; b=MJmKjLooq/8mhCU2KIYw/euo4bOHaFmQ2bbZJs1UFigYLhqq64JhxR5piLmNoCe5hWzAj5 ZZ/Wuyznrgt225e1QzmsSlTbmNQtOC9XeqiFCOQRMFaLHFrzartmqJVrsQIhnmCi80QjOP /2d6FZURIR7ufB37r3yFe4g3GD3cNEA= X-MC-Unique: BybV8kLZM_CCfH1qbjK7UA-1 X-MC-Unique: KMrXo9ZUNnKIeqtFR9LpAw-1 From: Jim Fehlig To: Subject: [PATCH] libxl: fix crash when initializing driver Date: Fri, 3 Apr 2020 16:01:53 -0600 Message-ID: <20200403220153.22064-1-jfehlig@suse.com> X-ClientProxiedBy: SN4PR0501CA0123.namprd05.prod.outlook.com (2603:10b6:803:42::40) To BY5PR18MB3315.namprd18.prod.outlook.com (2603:10b6:a03:196::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.23.17] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f8ebb7e-3c96-4f9d-2683-08d7d81aaa64 X-MS-TrafficTypeDiagnostic: BY5PR18MB3282: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 0362BF9FDB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR18MB3315.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(4636009)(376002)(346002)(136003)(39860400002)(366004)(396003)(66946007)(1076003)(956004)(186003)(52116002)(6506007)(66476007)(8936002)(16526019)(8676002)(81166006)(2616005)(81156014)(66556008)(6666004)(316002)(4326008)(2906002)(5660300002)(478600001)(6486002)(36756003)(6512007)(26005)(6916009)(86362001)(107886003); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HyWYCf/QNMXrIrhtwA7Q2dihAZ+GxgV3dGBrt5/ud6q129rwliw2KK6nDId8fNwXhrQG3O9voA0gmF1jrVOWtZDKCMhh9y1/MX1jKLMNEVh6I1ZubYcLL08uBMGXoFIR+hCYqVYnYbwvqGpvV72iBEeqWOxp2DT7stHITKdu7UvnJRP2CdBztFogiUOXjPUzGfL00LrkpM5cCfKibpYyBxG6Vhjge2ANAjWIgU8nPoLKr1MF9FxkplVmlf0ljLjhe9MY0A9s9U4i1VlynupIkZC8YUtHjmFscFnE21qJa5humZml5tuSDkLTWF/r/qWdiPlo0IQK9YOptbdtEF2UQMn3QCHXtTcvJJ6gpJjZ+vkbhauKv9btPQhmkMel4BoF4+3gTAWBXDN3HQq2uQBhjKn83e+nzHfS/y/JbfSooxWBFV1Szaw/gzcZjYjKyIq+ X-MS-Exchange-AntiSpam-MessageData: cvPwkIxzv83+8DJq3omat33hsFHdU9U/orYaVMW+nuMwPfhNCByaW3MX00BC+ziZ+uY1D3SLKxhRPnYGkUyDszwdDxE+NwIBdjFBfeOvpYdge8Fj+vNq6KpGubd+0bWENHs6bEhHuXZ2t5TL16RRvg== X-MS-Exchange-CrossTenant-Network-Message-Id: 7f8ebb7e-3c96-4f9d-2683-08d7d81aaa64 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2020 22:02:13.7932 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gh29l2M1ycail3ZcFqlTHzr+asBRMaDqX0KoDoQoznDjugTmcHHWIPAk1EaciUp79xJS4Qv+qe3Bk2QSw3GJcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR18MB3282 X-OriginatorOrg: suse.com X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 033M4KKC021362 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit 54a401af478 split out DriverConfigInit from DriverConfigNew, but then called it a bit late from libxlStateInitialize. The cfg is used in libxlDriverConfigLoadFile and when uninitialized results in a crash. Calling DriverConfigInit immediately after DriverConfigNew fixes the crash. Signed-off-by: Jim Fehlig Reviewed-by: Erik Skultety Reviewed-by: J=C3=A1n Tomko --- src/libxl/libxl_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 7ec4fcc3d1..980984b199 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -702,14 +702,14 @@ libxlStateInitialize(bool privileged, if (!(cfg =3D libxlDriverConfigNew())) goto error; =20 + if (libxlDriverConfigInit(cfg) < 0) + goto error; + driverConf =3D g_strdup_printf("%s/libxl.conf", cfg->configBaseDir); =20 if (libxlDriverConfigLoadFile(cfg, driverConf) < 0) goto error; =20 - if (libxlDriverConfigInit(cfg) < 0) - goto error; - /* Register the callbacks providing access to libvirt's event loop */ libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->= ctx); =20 --=20 2.26.0