From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a111ddc951-e01eb54e-fd30-4b08-a263-ed7329245505-000000@eu-central-1.amazonses.com> Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11021133.outbound.protection.outlook.com [52.101.70.133]) by lore.virtuozzo.com (Postfix) with ESMTPS id 035118017D for ; Tue, 6 Oct 2026 15:38:34 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Sy4qiN29ZgCdO7Tn8pCElKkYNes2OT0M99CceHvfwst1ySHcNnxbCHUd6H/xVDyh0nR925SDGBf+Rc1omDRXEXb87TPDkmabFWtt/ikTwdQySyyc/vYDYr38358/EyAznLgVEii1+Ax1mMxu3WDSefkA6mmShaCKWO9PP2dzmx1zUJOuXlWIgArftYyRGHbfi4uyZfboBL7XeaxSOb7YfQ2G/jAqzir2N7PyiMQ+6WLURZZbjPT/Q2xt3/prlTaQEOnfuQRmUOT0Grp5XeBo2igmRRNkWLvjy0arvymj58B7ZQ9UdPeI0C4LQmGNgmKdd16QAzh+WmEW89Kog4jF2w== 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=rdLOcO/f4OwXGUBKTr1y3geJh6KVYG4Ce+Az90aTMvc=; b=OfCF8rxipcJ0i7CqsmvMEFPTPGEzXxH2ggZgt8+xQhTl4lwD26bCYU/ZsrZ2Ok+rxlxzcRVcdwffGqgj+CrJF5HPmGSCaNuYzfpGEkkWNC7Da+7IJSSU29ufjNBtb3xRvZfTLgiIBwWV/R2C2+GXnliBiqDz0Ol7/yJXW+6ZQHhLG+dbuvjjxOgqTbH8QYVCk47tZo8uKrEKp4j7tdyh56w1+HFslj0iIdUCmjHVdhmsLc334ufSEeaI0SgXqzsw09cgEHypJF70V09Tmdv8Et+M6/b5neIeOPYH2WCxca7R55tVLCbxpt6zconrOcQwBJhfWTUmQgKTde5cu4vpWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.6) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=eu-central-1.amazonses.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=amazonses.com; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.onmicrosoft.com; s=selector2-virtuozzo-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rdLOcO/f4OwXGUBKTr1y3geJh6KVYG4Ce+Az90aTMvc=; b=Vel7DxFtiZ4IwpzIiPnkLr/UJVQonovLQrelk+E9aBRSd3TOqbWZdrPI9Ohnh0EqjVC6LkBtq6rtB0S2HJW+YESNTtRYrKkccuKF3g8APmk4+Hz90TbXfzZpAcim5QdrqxjHAWoYJEj/EoUaY/t+L1A+7n14Gs5Ie+sDyhg9kYs= Received: from DU2PR04CA0205.eurprd04.prod.outlook.com (2603:10a6:10:28d::30) by BR2PPF70F1C207D.eurprd08.prod.outlook.com (2603:10a6:2d0::20a) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.496.14; Tue, 6 Oct 2026 15:38:30 +0000 Received: from DU2PEPF00028D0F.eurprd03.prod.outlook.com (2603:10a6:10:28d:cafe::63) by DU2PR04CA0205.outlook.office365.com (2603:10a6:10:28d::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.20 via Frontend Transport; Tue, 6 Oct 2026 15:38:30 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.6) smtp.mailfrom=eu-central-1.amazonses.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com;dkim=pass (signature was verified) header.d=amazonses.com;dmarc=pass action=none header.from=sashiko.virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of eu-central-1.amazonses.com designates 69.169.224.6 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.6; helo=b224-6.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-6.smtp-out.eu-central-1.amazonses.com (69.169.224.6) by DU2PEPF00028D0F.mail.protection.outlook.com (10.167.242.23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.496.14 via Frontend Transport; Tue, 6 Oct 2026 15:38:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1791301110; h=From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Message-ID; bh=M3mlaG/1MPqsM8OgeIbmRE1L6PSnXF+JX81k1R4aLYg=; b=a6elhHq2PRA4kTw9VpVOs6bAifLt3fZTyiPSJQ5HfHD2NAtCOPb2958peJK5SpwH fP+J3cM6e5FvWpvKj3ZU3SJnXnU0SgwvdVyfFVDRo64pQnWBpKPi65UiyEQPnHAMvRE gzfTzK71/XaPveGWUZobIDBmrg6RHdTBp6LwchjrTjJFZQSuvE3GXNYGMnn5GXlBsOT 4Q8nV2mEskEtDlpFcp3U3EHWspWgkBblYVBGHh5lw4NgOznT7SqbmvV9s1lKii//coH 3koGzXlhCks4xfwIx1rThj9ESosHiz1AafK0U1ays6uWPtm6eRFurGgIOad4B0VVDk5 o5KAhcLCmQ== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=sokbgaaqhfgd6qjht2wmdajpuuanpimv; d=amazonses.com; t=1791301110; h=From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Message-ID:Feedback-ID; bh=M3mlaG/1MPqsM8OgeIbmRE1L6PSnXF+JX81k1R4aLYg=; b=YPF/W5+/xouZhQosyZJVv3qpGqrWOpBR4ry9IzgPznoP6AvVN4G9CMrjy/F5K6vx TvctFmuEYawAD9KEI1ou45KoPRwpgDZ8TK5nAPNVTpJK/c856bYAhX5vFVqcW5j5lFH KcsY0mDoG240cWHbavxR3nAXswgL+oPZSYEUxVPs= From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH QEMU HCI-8.0 v7 01/14] usb-host: don't leak hostdev FD on open failure #VSTOR-137800 To: Andrey Drobyshev , svt-core@virtuozzo.com Cc: den@openvz.org, andrey.drobyshev@virtuozzo.com In-Reply-To: <20261006-usb-host_v3-v7-1-044f668789a1@virtuozzo.com> References: <20261006-usb-host_v3-v7-0-044f668789a1@virtuozzo.com> <20261006-usb-host_v3-v7-1-044f668789a1@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 6 Oct 2026 15:38:30 +0000 Message-ID: <010701a111ddc951-e01eb54e-fd30-4b08-a263-ed7329245505-000000@eu-central-1.amazonses.com> Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.06-69.169.224.6 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D0F:EE_|BR2PPF70F1C207D:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 5f55dfee-4ad1-4b19-0c2d-08df23bfdf9d X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|61400799027|48200799018|9140799003|32142699015|4143699003|56012099006|5063699009|10067099003|16102099003|4113699003|22082099003|5113699003|18002099003|55112099003; X-Microsoft-Antispam-Message-Info: 8PXpBOME8jaIOaWT4zQdHmWp9sci/XkF/7Z3/1QS0Z3292Ze63G/8gT0C/hYY6t2ZIGhMr9ff7Kbii1CkLnMx3Riz+fpeFbyaH3UEnUjkzAfLHZFAlRhKn9eVuLzEMR0yAcSwIQ8dmXNb4jAJzPhl3GroC1rsG7xA//BKsfpcDxtDv6BHAE+KSXABBv1K/kOHcZVJNu8JApyN25f+NbhDimcMCgiVIAbSa8Mi+VBG2CMlto+xG7gb9X3+qTD+I/wtM01N6LJ+G4+WeT69h06NeeOA4g5PF9cW4mgMxcZuOqGqvSL/iIsOTO+nDggxlI0O/N+AFuhB+/+IuejQN9glGJJCO691TU5qsfCMx1/UBO24eSa0j+//vR87lYpp+dyEbrCoJbo3hRs7ru6yv+1g1ZocaQfkRRudOikIYUVtlEx0zdzOgWJ4IQ8F3106tmJIsx7/V27fggc9M+DzwIL/0bSzTr5SHIrMFjnF0OGFhRNsvCL+TOKZloN/ZIIeFTsYw5N2lrpxNnkLlivQ0AJwbV7wb+LUoltCG2sjtYmWWKBNZG863V/QIZtNJ2bhf18U+qn2mfONUPvkkH9+v+laIMKBjG719U3XdPoz0NbiEueYLTAjR1GjL4V1GJqbiufNaT/y7WFrDrEk4D6sDSZuVF7EGxuYjgYAicA59i1YDhMDHfi1NEhg48RjBDXWvdmQfwPQ7Dbeqb1sE8jNm6kXZjSzFO7Y8UcNY2Ow92beFZzSyAO9xKiiA5YwsHb6K1rtUXjrAZW8MZlVlft7Jxng+gFqhulxnjncADKov1hKbsRNWAjNCuEYN4Mngp5/evqKaEBRSytexvuufIhAk+Tbm0FDWXqTomSZ5TuBgsvU0Wc83p9S5u/TfZ0A7CZK1IsFpIFp8kXkvtZztxgqkMZWg== X-Forefront-Antispam-Report: CIP:69.169.224.6;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-6.smtp-out.eu-central-1.amazonses.com;PTR:b224-6.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(376014)(61400799027)(48200799018)(9140799003)(32142699015)(4143699003)(56012099006)(5063699009)(10067099003)(16102099003)(4113699003)(22082099003)(5113699003)(18002099003)(55112099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y2Y/72hM9Zgatvg6nHiGrkw3rcV9uKFsjbUja2k1t60tab8VLrYbgJ82GIZRshB+m6CcSNpbO3m+NeqMBvu2+HoQN6s7J4+m0diEcXIsfraNEHEF7CjZ1yBY5ZzoZ59o3HPzjQGtilV7UzR7i9CqncGKRBml08rPRXdsTyRBiFL3BkZG+VaYMfJTjCtcrzciFQggg/0TmzdmYLgVNfva69Jy8+RsVh4VYsySa0VpH6TJbXC+GhKkfrhu/pQ+yZlpIbEVngg7LMSA9TiqsU3v74Rle+9TmOHLevxkt3ZU9SPfyu3bC/Rdupe4A17h1QyDG5u4HazA8hi4yKXz5aEq5ks7xtlnr5aqd0AlMgdbWbtMW/xrirDcEuJv4N/eDCfU68/WSni09M4Gt7AyfCDdaFx8EaRGlQldoq7vhJBbQR2makgL8XyHNNahfdcQEda0 X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2026 15:38:30.6354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f55dfee-4ad1-4b19-0c2d-08df23bfdf9d X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D0F.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: BR2PPF70F1C207D > The FD passed into usb_host_open() for a wrapped device is only stored in > s->hostfd after libusb_wrap_sys_device() succeeds, and the failure path > doesn't close it. if wrapping fails, or a later step of the open sequence > fails (e.g. usb_device_attach), the FD is leaked, as usb_host_close() only > runs for fully opened devices, and the realize error path doesn't clean it > up either. >=20 > Store the FD in s->hostfd before wrapping and close it on the failure > path. >=20 > Signed-off-by: Andrey Drobyshev Sashiko has reviewed this patch and found no issues. It looks great! --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/20261006-usb-= host_v3-v7-0-044f668789a1@virtuozzo.com?part=3D1