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 713E3A034D for ; Wed, 23 Feb 2022 12:26:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62E25426D3; Wed, 23 Feb 2022 12:26:21 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 394AE40E5A; Wed, 23 Feb 2022 12:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645615579; x=1677151579; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=6kS1Paf4i8lN24OcXyvTp/YWQGLZFGGW7TlGbJJoWNo=; b=QH+gtObqfo+6OZr1w1fSQWRa1aTvTGnGwlJknJG5/h+JiKZKFgrLviwQ gEwnz84NhYuftB5aLc1M0OIBHW+MVTAcQ8CYYIJCtpEe4ZhI02XJ/1BRM mxDFPfgSVB7XaW7tuaJZ2HQ35Xmy7vEYSSIua8JNiaPFx1uGEXP/8fGkD znomfYYWDWRbNlOvjnCTyM5Uey6H4mIZnlF0eUigNh8QIULJDMWDibKF7 +SBP217hn6S+6d6qVqRVCxGVv1zb0vyAxdyN9y9UyjR9o3JOnxuJl7fP0 S+abTNyuDiW7Pvt1XF6Oo8+6qxJ9EqTOFR1qVJplq2V3ElAGb41rksrH8 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10266"; a="315168397" X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="315168397" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 03:26:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="706996908" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 23 Feb 2022 03:26:18 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 23 Feb 2022 03:26:17 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 23 Feb 2022 03:26:17 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Wed, 23 Feb 2022 03:26:17 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.176) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 23 Feb 2022 03:26:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TxOv/plUcftYT5DU0F1Dlg6yEalW1vI1yFASR6ZER1dY+IAR6BBo516PYaBOXtB4B2UGvL5VYYPDTAKZ1xeA915bFiBWGufrSinzkBCwk2EQ2JbFmUIbenejhqJ4vyGjA0laZygwDZfvAy2PHBIUP6g3+wR7a/bvfKh6l5gndc0aGakAJk2uGk3YVWq5cwWEij/RLV4QBM1YnK/vm9BKMXis1+FAgBiIAQI/X4VdJNBpX56radoywMk9voim53HbCqc5UBBJaT8i0Yh3U36cGnyWqYg8qhpBH9Pcj4Fn5TVKo4x8sLP74L7DMt29oA792FL0ALx+EOpfe3pzF7ruHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=zwk5idUFqOTYjoRafZVcA24K/8TMzfFgvCh8uJoz4U8=; b=Ufj5tyLr8LotcGP4fyM1N6DqRDOSX2JMuWsH+z7ji7GxLOcj9V7Fdlkld8g0MfQR7juC/UTy1yynWUAfyOro8LaqcQXD/EFt5GFlvsIfNWCv1YmF50+RabTPvGREc1uqCTxrt+qv9FgCvMHAJFp+cJWndvrzB/jSPN7xi5EDoS0WRYzdy/SKaIjm1FwEoU0PJ/dHFy0Wmy+/+DtkrOoPRzWEcNiBv2D579ISONFLx5aib8s+KrtYcdppPFGRuJ5I6C0zVZPJ0VjkFhKEpelnT/UeWXelDnfkmF1VjfgBbcPvlvxxufI4IVrSZBzZif1rKQqbffkDXRdj0QnDyj455Q== 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 PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4965.namprd11.prod.outlook.com (2603:10b6:510:34::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Wed, 23 Feb 2022 11:26:14 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2%4]) with mapi id 15.20.4995.027; Wed, 23 Feb 2022 11:26:14 +0000 Message-ID: <6a18f1f6-2651-a659-5229-0aa8e367a4ee@intel.com> Date: Wed, 23 Feb 2022 11:26:04 +0000 Subject: Re: [PATCH v1] eal/linux: fix memory illegal accesses Content-Language: en-US To: Steve Yang , CC: References: <20220223084950.3572178-1-stevex.yang@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20220223084950.3572178-1-stevex.yang@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0295.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a5::19) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f54e714c-b783-4be1-d3d9-08d9f6bf4d24 X-MS-TrafficTypeDiagnostic: PH0PR11MB4965:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iMUyS14nC8zAOFrqiyyQjYfojNTmTWr/dhXMR3uAH3CEU+BY6QvsP+d592FjHTeECDmo7I2hlnQBa2hvUov3pWKq3yYpTJ/M8FtUO2L68ODRSVwqj7HBwQ8XsRLU6BKjtqFDJ3pOUalAFAYHWEafhaBlf4V6/tWdN6Sf+GxS4DF+bGDsqrvwxrlrOdGx8KoUdNfpG+WJLFvoL65syzX/M4O46vrXyRjhbpqRdV6oyicYEtHb2YJ4er+FaF/mwV663RMIJRnFWAQIfTLWOKdDRL6O9krmOn/G62EnwCAZh8aQ0vf/iheMm+DfwE8txiFt8rX3X2/i/caYTX5jISxgxwkassLuJHyJ8CN6fom0A4kf6k/zFdiX5LjZZpglv+w2lP9HICW6s0/dDgmOk60Vj63xeg+b9aoVneyaXuOd12oruzEvbFXw1Huk26j7IuAKeLy2MH+bgtGQT3PKzF1y8V90r9YNKBiYPYoMRWGT87NNYcrLxWGxK0AHJX42MqadW/s6TRLOzVW2hbuLQXO7U69BdoMPeLL8NQ71hIc8yY1gjbAbEZK7iajsV8SY4p2/wx8VHR0MI+2qxK+Guf579HzzxlbXp/KPEON3YKJr73/zNH2+1E9ayUXLSqpSkmdDlQK/tOU8CJXJC8K5UYScY4gyT+WFvvURqCj9vM10/mKFRBkZ9l5SCmOOY7n8UYSGLfyc76F4xL4etQnnsTjG4g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(31686004)(6486002)(82960400001)(53546011)(2906002)(83380400001)(450100002)(66946007)(38100700002)(66556008)(316002)(2616005)(66476007)(8676002)(86362001)(26005)(186003)(4326008)(31696002)(44832011)(5660300002)(508600001)(8936002)(4744005)(36756003)(6666004)(6506007)(6512007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ODBKelF0dFlnRHhTOVlWbGJTbEh6aVFpaFB3dEhqYlFrNWdrQWd6NGszSzV1?= =?utf-8?B?aWpaZW9WVGxjeGR0NGJnQnpNUEswRnd6c0dJNS9KOVZLR09hRW5JOWpVeUFn?= =?utf-8?B?TjZLWDAvK1dvR3RJY1VUbENNWEE2cEZkRXpWNUNobzZNWWc5YlFhbVlNaXJN?= =?utf-8?B?S3pkRnNvc082dFkyTmE4ZHMyYVUxN0dXbFFVVGhha1dKNzVqN1lPZktCSyto?= =?utf-8?B?SGl4M2VhbzBkZnliWmhqQ1VkSklMVkNYMkxKdFNIMHUwWHdtVkkrRExTYm5Z?= =?utf-8?B?K0xCM2pmRlR3RENUWXRWZ0FhQlpmVTBmcmRJNkJjcjJ2STNNU0FyTGI1TUpW?= =?utf-8?B?ZmU3TERXcFpYbVFrSS9Pd28ydjJlZzBGOTA5UHAwL3dzbzI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MX1ubkjiBvzC1pq7FesN0Yg=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: f54e714c-b783-4be1-d3d9-08d9f6bf4d24 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 11:26:14.6674 (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: MU6ZoVPAvqyHBOE+pHIq/DXYif0fJmpJ5heJzuxB9xvV9sS6pcPokTOJ8AvUyzVUn7RKGXg9vMx25pUz6PaB9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4965 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 2/23/2022 8:49 AM, Steve Yang wrote: > 'recv()' fills the 'buf', later 'strlcpy()' used to copy from this buffer. > But as coverity warns 'recv()' doesn't guarantee that 'buf' is > null-terminated, but 'strlcpy()' requires it. > > Enlarge 'buf' size to 'EAL_UEV_MSG_LEN + 1' and ensure the last one can > be set to 0 when received buffer size is EAL_UEV_MSG_LEN. > > CID 375864: Memory - illegal accesses (STRING_NULL) > Passing unterminated string "buf" to "dev_uev_parse", which expects > a null-terminated string. > > Coverity issue: 375864 > Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process") > Cc: stable@dpdk.org > > Signed-off-by: Steve Yang Acked-by: Ferruh Yigit