From mboxrd@z Thu Jan 1 00:00:00 1970 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 AD580CDB479 for ; Wed, 24 Jun 2026 21:53:55 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1345212.1604141 (Exim 4.92) (envelope-from ) id 1wcVXD-00027G-GN; Wed, 24 Jun 2026 21:53:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1345212.1604141; Wed, 24 Jun 2026 21:53:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wcVXD-000278-9l; Wed, 24 Jun 2026 21:53:27 +0000 Received: by outflank-mailman (input) for mailman id 1345212; Wed, 24 Jun 2026 21:53:26 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wcVXB-00026z-Rf for xen-devel@lists.xenproject.org; Wed, 24 Jun 2026 21:53:26 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wcVX9-00HPnd-JO for xen-devel@lists.xenproject.org; Wed, 24 Jun 2026 23:53:23 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a3c51c4-e002-0a2a0a5209dd-0a2a4509d3f4-4 for ; Wed, 24 Jun 2026 23:53:23 +0200 Received: from [52.101.52.54] (helo=BL2PR02CU003.outbound.protection.outlook.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a3c51d1-97e6-0a2a45090019-34653436c161-3 for ; Wed, 24 Jun 2026 23:53:22 +0200 Received: from SA0PR11CA0166.namprd11.prod.outlook.com (2603:10b6:806:1bb::21) by CY1PR12MB9601.namprd12.prod.outlook.com (2603:10b6:930:107::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.14; Wed, 24 Jun 2026 21:53:18 +0000 Received: from SN1PEPF0002BA4F.namprd03.prod.outlook.com (2603:10b6:806:1bb:cafe::31) by SA0PR11CA0166.outlook.office365.com (2603:10b6:806:1bb::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.14 via Frontend Transport; Wed, 24 Jun 2026 21:53:15 +0000 Received: from satlexmb08.amd.com (165.204.84.17) by SN1PEPF0002BA4F.mail.protection.outlook.com (10.167.242.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Wed, 24 Jun 2026 21:53:15 +0000 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 24 Jun 2026 16:53:15 -0500 Received: from [172.29.28.188] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Wed, 24 Jun 2026 16:53:14 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CwDhRcGTlagPWVD+XMrhZsowu9t8ic3CesuDa6DLsMUNHhpQK281dnjqUVDgn0cXLJVTO+aoy8bQkNKfZA2Zus1AWAyQ75e1JLGFJa8Tw0C91Ykp48auWTYrvPj6YV1uG4Rx2uVt9knuJpIaP1OIQrCqjBLbefCQP2YYMQO6sXBAj3CPV0/F8ZtM/2e6nqncyrauOxCzQlv0IPD+NUCl747xMGRG9CJ2lqBQIg2ODJ7V44tO0fD4WIHYEGbPkRAFjsZnkESzCbZ4TPjhoHtWTvaErXu/mIJuIpQ0WJ8vlrKWBzx+IJMeMjACy+MVaGmqbUeV6f8HfxMQ3U6oR3PO8g== 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=jhalz+7BYTdPOWbW0ONIYkoR12nFQHc/+tftpNSbEwo=; b=Qe16LhM6a1NwH9SPclW5X3vw3NF0XdOenUWZtS+zpwa3pdkx4buREJJ7wQffON4FDvjMaK4sjllBjhlmwrld0aJSRhc6G9oR0q3p8iq1FNRjBZf2L7+S+xCKd4gw/fjc0P1xWzBzisZzvEwYl2mYbhMxnrRqYv8rxXhWc9YQmwAcXxBqIHkc7bz1UsB1Tlp/7Jh3fpAAEG3R2MeB+9OIXtWaFNDrTykSmv6z2hCJ8aozW7SFGHd3A1hX0uKXZySrUKla+5FLxQPA/kMb4Nsf3WGnPUCOHLE5Dc/x7yDHjLmshxIGlzfR2ZwMpjbOeHyR/O5ngSly14nCQgE+G4VU8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jhalz+7BYTdPOWbW0ONIYkoR12nFQHc/+tftpNSbEwo=; b=Vw7dzrXrpQe0NTiuiceoT34YYuQIhN3X/GET4cBStvm8V1yPCHL1NMS+BQWGraMroSkBUuKj9O1KS8fV8DLBmjirddMn9E/pQ9ka9RGetxiJ280FqWzhYqHAmJKUD9ARJnT+U0Gin8pQE71HvGuiTcvGizfCC36B2dUFqw/9Z5Y= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Message-ID: Date: Wed, 24 Jun 2026 17:53:14 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: New Defects reported by Coverity Scan for XenProject To: Jan Beulich , "xen-devel@lists.xenproject.org" CC: Juergen Gross , Julien Grall References: <6a3bce99e5494_767442bc3001679a440720@prd-scan-dashboard-0.mail> Content-Language: en-US From: Jason Andryuk In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4F:EE_|CY1PR12MB9601:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e16fdd2-bd7a-4f4f-ad26-08ded23afeba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|82310400026|1800799024|36860700016|56012099006|11063799006|4143699003|6133799003|18002099003|22082099003|3023799007; X-Microsoft-Antispam-Message-Info: pDX/8j8ZhTYy0Rq3zd/+dnpxlgaKS35GFeJQ2OHjSRVBeA2OpWqofV0lS4nKwyT5dIF6UND4QJQL0f4rXiEnFo3wd1SuZNMV0EtWXv1h70uQxrVNjf8z0577EtJJ9TkNdWRZ8qe1O2pCM/H1FlD5op5oUB/eI2VC1SkcRB/S+bIPpQHwXfOMZYE2eFpgJBB16FBtdP9bvJpDvZOi7yXQmm6vDabqDBKmGcqc404mAuQ+i9PiO+42Epo6Vqd1D5O2+i9XZlPN277xSkwH/VQw8G6rYxfhw+x7EfT6xEOJU3U+r1kOdx8WHBkSBKq5JLhdV+M9YaJnvwlnSLZequhM0KVByAzitXtLQI59dyUb3aB0Mn3EFl3TjkkE0QL8rFR+kPWu+oXspFQgcj9DxTFm594yxjoOVv8xwR2PirM1wuorQCJq4lRbWU5DecMzOpONJa5GCG9BUQs5q/dregO3V/q78kHosB9KseA7ApVcEs7fOVPYqkM5RzCjgQ5thc9v083O61Xw1x4dbUqP9LvfuVZvGseTcXOR+bIqVdBatoLCNHYqp/vT/xWdlzqLi0bPvMuaYcesbVsJS9IYlN075p8HDlTeZ0HyKgUJb/gKrPdz16ymUjkxhjS3J5UqafAYvfoZqSVbZH1Rb5CShArTF2k3tvfPfms9KNhfemnW+5tLRmEnk71yO+yksO80jcZppQErGv+jFxbUSM6ALirI3A== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(82310400026)(1800799024)(36860700016)(56012099006)(11063799006)(4143699003)(6133799003)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: duvvXeYtAeoXptwpAVDy5EATTxfjTDPbcz8SEQcWWF42zmVMUozNnnF/U/f8uZe70W+C8BzzVFuCtOK5+xSlPxgstt0SUupFfIcBMBcYEu6mjzyI3uFM9skhTT4nQRwS70T6/B5pJI7jolIJI5jyoyVvBS/TLN1EobsW394GDHlKuuf9yiFZ/N3f5LxZzRze8C5UKES8GjeP7mRqeSinHS+ZN6OsfluHvZCYQdQPMA7526dDhNMjVgApZD/BVl/rWNWVoKY3a5VXUVgNNCSmh6fAzEg3hPw46DrkJboj2A01meNptsJS6+5gX7fwncHOxuKfnETu4s0xVBqSs9FN/fb3TdEOYDuDQ9T4ZYrrK+frJu0VNzqzGvAPc3iV62ZwJgOThzpfGI9HVKMhXWDLApV978tOjtjxO4CpKt54AcZ9DWMjdAeA1nz1Fy4Na7wm X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2026 21:53:15.6175 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e16fdd2-bd7a-4f4f-ad26-08ded23afeba X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB9601 X-purgate-ID: tlsNG-bad1c0/1782338003-44F2D986-E93C309B/0/0 X-purgate-type: clean X-purgate-size: 1615 On 2026-06-24 09:04, Jan Beulich wrote: > On 24.06.2026 14:33, scan-admin@coverity.com wrote: >> ** CID 1695359: Insecure data handling (INTEGER_OVERFLOW) >> /tools/xenstored/domain.c: 601 in domain_tree_remove_sub() >> >> >> _____________________________________________________________________________________________ >> *** CID 1695359: Insecure data handling (INTEGER_OVERFLOW) >> /tools/xenstored/domain.c: 601 in domain_tree_remove_sub() >> 595 node_changed = true; >> 596 } >> 597 >> 598 for (i = 1; i < node->hdr.num_perms; i++) { >> 599 if (node->perms[i].id != domain->domid) >> 600 continue; >>>>> CID 1695359: Insecure data handling (INTEGER_OVERFLOW) >>>>> "8UL * (node->hdr.num_perms - i - 1U)", which might have underflowed, is passed to "memmove(node->perms + i, node->perms + i + 1, 8UL * (node->hdr.num_perms - i - 1U))". [Note: The source code implementation of the function has been overridden by a builtin model.] >> 601 memmove(node->perms + i, node->perms + i + 1, >> 602 sizeof(*node->perms) * (node->hdr.num_perms - i - 1)); > > I'm struggling with this one: As i < node->hdr.num_perms, the last argument > passed to memmove() can be 0, but I can't see potential for underflow. This gave me pause on my initial review. On the final iteration, node->perms + i + 1 will point past the end of the allocation, but as you say the size would be 0. I originally considered suggesting a check and then decided it was unnecessary because of the 0. Regards, Jason