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 E139B41C3D; Wed, 8 Feb 2023 10:03:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD17140DFD; Wed, 8 Feb 2023 10:03:12 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 68C84400D6; Wed, 8 Feb 2023 10:03:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675846991; x=1707382991; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=2Y7Zq6/xbIBBw8+mVKywFbrD8LogyagLfK5vqibmL1w=; b=jFUd1rk0KK/uYDdauCU/1mPIbnHBZW5wf6WjaGMK3KxFBgYkhzjoOt5u HvmhzqJzC5ICs73VxbMh4y09qE3bmW0XWHpL7zVRS9pSJOjGwBtxmZhtF /vZMNTnPapNRQWvq7UxF8qLXWD9tuTewNtu4+OO72KQwD8b2Z4Z0dw7FY NaZ1rBPRP6KThfM80xC5NuPGMlL6vHekdISFhAIkdIUt/SWhxcRyYFcdu TI3MPiUDJGYT94rNV6pEJu6BccXIIKyzIcEVI7RPkozuftjdSm7WO8eK8 kLB6PNqu+zcY73ktcML+D22PEeoBPNM3jXsJkboVOrseqkDu4fmC/qeu0 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10614"; a="327444581" X-IronPort-AV: E=Sophos;i="5.97,280,1669104000"; d="scan'208";a="327444581" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 01:03:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10614"; a="735862657" X-IronPort-AV: E=Sophos;i="5.97,280,1669104000"; d="scan'208";a="735862657" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 08 Feb 2023 01:03:10 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 8 Feb 2023 01:03:09 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 8 Feb 2023 01:03:09 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 8 Feb 2023 01:03:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgGwXucPeaLpC5mkQHFQHPV+tbmJYNpOt+lEJb1lJzBTcNFfvRRtekiMNKZievsXgHjEXccqCyHVkl+fqPcoSQEZt8axJ2qVBh8E5E0lm3EUjc0KFR5CrysYGOhiZRz3+fhOzbQDeXbwuClSFMJthUoILTgw5KaHz8lTj/XdZWskGYM7Bri8oeTddVNs0bQfu67X0CqjPOX+NSbAb3A1tq0p4ofr0ud3DixtdsP2OnBKWOaHdc6pI+LjSTO5R/D0hCYhn/sTagRVUWTQyXtu4EDX0DpFmE8HgcQZTQ2MaU8yPHBknp0eSMBH3/aB1+adjvPK4AS8lnNmltp3/im0nA== 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=N4ukIsbuvs2aa4c+PZ1cJAPlFNjxZBJ9M7hSM45WPbE=; b=Ly+dNqTWdXnHZyzsUVmDNeodhdYMnjAybcuGMjE16pfYab6uN77imkrxzXhsh/wy+qQtkgS3TXxEdrkGVTh1Ny5DYzGZKx/taW6R8a1CSO3x1y4LuA/dEH3sZ80f60tmYk9EtL66Xx0S87IVDwLgiIB321+eU8+qZ+KcJyP7vaF7Qdnx+/5zu6mW58Dm6dEreEyqcOIfnTidHLQWzKSJpfmIrjWUg+bHZrgqYHhiMNfW2OUoSVRvIUjvyF9jzEHJwu8qoAJqhxvL514F06/V8JzrEPoq/+ijLDuZ3jdSE4fv/XJ97U1w6qbib+wx1TaT3gVlX7kpauKktirC7MH96w== 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 SJ0PR11MB5938.namprd11.prod.outlook.com (2603:10b6:a03:42d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Wed, 8 Feb 2023 09:03:07 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def%9]) with mapi id 15.20.6086.017; Wed, 8 Feb 2023 09:03:06 +0000 Date: Wed, 8 Feb 2023 09:03:00 +0000 From: Bruce Richardson To: Robin Jarry CC: , , Ciara Power , Keith Wiles Subject: Re: [PATCH] telemetry: reset data before passing it to callback Message-ID: References: <20230207184520.1238366-1-rjarry@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230207184520.1238366-1-rjarry@redhat.com> X-ClientProxiedBy: LO4P302CA0026.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c1::18) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ0PR11MB5938:EE_ X-MS-Office365-Filtering-Correlation-Id: 381c1a68-f177-4cd6-7b2a-08db09b34ae9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NSFr4tprJgB6OOLr5S2wKoycw/EKqPkayAU4wXXuC6PQ9JnFuUTOVT0e8L242gWygI0I4r95SNaLvsaXILt5YbqVIW27nt0TeD0Ie3VA+83lnUzllOf/7vc7NqVEJk8mPvQX/HH4mxda+5kX0gVugLcgbapO8EwmX03RHZT5lbXnn3Oh0rktnaK5zlYoZMkfIYBcxabIb5+QTK8LL6ll8NojsS8Yv5OIQ05yARAajrgSMUHvoQ/WvX8MdJctM8FW2l+f3isWhjf5Jgjk6lUn7LipcwDgZSLktfeU1MXEwHd+tkGBBGc+wRNT9hbvO3KqRZIdy+UQaZUrGXHZkSqI+MBvr+MLjDRzc1UJqApvAfjfdNP+HhoLPS1a5lvtNuFrvEFQ/Jx88QdUoRAyHrYRtbbFbeI6k1nNRhFW4X9OVSC7dcdTe5SVT0sXoSTiIE4sNnbLOLvG9f8zsEoRWcJZg0NSdmEEDl+wPL2KkSroYKIxeeUudgh4wAzBDMMDuxtO+OXLH8BMTS4u7ZKJtmPH8nnfy1jFpn3IjAnCrLAtYhiynK+WZa1qhL9lX4i8iYOn+FYAbcOUnPIf4s+sQr4YthQYcztLcITH7CNGMRATXK8DpuJbRZiAowQlIRKZaeaBqyInuOE+rjyvaY94PMrufXFmg5xG/o6S/kRhqT4kysXsrFHQ7XrjMYbjX4Yr8mu7RguikGh9TPxu1gqjbeyED8jPwAhbNMBntAsbv11siN0= 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:(13230025)(136003)(346002)(366004)(39860400002)(396003)(376002)(451199018)(44832011)(4744005)(5660300002)(2906002)(186003)(6512007)(26005)(6506007)(8936002)(6666004)(107886003)(66556008)(41300700001)(6486002)(478600001)(86362001)(966005)(82960400001)(38100700002)(54906003)(66946007)(4326008)(66476007)(316002)(6916009)(8676002)(67856001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mWtlti+WBdc9ezxE47kLLpqFWgBkthGQseWYdjZtNecdA3/eoJLNA0245zPZ?= =?us-ascii?Q?cT84fANP6blI5YjPso91qs1dK8JFhOYnPzX0p4ZYJiq410tn2jEZ1mqYkXnz?= =?us-ascii?Q?8r2iL95egMZdbjcPJOS9HC86Z9H+Y+n/lLTZGpZVmG5XiX+Ldw8pW6e8/IgO?= =?us-ascii?Q?fXLTpwCgYatDkDgMB8JUc6TWjtk5/34oWYQaQTm6xF/pPggKx0k0ekoYOOYr?= =?us-ascii?Q?GQB0MSKgcm6q1MYhtLF4KkosFdk6jZwaJKbcuRSnRx99L4Eu6/TZnLdAzX8t?= =?us-ascii?Q?rYqlbwMwT8WEgwVQ4lTWe+bZ5hXqZ69SR2LjxBps5avQNyWC9vfyETnlspKF?= =?us-ascii?Q?45B3THMXo//AjlEy4DjcseFXjHTbXC9pNsnLJqOEx7iu/Rmtp9njF6Ziyz2T?= =?us-ascii?Q?DlZV81/7V35f1g3LeqvB2YezATpE1rqHupeWyjIL+2cXRzcSoO6Eq8ImSoSJ?= =?us-ascii?Q?tZNdqKXEFOdEhVGTK1YOGMbKbJ83wTbl8ZSe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?2DfGqeFwkp2/JS4EM7p6OQ5q1YbI2rwXkoOgP38YeGO9wiiaB6OMoJYXOE//?= =?us-ascii?Q?ZPZTfJr/yNDTmqQYlJejS96toNViLuG1tOfQhXtvhbEQDDR7DhsVUe5zxqQ3?= =?us-ascii?Q?0y5eVyUy9QL50gx3sqlKISg47KvkOrNxQiJPuvZRk96qv9vG8jIBnatToiKO?= =?us-ascii?Q?HSOP+1FBU+6fihCIw2PYBdSBRHUiHr4fTwwmxln6XGKpjECY7Cpb029ur/JK?= =?us-ascii?Q?QQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 381c1a68-f177-4cd6-7b2a-08db09b34ae9 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 09:03:06.5387 (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: CtK1L/EB0fhB29TQPfy4gHajaSO9en+2+QL7OhSanb8gVwUTDS6S8x+8vNoJb4g9C5KbVy61GqMoZ8RJT4ui/x0AjSdiOwHP7lAf9Cn51RA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5938 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 Tue, Feb 07, 2023 at 07:45:20PM +0100, Robin Jarry wrote: > If a telemetry endpoint callback returns 0 without modifying the data > object, output_json() may be called with undefined contents in data. > This can cause crashes and/or worse (double free, etc.). > > Reset data before passing it to the endpoint callbacks. > > Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality") > Cc: stable@dpdk.org > > Signed-off-by: Robin Jarry > --- > lib/telemetry/telemetry.c | 2 ++ > 1 file changed, 2 insertions(+) > This is also fixed by patch http://patches.dpdk.org/project/dpdk/patch/20230120033456.29710-3-fengchengwen@huawei.com/ While both work the same way, I think I prefer the fix to set "= {0}" on init rather than explicit memset. /Bruce