From patchwork Fri Mar 14 18:33:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chaney, Ben" X-Patchwork-Id: 14017340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D066C35FF1 for ; Fri, 14 Mar 2025 18:34:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tt9rb-0000rb-Px; Fri, 14 Mar 2025 14:34:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tt9rD-0000a5-TG for qemu-devel@nongnu.org; Fri, 14 Mar 2025 14:34:12 -0400 Received: from mx0b-00190b01.pphosted.com ([67.231.157.127]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tt9rA-0007oE-Ne for qemu-devel@nongnu.org; Fri, 14 Mar 2025 14:34:07 -0400 Received: from pps.filterd (m0409411.ppops.net [127.0.0.1]) by m0409411.ppops.net-00190b01. (8.18.1.2/8.18.1.2) with ESMTP id 52EFbLB7015681; Fri, 14 Mar 2025 18:34:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=cc :content-id:content-transfer-encoding:content-type:date:from :message-id:mime-version:subject:to; s=jan2016.eng; bh=ivkNAhxJZ JIRra6MMclNVIVnQ0Z84qDMdeMWVajBgGs=; b=JfqzM5VhdpJQnf4W98El4oAhW 6yejVbiePDoHHfQljvTDE6YNsT3sZbdR55dgx/cMY2MuxYrFQP0tMQk5cdDLHX1d xAYiqHHElqYPYIzJ3TSj4wfiww8jCuWZ7qbE5lU6WDYc5gVY9anEuz/iUPeQJjat yo3f8ZI5dZFZSHWsOW8oqlEqECXcoBH1wLrOy/edQs1cMlndZR1S/FrJ+nNb2pGo GK6aoAfioZxHj3uqjBU4n2pFGNosRNeD68YejKYDkRCP5agHlhPYys15Lq0fTuhg 2+cQFZiqiI1vv4G3ZGuDbgDLKOdTo34rRKvZWMOfl1+Hj5x1mRd4qllNzQQ8w== Received: from prod-mail-ppoint1 (prod-mail-ppoint1.akamai.com [184.51.33.18] (may be forged)) by m0409411.ppops.net-00190b01. (PPS) with ESMTPS id 45au4tbvf6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Mar 2025 18:34:00 +0000 (GMT) Received: from pps.filterd (prod-mail-ppoint1.akamai.com [127.0.0.1]) by prod-mail-ppoint1.akamai.com (8.18.1.2/8.18.1.2) with ESMTP id 52EG5skb021827; Fri, 14 Mar 2025 14:33:59 -0400 Received: from email.msg.corp.akamai.com ([172.27.50.206]) by prod-mail-ppoint1.akamai.com (PPS) with ESMTPS id 45au4e2shb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Mar 2025 14:33:58 -0400 Received: from ustx2ex-exedge3.msg.corp.akamai.com (172.27.50.214) by ustx2ex-dag4mb7.msg.corp.akamai.com (172.27.50.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Fri, 14 Mar 2025 11:33:57 -0700 Received: from ustx2ex-exedge3.msg.corp.akamai.com (172.27.50.214) by ustx2ex-exedge3.msg.corp.akamai.com (172.27.50.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Fri, 14 Mar 2025 13:33:57 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (72.247.45.132) by ustx2ex-exedge3.msg.corp.akamai.com (172.27.50.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Fri, 14 Mar 2025 13:33:57 -0500 Received: from BN8PR17MB2755.namprd17.prod.outlook.com (2603:10b6:408:53::19) by DS0PR17MB6984.namprd17.prod.outlook.com (2603:10b6:8:165::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.28; Fri, 14 Mar 2025 18:33:55 +0000 Received: from BN8PR17MB2755.namprd17.prod.outlook.com ([fe80::7ac4:a8e9:d7c9:6016]) by BN8PR17MB2755.namprd17.prod.outlook.com ([fe80::7ac4:a8e9:d7c9:6016%4]) with mapi id 15.20.8534.027; Fri, 14 Mar 2025 18:33:55 +0000 From: "Chaney, Ben" To: Steven Sistare , "qemu-devel@nongnu.org" CC: "peterx@redhat.com" , Fabiano Rosas , "armbru@redhat.com" , "Glasgall, Anna" , "Hunt, Joshua" , "Tottenham, Max" Subject: [BUG][RFC] CPR transfer Issues: Socket permissions and PID files Thread-Topic: [BUG][RFC] CPR transfer Issues: Socket permissions and PID files Thread-Index: AQHblQ+koYDHHa36dECBReju+gYnxg== Date: Fri, 14 Mar 2025 18:33:55 +0000 Message-ID: <3D32B62F-29E2-4470-86A5-9A2B3B29E371@akamai.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN8PR17MB2755:EE_|DS0PR17MB6984:EE_ x-ms-office365-filtering-correlation-id: cf03f535-ffbd-46c6-3ea8-08dd6326c6cc x-ld-processed: 514876bd-5965-4b40-b0c8-e336cf72c743,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?sD5jY131q2S9WRHOP39BwWERi1R2V2f?= =?utf-8?q?uHX95ltAMw9ORz5fHGnN6JBWauh1DW/d06tFWH3E3IjdHfGVuoYdjmchp6KfdG4eS?= =?utf-8?q?uM9IAMPOa4xvNDMNmSffLxGw/Vj1vZJQYApX1tPp24A+PQkdDNQSjGQB783krgay8?= =?utf-8?q?ZPgF1qF1FLj+qN3mMh+2XMfe5E0KiQBdsmqdyA6Ihqt/46s4LZTP/dIwTl8MVnA1s?= =?utf-8?q?U2MVkgaHA3NJksod+ajRJCSMl3FkYHBd+RsMs14AupTMkXiSgVRxXO6Mfue5L7bnS?= =?utf-8?q?9rKbnmYNBkdD9ThMnXZUJS/ze73wGQ2S0wnwTyTvrYNsE/QgkICaW/pu2uPZfI8C2?= =?utf-8?q?SHdvqHtWn4f0L4df3brKNksQMIGVOXXm4uzC6oNk65Zg6rCCzMwqjKng1RZJnvkGd?= =?utf-8?q?60XiPXEKLAR9H05vrElWZQmtJJQ6kcN28Lb11o+MuQjrXZWLnIdWAG73GDPfZs+Nb?= =?utf-8?q?7+H9u7CJNk+FGR+sBU/YweZdfZJo0SPgvLptTDFjK8Ecb/jgXxzUsy2rlbk2tTBfF?= =?utf-8?q?kaIF1841DeuiypkCEJhTLIVHfi8gUGN0jD5uSYBc4uiC4M/BxW+D5yVNj6kZdM6jv?= =?utf-8?q?w1uVh7azJ0xsoip6mTInGivD18ILRyZK2g8TMewk5a8i2fWyX7UvQMGJaDZGNpwMQ?= =?utf-8?q?dB3hvMTZOx18j1u5GIQPR2v87CjGrbVS2gbiJXrit68D1biBu7L4uoTXGOBRl4YRS?= =?utf-8?q?Hthdlxxdqx38LGBS26vZ5bGDeWKaFAoRSOylHvrzv1KMz86lKy/Lg627ClIUKupkk?= =?utf-8?q?GYbs2VpgqDFu7QwMzUEt23qcD6YoC4CpkcOEElPbw9lXIhudKW9Y7L0Oq/WecWTbz?= =?utf-8?q?1EBa4t9RzWAnc2GYK/9kzX/dAqM8RMAJRsjUG4/u3wkrJnoz0d2o+oYmSoP9CtEBH?= =?utf-8?q?IOj4yNkoUKOG59DNYP25Cm5DBTMJsdvG74WtY/afWm72/9uTLvMpD1tL8o/5vnj84?= =?utf-8?q?GsXvDFQVbU4aMD1BC3UTBPPo2foSC+5JATbb/L9QZSj3eP0Q5kTVmefXPe0opnUTZ?= =?utf-8?q?WPZfAa/tGD0LhEci4I4hIg3JeL1xPcj7J6e1yRWjU8OxYZ5t9J1VK9TT0ChBcxU2/?= =?utf-8?q?MYdYEIGGVXNc77i+FwzGf+1y5XVY/wJpwfMeqvY5vqmxyWN6Dv7ByvOUQfVu0lQDR?= =?utf-8?q?sdVb1WkY+/uGjXRsZ8BqZeQQi9LBssCVTYMB6GrPnyNPyfU/4yC/Jdc3bNGP61afK?= =?utf-8?q?H/ifwvyQ3OvwEAk4oy2XvPL1eOEt0WKanaktUkkBCqfJ8LUuMJAy3K06/JzlX7rlZ?= =?utf-8?q?hBvfexdlrqLSoh5xEmp+TtU1WDor2j/Qza7aSro7x1MXDEPY9yFcevCM/Gl2MHMeu?= =?utf-8?q?gDG6Tp3e1TUKLrXTIptF1pza7Jjf3qKs7qNZHc4SqaARLzdE6O2oGA7leJHZ9dWMY?= =?utf-8?q?S7JDJ2ue6DN?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR17MB2755.namprd17.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?0l7VdxZC2dHEWVA7jNYe7+FGY8sE?= =?utf-8?q?QA9McrsxRytcJF4Gl3r8TBlvgVkzHtFeGVarBtn4FSTeEQU20vid6GKq2L8CtSpCz?= =?utf-8?q?NWP+o5d/JVI2ttMKSPTgb0X1C3ejO72JxU4oiHqjYOKTItYXWo8jTB6NkB2vY8KFI?= =?utf-8?q?QFWA7xa534MOarBfch/4Kt660Mibo+EWvyP6kh7cNpvruHh7585YBWytCY0xYcPpF?= =?utf-8?q?8uZCxvv09oM05Tr9ZVD/jQO56Gh0Q0YjGWivrvVDJfec9ukqIzuTej6o782cv0K39?= =?utf-8?q?6bXgmSg4lwT48jEXmGnTOMQZ8dG6C/rnr3c4FsKxkKymH+e1hx1uHcyHSVTXwijd6?= =?utf-8?q?PbPJole8OM3V/gXvxBPMRbHq6cGXbNZLrwuFy9un1zQGZTKz1Eu2+T5hyurie0Co+?= =?utf-8?q?U2ziErL+QlTEE0AKV6zD8KJquageAT0gdFYd4IMIpDHqDTCWj/Bt341Q8fe7wRW8H?= =?utf-8?q?uNPwgcYBZFG3xOYzs0MaMqi5AVCSyL1Oml3i9UitpV71mhbaeHNQBATf8Kns79UER?= =?utf-8?q?D83/s3Spc6EZ5OhjKLb3dxRjRL2zdXRm+6ZwxmuRCbRTiqXCDHcNghp9PPvFcPhbo?= =?utf-8?q?gXFG3yu+qRlivo0e+Jocpi9OpJamtRsTmaomggTj4iN3bvVELna/+xC5f9pCcuw4d?= =?utf-8?q?fU/FbdMIHkK/lZ5rYsu3M/G8YxSuU1L5eskijoC7CW2pcXoLZyLdZFHAXX5kClOKv?= =?utf-8?q?CUxb2ApzwoTk7mTjwydssWpQHNdJyjljNQpG991UihmNpGr2KX2k1idoRRGr/miRx?= =?utf-8?q?w3SYFCCU4jOgnM8oQAPNWOPhjcRnkc7C3dAHENdRMIDKEkORLcg5OK6GCT9o5HyqQ?= =?utf-8?q?pznRJb/AkTcxEwR/TZgBnrC3HjBXvpMdgR6StUas+GnL8/hjT1hrbKNqlIP/YkOmi?= =?utf-8?q?kkofgssNl+R2c+OP7+Q0HIMcARxFOw8dnmghqRH5OLj31ts0S5AqKyyrPQ2uLzAWv?= =?utf-8?q?uYTEde7FiDFpwvZZzlnVxqa4coZxQlwZ0JLJHx28CniZRZUK+okvvQnBXE2DT96mb?= =?utf-8?q?GNYCZi9+oMDAP9tv1eALGQYgG2AGNu/4CATN43dT+RHGcwBz57IxFwLd8/pDy1k+P?= =?utf-8?q?+1BN9cGtZXe2eu+20aBl4UwENz9pPA+s+B7Imna/38MCinmdbMxfl2K0Cbh9NPPaG?= =?utf-8?q?KZ5QyogVeew4DkZQhiLFDbTXRLM62BKV16FEWFe5RjhH3lnRT79EdJPrCGYE5gYem?= =?utf-8?q?F9bfC/pO5DSmHlI+jZtV6ZbsRXPIfsB+rglFyiuxu/5wnaisJVG95LRbXwjF+uxQA?= =?utf-8?q?Og4P0v1KhgeL0aOxehZF1UmW9lJeYq3KkOrJBvmcmiTGA5VL7how636eES18swXb7?= =?utf-8?q?dRMSNLIfy9JOkAOHhKR3WCVPwtgA0ZcpDcfXI0opx75VOYr/5orpbeGRoFWE3KRd4?= =?utf-8?q?yJfv2H0OydQGy3jAjDktDe/ai+Tr0WUJQ4F4HvPsNyKQmo0zARKvVI64WNlNESZpd?= =?utf-8?q?BifVM6VXZd5wAKxKQp0EX6SOyknR2h1ra3RSmBb/ZxPoZM5lxnIYoOLWfACDDyOTl?= =?utf-8?q?YFRdd1SAJ5lU?= arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EXmcIwELplWjsGlXZiFu228U9H/De50EsEUswBM4CttcjYyFHN36HGKQac09HEZoeaW2SrNhcmyW11y81XOpJITu2shSYxQLubCQkViwMI+02PkXxOudr1AlCWWsovjtBA7qHKFhLyH962AZd68IsnglfxD9Phcdh8adfuD8JbCRnoS9RPzJnDxhPGKquYkibcyq4xQ7TvvxwcAM7eekrkiks08Bq6NdUazRnmGN2zgkfL7svhfrMpdg5iD7dMXqVYBkOsSbjQfvXgI1P5aXb0gtcrd8cY3GkZYQvw/CjPZ+tQxZSwnMKQdPSO0SzI5dv3REo1pYij3eW4n6QaaKjw== arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2y5ycm7asFW37Vyp8NAyAZQPxeHBh2cqIntDNrI2NnY=; b=g5rZ9jSPw+njg5amWplmEi9KOX8VcIlXwomAKoLAiXtar7Bd4/VNbyBhPIQDSpGhmQG3bFBrtkUpkcSXNchONcwWOK2K8G4jwJc/azvtpJ+z25SjUqR8ZuCJby1xlljgMThiZbN1sXW6ntaagIcuUQ8zvmzackHjm4euOG4LsYO6vNjMya3XLP3MYeQVITVhrvG8KiFIGLdyA6c3oT/AsoD+UVn2xQ65iUuAMRwqJ3wY4AZWDzO45LZE9Kzw3e2LxZ8EqvZvkM/d/fNdduv2rVnZS7sVF0zeF6XfZHxPs3gPM3i0hS/4vsusMKbhDtS8v21ftmlEXUwozdDGghKSwQ== arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=akamai.com; dmarc=pass action=none header.from=akamai.com; dkim=pass header.d=akamai.com; arc=none dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai365.onmicrosoft.com; s=selector1-akamai365-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2y5ycm7asFW37Vyp8NAyAZQPxeHBh2cqIntDNrI2NnY=; b=jeYz0Ig2I7fBvcbWuC8Gu9rlKKRikSmP38Kn4l/981s5wbG4WprjgUcG1Dbi8ZGuIEwrDvIdmfTWcoZqLfVlimj++HixLUzV4zLFamVKhvs5WUreAdLOT4yVCvK4p13eGp2kPBXElDbqt/GRwq3OHfdO5iyeGQuPik0flVL7sio= x-ms-exchange-crosstenant-authas: Internal x-ms-exchange-crosstenant-authsource: BN8PR17MB2755.namprd17.prod.outlook.com x-ms-exchange-crosstenant-network-message-id: cf03f535-ffbd-46c6-3ea8-08dd6326c6cc x-ms-exchange-crosstenant-originalarrivaltime: 14 Mar 2025 18:33:55.1559 (UTC) x-ms-exchange-crosstenant-fromentityheader: Hosted x-ms-exchange-crosstenant-id: 514876bd-5965-4b40-b0c8-e336cf72c743 x-ms-exchange-crosstenant-mailboxtype: HOSTED x-ms-exchange-crosstenant-userprincipalname: ZO5AlS+avLUkpZ/8qZYdWko2sZQcyYE7OqNyShNsuTofg460gVC2mDUFi22yHtlHHAv911kmN023LSQyPeZE5Q== x-ms-exchange-transport-crosstenantheadersstamped: DS0PR17MB6984 Content-ID: <96121A493C23FA4A9B0B41DB1FA774A2@namprd17.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: akamai.com X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-14_07,2025-03-14_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2502280000 definitions=main-2503140143 X-Proofpoint-ORIG-GUID: xn438jabMrfuCUclaKZYRYkaVnBtoZ0A X-Authority-Analysis: v=2.4 cv=Pav/hjhd c=1 sm=1 tr=0 ts=67d47698 cx=c_pps a=StLZT/nZ0R8Xs+spdojYmg==:117 a=StLZT/nZ0R8Xs+spdojYmg==:17 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=g1y_e2JewP0A:10 a=5u7KhYVwOYSIvCfEw0kA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: xn438jabMrfuCUclaKZYRYkaVnBtoZ0A X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-14_07,2025-03-14_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 clxscore=1015 mlxscore=0 spamscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503140145 Received-SPF: pass client-ip=67.231.157.127; envelope-from=bchaney@akamai.com; helo=mx0b-00190b01.pphosted.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Hello, While testing CPR transfer I encountered two issues. The first is that the transfer fails when running with pidfiles due to the destination qemu process attempting to create the pidfile while it is still locked by the source process. The second is that the transfer fails when running with the -run-with user=$USERID parameter. This is because the destination qemu process creates the UNIX sockets used for the CPR transfer before dropping to the lower permissioned user, which causes them to be owned by the original user. The source qemu process then does not have permission to connect to it because it is already running as the lesser permissioned user. Reproducing the first issue: Create a source and destination qemu instance associated with the same VM where both processes have the -pidfile parameter passed on the command line. You should see the following error on the command line of the second process: qemu-system-x86_64: cannot create PID file: Cannot lock pid file: Resource temporarily unavailable Reproducing the second issue: Create a source and destination qemu instance associated with the same VM where both processes have -run-with user=$USERID passed on the command line, where $USERID is a different user from the one launching the processes. Then attempt a CPR transfer using UNIX sockets for the main and cpr sockets. You should receive the following error via QMP: {"error": {"class": "GenericError", "desc": "Failed to connect to 'cpr.sock': Permission denied"}} I provided a minimal patch that works around the second issue. Thank you, Ben Chaney --- include/system/os-posix.h | 4 ++++ os-posix.c | 8 -------- util/qemu-sockets.c | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 8 deletions(-) -- 2.40.1 diff --git a/include/system/os-posix.h b/include/system/os-posix.h index ce5b3bccf8..2a414a914a 100644 --- a/include/system/os-posix.h +++ b/include/system/os-posix.h @@ -55,6 +55,10 @@ void os_setup_limits(void); void os_setup_post(void); int os_mlock(bool on_fault); +extern struct passwd *user_pwd; +extern uid_t user_uid; +extern gid_t user_gid; + /** * qemu_alloc_stack: * @sz: pointer to a size_t holding the requested usable stack size diff --git a/os-posix.c b/os-posix.c index 52925c23d3..9369b312a0 100644 --- a/os-posix.c +++ b/os-posix.c @@ -86,14 +86,6 @@ void os_set_proc_name(const char *s) } -/* - * Must set all three of these at once. - * Legal combinations are unset by name by uid - */ -static struct passwd *user_pwd; /* NULL non-NULL NULL */ -static uid_t user_uid = (uid_t)-1; /* -1 -1 >=0 */ -static gid_t user_gid = (gid_t)-1; /* -1 -1 >=0 */ - /* * Prepare to change user ID. user_id can be one of 3 forms: * - a username, in which case user ID will be changed to its uid, diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 77477c1cd5..987977ead9 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -871,6 +871,14 @@ static bool saddr_is_tight(UnixSocketAddress *saddr) #endif } +/* + * Must set all three of these at once. + * Legal combinations are unset by name by uid + */ +struct passwd *user_pwd; /* NULL non-NULL NULL */ +uid_t user_uid = (uid_t)-1; /* -1 -1 >=0 */ +gid_t user_gid = (gid_t)-1; /* -1 -1 >=0 */ + static int unix_listen_saddr(UnixSocketAddress *saddr, int num, Error **errp) @@ -947,6 +955,19 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, error_setg_errno(errp, errno, "Failed to bind socket to %s", path); goto err; } + if (user_pwd) { + if (chown(un.sun_path, user_pwd->pw_uid, user_pwd->pw_gid) < 0) { + error_setg_errno(errp, errno, "Failed to change permissions on socket %s", path); + goto err; + } + } + else if (user_uid != -1 && user_gid != -1) { + if (chown(un.sun_path, user_uid, user_gid) < 0) { + error_setg_errno(errp, errno, "Failed to change permissions on socket %s", path); + goto err; + } + } + if (listen(sock, num) < 0) { error_setg_errno(errp, errno, "Failed to listen on socket"); goto err;