From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF9C945EFA; Fri, 20 Dec 2024 14:37:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92BD340144; Fri, 20 Dec 2024 14:37:55 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 7B6644003C for ; Fri, 20 Dec 2024 14:37:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734701873; x=1766237873; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=ftPIywTHw/unPQUEoQQ/09Ls+6Kz2LTQ2YRlVhC5goI=; b=Ma8itn2Fu90k4SsLAuxwhYvIPcO7AQoFsHqf8qU4wsjpscjk4WRv3UGL Ib7uLhLaC1xN4yBlC5Pu7YX4kpjnZOCt155RynldDvQEGdYnJ6fmPQttN Ufl9xf86slRRkV7jTXs5PPK55SoEC8u7uO4XXIqmdTEqo0C29brCmUsES GiN99EWamiTavMfNvICFjc23oMJnZzGqaI4ZAN1zMJBRIg9uJceGOMgPS dhfGAEKVfslABRm8WDacqTcugKzST4se+DCkJuZbXTda2z8pQ8od9dX/t adN6jqQ6kp3C0Yr3ymIVJ63ji4po3Y25a2DZgPfn4CaUlBRpLdDJWqryy g==; X-CSE-ConnectionGUID: ppfIUDH4S+SIu7xg0id5JA== X-CSE-MsgGUID: 0gUy3IGYS4yv590/xPu4vQ== X-IronPort-AV: E=McAfee;i="6700,10204,11292"; a="52655063" X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="52655063" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 05:37:51 -0800 X-CSE-ConnectionGUID: jrsyxoCpTZWg5q/CaRj+7A== X-CSE-MsgGUID: k/Q0AsGMR3a3VX4bgS4Vaw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,250,1728975600"; d="scan'208";a="98714612" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmviesa008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Dec 2024 05:37:51 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Fri, 20 Dec 2024 05:37:50 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Fri, 20 Dec 2024 05:37:50 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.177) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Fri, 20 Dec 2024 05:37:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SD5y9jvrQE3I9fqK3OWQyW9EBGQL21KlqcZQW90602Nb1Cs1HrMM4p9WYeVL9fyqW+QVur+GD0t4fzYPBJyKCBjKzTbCXFtzrK2ULya0oyiYgIyNkXB8eC+l5Q34yOvB52qdQWuD3qS3m6QgYjcrdllIXjhLO8ghJA9AgQTPsMYaTh9otlfhQpo1CVchT4bKnobmZs9kwM+LZ6r2c2HtaFdqve8/bijeM8HQKZXplqtRVA5E6haYOGiStkFXbT7QymWzt6c9iTrQfM75rZvhB3//JjSrCbG35aSJqhttLP+rgrvGsfMUuCtTRFYtZhKbgDhG6uOTJ+H8GIzxY0m0KA== 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=iH862tZVZWa2ElMcbV3qoba6Jc86Fp49l5xSDZfOwjQ=; b=Q7ShJX8xgZWyHRtkFxf/sHi5Y+rzF5yKQGhm8xPPz7QVJMYKGcCg7/Wur3+b77Q2K8WiU2WsUgyYAiXxO5f1pDHLCFf18Ox6if3XFTwd3Dncb0uPY80Hngxs/Q23bV9YTdzEnsBrBib00DANLm3Pki6W0nkDgdZOIyp5TxWozauMbcnj6ch9lewF8tQ+qehX/HoillcRVOBVZFCwfna48w8yiifJaKKCLmJf6yTGp3rG2zsw8zfNjyi6W1lNlgKm/IRwd2oGVYLjhEsdpe6gfBICplyd4jK9jW+WJ5zJdk7YwK7zMonz1LmHZ0azPpVTwryl5/fNtR5dTgPRYecDDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by CO1PR11MB5138.namprd11.prod.outlook.com (2603:10b6:303:94::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.17; Fri, 20 Dec 2024 13:37:31 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%4]) with mapi id 15.20.8093.018; Fri, 20 Dec 2024 13:37:31 +0000 Date: Fri, 20 Dec 2024 13:37:26 +0000 From: Bruce Richardson To: Stephen Hemminger CC: , Maxime Coquelin , Chenbo Xia Subject: Re: [PATCH v2 5/5] vhost: use strlcpy instead of strncpy Message-ID: References: <20241218170530.140747-1-stephen@networkplumber.org> <20241219225253.782792-1-stephen@networkplumber.org> <20241219225253.782792-6-stephen@networkplumber.org> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20241219225253.782792-6-stephen@networkplumber.org> X-ClientProxiedBy: MI0P293CA0001.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:44::16) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CO1PR11MB5138:EE_ X-MS-Office365-Filtering-Correlation-Id: 43f55297-d779-45bc-7266-08dd20fb741b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?GZkOR+wpErt+AtS+vGMaSXZTMLoT2VVbdWt9y/JeBY+b8NQbMc7HQwRXl4wQ?= =?us-ascii?Q?PUXAp7gUvcpA6Mh/34iW1lB7jv57F7/Jzm4TdDaZerMTSfZQp8AiELF1QxXF?= =?us-ascii?Q?IM3JgPqvA/I6MHIOF7wCMDs6nuCbAR/AbnzZWusUh9pFkAGU7qKJpwbFFjT1?= =?us-ascii?Q?YaDrcArOaN9WD8LavKtzUUQvQk2ZWnZD6D6iy1HBX3aynTWSyIIYYP3iGceQ?= =?us-ascii?Q?hzGrOKg/5pqxHZFb3bF2Z33EhFbhWYENtgo0Jhd9SjTpszzCCtTshRjlOYMI?= =?us-ascii?Q?+Yoqd39B/MvfVl0N0sVITyu2gDK8ZyzZ09E3PzBxmZ1zZlQsZNPb4YgWUaC4?= =?us-ascii?Q?xFS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pb4g1dzRtJ?= =?us-ascii?Q?aIuxvKSCEK6ehd29bdEDb+arPcF7gNAcRyrhKfxf+8dAH3BaD96WIH/20li3?= =?us-ascii?Q?2pU0Dam0wyHcjOXsPCEUdmy1nsFa5OZk3Le2IQhO+yGi32cAWoQ4pOB9RKz6?= =?us-ascii?Q?8vfMaFHDehgLbf72CDDmIYjGv8bo?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ri0Xphz8lBYlVl7bdS9uDQnfeNdynl2Yr+boIMwiNSvX30qycxZUKMN6b0Jw?= =?us-ascii?Q?6cttD7nD8Bifu4AXze79jVaSyKpjVnUAjBVrK6EHf/TKSMDLXTc3sGxVcLwl?= =?us-ascii?Q?/LSujtvPzl6oa0xQDD0EePpImVLB2GHej+QT+coQnnt/10n4lQAbPpdiyi+0?= =?us-ascii?Q?bDXRKpp5bD4hjck3ozHhUv7hB66D21d2ZVksnd86s3rI9eL0xXF42JuC88QR?= =?us-ascii?Q?yNgDny3QThH7rwM/jvHhIb+pNkGuFvjSiv499gfqvlpclhI6y0u4DLWwnOyD?= =?us-ascii?Q?bP8cXv1J3jISLHVzMDYtC66mJKlEt5+/z+d1XiPkpfy/pWWJBNz/UY01jVvP?= =?us-ascii?Q?+ulb/+cEEWqkYHZ4b6mE77bhs0jLHMr4RMCta0THdv88BYawrf1OI55AkqKm?= =?us-ascii?Q?VsjaMZNea2xVaanzRu9xVljHAiXnYYN/ydCG+epn0hwJJYuA1rHqbp4NG+DD?= =?us-ascii?Q?9ub1WnIAR3GgrkL81HbH6jXEjNWcm19EkgHIhiKp6JzBm1bF3utqq/iRseUj?= =?us-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nfqOe0YLMQklIAcSs?= =?us-ascii?Q?BcyguI4ZtUK9+iD0bG7tpv/9Z+K7SaB5+H9tg0Ic1HS0UxBXN7Hqzh+cCppa?= =?us-ascii?Q?HPR8gxLId1Lz3mg7liNwIs8riepc6gdYGIIr6m8Q/0+p7eqaejtCHKCUSHrF?= =?us-ascii?Q?JykV+hG/6T+V5vN6brWrsqfEhp/YCaiVkCR7cuaS7U7TWazyWHMzVp2MqvAI?= =?us-ascii?Q?DA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 43f55297-d779-45bc-7266-08dd20fb741b X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2024 13:37:31.5250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZuiIceWz0CLQep9SHViDKrOaGYkW7j0NDlBAeMLsxzucl4DJkFiGK+KfasZyYTEdDftlE8rOMa3hyWy7Kn972iss2rhoT2duwTQw9a45vcU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5138 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Dec 19, 2024 at 02:49:55PM -0800, Stephen Hemminger wrote: > Some tools such as gcc address sanitizer will complain if strncpy > is used to completely fill a string since it will not be null > terminated. Since the previous code forced as null at end, > use strlcpy() to get the same effect. > > Signed-off-by: Stephen Hemminger > --- > lib/vhost/socket.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c > index d29d15494c..f938189cc2 100644 > --- a/lib/vhost/socket.c > +++ b/lib/vhost/socket.c > @@ -359,8 +359,7 @@ create_unix_socket(struct vhost_user_socket *vsocket) > > memset(un, 0, sizeof(*un)); > un->sun_family = AF_UNIX; > - strncpy(un->sun_path, vsocket->path, sizeof(un->sun_path)); > - un->sun_path[sizeof(un->sun_path) - 1] = '\0'; > + strlcpy(un->sun_path, vsocket->path, sizeof(un->sun_path)); > Acked-by: Bruce Richardson