From nobody Sat May 4 14:09:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1600966985; cv=none; d=zohomail.com; s=zohoarc; b=EtYh5RZVGfk0H5U7i1ysTJvvfbtBaLJD4rXsGjVC15P7NKMPjM+jPrAasP5uG1H9p74Mh7lDa4dFmmtoG2EdyniG7cxX+izX+mFz6oJBLcED83AzbCMlOLsoKlUJsBfGolQFukiuwI/xQzhEXkDnIE+OrAv2q/qDEhrRfroef+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600966985; 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=GAY1lM7C6nPDERt1M9mWml1Yhb7IQj/m4z4WvyqPRUs=; b=GmbDc8OLtTrtcnpsfautZFkDJg2DTF9pK9WluumHPqviJzy0loWCroHHZicB6jFoCkNSqkoqd3D1TKlVMCdiuF+KFgsmUY6NRPnC9ZSQ3vaCGy1U8gTpy3Go7QlFRS0VEK8o8Eh5kqdVFDJXnOEGsZewnLyB49zEmtByX1RtqlM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600966985339715.9033830226044; Thu, 24 Sep 2020 10:03:05 -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-388-tIEJIOmuODizJnXlsvmvAw-1; Thu, 24 Sep 2020 13:03:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ECC931014DFF; Thu, 24 Sep 2020 17:02:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27B3A7515E; Thu, 24 Sep 2020 17:02:52 +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 E9B4B1826D2B; Thu, 24 Sep 2020 17:02:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08OGwTvh020653 for ; Thu, 24 Sep 2020 12:58:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADA681009B9F; Thu, 24 Sep 2020 16:58:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A72871009BAB for ; Thu, 24 Sep 2020 16:58:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 7F459101A540 for ; Thu, 24 Sep 2020 16:58:27 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-DcQQGg68Mu6VkazIx749xA-1; Thu, 24 Sep 2020 12:58:25 -0400 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2051.outbound.protection.outlook.com [104.47.10.51]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-35-Lb363YHsO566XiPP6nB2xQ-1; Thu, 24 Sep 2020 18:58:22 +0200 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) by VI1PR04MB4016.eurprd04.prod.outlook.com (2603:10a6:803:4a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.14; Thu, 24 Sep 2020 16:58:20 +0000 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::810a:9a65:c33f:2f15]) by VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::810a:9a65:c33f:2f15%7]) with mapi id 15.20.3412.021; Thu, 24 Sep 2020 16:58:20 +0000 Received: from linux-tbji.devlab.prv.suse.com (75.169.74.57) by AM4P190CA0018.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Thu, 24 Sep 2020 16:58:19 +0000 X-MC-Unique: tIEJIOmuODizJnXlsvmvAw-1 X-MC-Unique: DcQQGg68Mu6VkazIx749xA-1 X-MC-Unique: Lb363YHsO566XiPP6nB2xQ-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH FOR 6.8.0] libxl: Don't free def member of virDomainObj Date: Thu, 24 Sep 2020 10:57:59 -0600 Message-ID: <20200924165759.28239-1-jfehlig@suse.com> X-ClientProxiedBy: AM4P190CA0018.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::28) To VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.74.57] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7efb74b4-9c5f-42b8-4f53-08d860ab0a45 X-MS-TrafficTypeDiagnostic: VI1PR04MB4016: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: kItjNIipHfq+Teas7fzGFKnNYM1kdrTrlgLmRcmoVUyFKIgY/4I+pfqeZsPIw8Hp2X9jonwyEEfUGmYA7ynU8AOnf2mKz6ii33bmtUa1fDqUoHPp6XuLcueU9/MrHZo9PYF+tthZGVLv4apDXFxNzgoGuYVlKHwNrmKN9bKBaE7ALhkco0I5UXXaumZ4VXcfdushquXrUwIdxIAq5u/fB70NhTviEtYAFJbwjhgI1P5A5SyoW6gXuNjr605SJNCyWQ8mW/6ammLDJgWNvk/b9RJedKqQbJHtBPJUAIsOeZlVIbhyfXzBlUuJGiXiiHRUHqhNwnMOgbZV2IBYxFX6AknyYsESmuYsl3SpMJB0DoHwAH9pcjUZV8c4Djac7N1S X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0401MB2429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(376002)(136003)(346002)(39860400002)(366004)(66476007)(7696005)(186003)(5660300002)(2906002)(66556008)(36756003)(6666004)(107886003)(8676002)(6916009)(26005)(66946007)(478600001)(1076003)(8936002)(956004)(52116002)(4326008)(86362001)(16526019)(6486002)(316002)(2616005); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: Wp0LyblUss6JdwSXJjDIGwVUmmKm0y4tptb7X7i3/Qj6F2zV/7JrlhMsGYl55gpo90TAkkpNQGJyIEcOiUEvi2xCqtUdw0KGa61f9v9HF/fU+uHPRNN3roMPEwy5olCvCs/Ui9fFiTwDmEyDSI4Lbks2zA4v8B55Amlnf+rhShYyK/60IlTpJBIQMP03Fkr27IP6ChJD0jacUXWTHm/ol0qfCYA7ffpNtcW3Say9axwpg3ijBWTgU+hux8XztFpSy1+iz9XrcRnYBJFL5vnxXi3HPEZEoypacx3z/198bnM7XPhf5+A9Ech+wz4NO4hmZ0HSl7jCdeRc2Ak0oZDzdDVj1VS1/IJ27sxHP9bd1hBP14GfZNrveN/4K9KICm2laWaFqyMhP3b4/jFi280KEbzj+W3F0nYM5GOJv6f897i9hV4QrBBjVm2c20s6wLXYpc/4etjO7XXAX8EpKRkzv9FmLaRpByOwkvjI8OdmVAjhctkGpxGa+DfTQ1B1r3DxfPn4u1WPC4SLaSWXuT7quNTSMzSC95dvL6tuAEDgPfZuerz2HubLrRgXEzWeBfnav6Pomo/GxvH+ANOsHdkb6ed3YdpY35uCnAHGfUEW9gVorR/B+ihNcDLlmy9koNQ91aDYboouns7kIkor/iq10w== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7efb74b4-9c5f-42b8-4f53-08d860ab0a45 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0401MB2429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2020 16:58:20.5911 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: izOriCb8GoXMjhtFS2IjUlObsUeQGcipn8ZUP4Cd7zyEz97KKcub04s5FMZ/OCvGPaDYSjYvKP/dWaMNAhImiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4016 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 08OGwTvh020653 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The refactoring in commit de49d5bad3 accidentally dropped the statement setting def to NULL after successfully adding it to the virDomainObjList, causing it to be freed while still in use. The resulting memory corruption caused unpredictable behavior, often resulting in a libvirtd crash. Signed-off-by: Jim Fehlig Reviewed-by: Jiri Denemark Reviewed-by: Neal Gompa --- Unpredictable is an understatement! When running monolithic libvirtd with both qemu and xen drviers enabled, qemu crashed while initializing. Recall it is initialized after xen. Thread 17 "daemon-init" received signal SIGSEGV, Segmentation fault. #0 0x00007f32e5fbe9e3 in _int_malloc () at /lib64/libc.so.6 #1 0x00007f32e5fbf6e0 in _int_realloc () at /lib64/libc.so.6 #2 0x00007f32e5fc0729 in realloc () at /lib64/libc.so.6 #3 0x00007f32e6dc21b8 in g_realloc () at /usr/lib64/libglib-2.0.so.0 #4 0x00007f32e7532090 in virReallocN (ptrptr=3D0x7f329affcad8, size=3D1, c= ount=3D1403) at ../src/util/viralloc.c:91 #5 0x00007f32e75530c7 in virCommandProcessIO (cmd=3D0x7f328807ff40) at ../= src/util/vircommand.c:2271 #6 0x00007f32e7553a6a in virCommandRun (cmd=3D0x7f328807ff40, exitstatus= =3D0x0) at ../src/util/vircommand.c:2451 #7 0x00007f32e75dde73 in virSysinfoReadDMI () at ../src/util/virsysinfo.c:= 1237 #8 0x00007f32e75de0cb in virSysinfoRead () at ../src/util/virsysinfo.c:1294 #9 0x00007f32a240b69d in qemuStateInitialize (privileged=3Dtrue, root=3D0x0, callback=3D0x56453a0b3e97 , opaque=3D0x56453b000030) at ../src/qemu/qemu_driver.c:658 #10 0x00007f32e7832350 in virStateInitialize (privileged=3Dtrue, mandatory=3Dfalse, root=3D0x0, callback=3D0x56453a0= b3e97 , opaque=3D0x56453b000030) at ../src/libvirt.c= :656 #11 0x000056453a0b4175 in daemonRunStateInit (opaque=3D0x56453b000030) at ../src/remote/remote_daemon.c:596 src/libxl/libxl_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 083738871d..571b70f982 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -627,6 +627,7 @@ libxlAddDom0(libxlDriverPrivatePtr driver) NULL))) goto cleanup; =20 + def =3D NULL; vm->persistent =3D 1; virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BO= OTED); } --=20 2.28.0