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 6B30DA00C5; Tue, 15 Feb 2022 20:11:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7AA4410F3; Tue, 15 Feb 2022 20:11:34 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 4547F40041 for ; Tue, 15 Feb 2022 20:11:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644952293; x=1676488293; h=message-id:date:subject:from:to:cc:references: in-reply-to:content-transfer-encoding:mime-version; bh=7ZBYQCniBoY3ow5vjUDOIgUj4YpaE3KoYQzKP00vbvc=; b=UmXJYDuQcKPyLupidYDiqwFAUR+54vBbj52ChwgEJhrEft1Qp45Dl7tS 0yfaoB8k5pslzwVYWKfQd1tDU5sOmCoS2KZczV2AguVhcXKx3NEXwITvN 3XaxONV0YzzoWpSx/GHcvlGFx+G6dhrhNF9W14fdGRb3+X5eiwSIHtGa+ IqVwOhrxYhcPlEPdReVPfjjVm5bE8PHauI0q/a8U4Hy7u4kdWOULh6VD/ dn+OQoW2ghnVnTUjgRyvoJhKELq1lC2zZQUjwpVzAuf7CCamp1wjCi+7d Ew49Ivf8UgnQPcukhAE45ifC1xqlKEIB70Bc3ImPrjb2I9DQSvDj8qRtZ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="250378206" X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="250378206" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 11:11:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="775977041" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 15 Feb 2022 11:11:20 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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.2308.20; Tue, 15 Feb 2022 11:11:20 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 15 Feb 2022 11:11:20 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.174) 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.2308.20; Tue, 15 Feb 2022 11:11:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a3kIoH/+XBuLF+88ERwMPjdyplW5+i1RTfQizgnufX0yb9rFDPJ8to8BcWhRHo72+zlF4ooxWRkOUzxD+ALGiqDax//99ikwP1W4IwZRBrD2DvxvzHcjJJJNmsMv7OW56UIJBP7rDkr1thy0HrY/0WElguvNmBOXHFjBw85RAvgDiHtmOm95BC3KiJIc9aTXgyfPtbNa/8g3cMb+JEpAQJL/l24RpR0xlzH8rUwQtmqXuCfSf1DjcrKdI1FkCSMxsh4L5z2BcDlCdiUfuSUP4Q6sRuxgaN1fzvNZyPWMrYVHcKuNv3/dcLRrZKqGLLblp4y84k9joaXOZ9ZtXHp7tQ== 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=c5opmJco4GDUZyJ8DD7XJMfAtEzUzUfd7534LBLz6aw=; b=kesUN0M/Ci81ga9JgOhx50gPWQ9c0dwBHdSilnMUR2OZdl1wdVQK/Q4bgvGpljr861/EG+C8lVUtZF8Y4OL8GVHOmX2W8H6NEx9AThdlv8FVjV5GkPUiyMyG5AtcvNsGqOchyXN0lDMgOGBYaDECwpTHALnhkQ7iGI5jp0V8DHNKqgz43P9rzV7iglwEJr6adWsbvwLFIdGuIaYQgpdz5+egNZj9L1iI0PD0QL2+ZP7bnSPA98eicI9nn+IoJolmfOIY0L3Zw2UGBKOpAQ1U6lrlLZXTKVhylZ9HcwEqWuHl6pbxauZcOz75ADjhKwsm+1wMYAYBXYhTftrqoKlPog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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 DM6PR11MB2554.namprd11.prod.outlook.com (2603:10b6:5:c8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15; Tue, 15 Feb 2022 19:11:18 +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.4975.019; Tue, 15 Feb 2022 19:11:18 +0000 Message-ID: <48145833-dde0-2e7f-798f-2fbbe2b179bc@intel.com> Date: Tue, 15 Feb 2022 19:11:11 +0000 Subject: Re: [PATCH v2] kni: fix use-after-free when kni release Content-Language: en-US From: Ferruh Yigit To: "Min Hu (Connor)" , CC: References: <20220128024336.26961-1-humin29@huawei.com> <20220209073525.22900-1-humin29@huawei.com> X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0353.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::16) 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: 00f11d7d-50ff-4a78-a77b-08d9f0b6f152 X-MS-TrafficTypeDiagnostic: DM6PR11MB2554:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QwvOvF4pwoAoCPxXES3Vz0YIh4pM++Ki6Ye3WK2AenE5V/BS9WSvLlucT1QKFYcQm4TW9eP5heIAcCz4F4y76mw5MVdlf13RoGp1yfGtx7PR1a7yKppgODpXwQQKoyBToR2n76/ctBkacqySiidIEYnBZmknkpCuwHu6Oh8E4Gy29nqvGE/Yiyub6gvxt10Dqz98dtJ003g7TKQgqAYmrvKuQ6jruCY0vpFS33ueHEh7Q/vtSRXXmbJ7B0pG9yiPbsK/5DfnatNO2DCWh8uuSIuS80wxwLqguXHEUI0ddEg24GcZZxZWFgV1w+MueAx/CNRVI2PEqKU7gvDCHfQWPrtV1cuwEDusep/LILnJVgm/iLuy8Nwa/E+nh639bXVL4f5Yg+/vOeTg+1MXR5iPwrPDtZf7r5wsOgtj8OmVtgjQ5ANRkQhD6XbK3L0dU9TIPw7yYUt8slDuItEzbOFAbaxWQElpPoCUc/oo0CTjw7WfPS6Tm58X91CZpJHDa96tPp/BUbJbYrl0jM9yIZl1dBgofA+FGpFI2gxTO2ie8UixAPz0mfAXtdainFM9QC7nOxO6j8jylkWCXeFa14ODpHJZHR+LfUcVzf/aAXClzXf9w5cOu9zSNaYe+l8hgDu5bPb6OPqPYEMqZdRWDKVxO+RL3JNaytsjr6gwdRFf+ixrf8S0JYRE+l+psgtK+zcE8eIlHF5d8tMXLmkvj3wC8w== 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)(8676002)(66476007)(66556008)(66946007)(83380400001)(2616005)(53546011)(6666004)(86362001)(6506007)(31696002)(4326008)(6486002)(508600001)(26005)(316002)(6512007)(44832011)(186003)(38100700002)(31686004)(4744005)(5660300002)(8936002)(2906002)(36756003)(82960400001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T2hVSDVwSjdsNDE5dk5NTFE4LzZvQWJCOEZ5dWxrbG9qRkc2VzY2S0hSZUFQ?= =?utf-8?B?MDltdVhsVUJJclA1ZVgrYldYajBWQWY3bW1EWFQ5TjFRRDZFL2F6RGRERnZt?= =?utf-8?B?blVwN3hicG4wbUFsZDBObDFZM0dmbU9YQkV2UzdUc0VVQlcrN3JxSFN2TUpP?= =?utf-8?B?S043eXFFYnF4T2dXWFpSemlmaUk1dHpSWEpEbEFkb1RvK015L1FrWjZZNUlr?= =?utf-8?B?SEhXVzUwR1N6d2ptTGFBaHZsL3Y3bWhFeGhaR3VPamhNc2dUcVl5WWlSVi8y?= =?utf-8?B?Z29mdC92MWI0NDd0N014aE9kdFVoMTNWM3oyZ1pwb0hPUktINGc4TUpRckNX?= =?utf-8?B?OFpCRVI2U0E0emZvTjgxYU0zejJLN2NNOFBpVWhKTUN1NXpzZ2poeWt0NXFH?= =?utf-8?B?Q2hPMXZPTU1UMGxTZnZscitXK3B4VDBLMFFQWnJiVEovdWZPTHhPZUgvbXZG?= =?utf-8?B?M2RVSHVjdkp1VDZCd0Rxc1MzSDdza2JKcThzcFBiNm9yaHZESWpMd0krcTBR?= =?utf-8?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QjNrOERrbkZJ?= =?utf-8?B?S1BkNWVRN0lmSWFKMGRJMGV1SlpOeDk5clRpTHBOV3JhbnJ1UVlUa3JySkxG?= =?utf-8?B?MjVpcEg3T3FyTmw1Nm5VekRYendIalQvRmJ3UzJLend3Q0VOZ0x1MjdPR2V6?= =?utf-8?B?LzE1Z1JyVWtzcWk2RkJ4ZDlJQWxDMkJxZklUTEwvNDNPd0RoN3dIdUJlN0Z3?= =?utf-8?B?SmxublA5VHNHL1psVXBPQy9wd2l5ZUlCYWVpYVpWSlVrTnVQNGZ3U0swQW9V?= =?utf-8?B?RWkwODFjQUVPWnZLRks1bFJGSWVTbHcxWURWMmFqYnBIREg2a1JPK3g1Y0xm?= =?utf-8?B?cHhxVGEvRjArbUR1bzNMd29oQVdlNGN4QmV4cE0zV3htWkFBVjRoNjVSZVl6?= =?utf-8?B?TGxBYVdTRUUxS1VZSXhITU1vMTlYampHb3NybXVJQ0hwbUpaM2dwUk14TFBp?= =?utf-8?B?dEtZU0EvUWwxcCt2V25XcDBCQmoybXB1b1JYc2hwYUQ4MGg2N3dsd2NlWnRp?= =?utf-8?B?MXJxQlc5QmxXWGNrUWNjKzNVc1pmRm1NeWttMld2TTR1UEdibk9PUmxTZ3pt?= =?utf-8?B?ZUZhZCtWd1RHS2FxZlA2SFAzRGN2NGFUZXFKSXg4YUQrZnhGbHJuc01lejdU?= =?utf-8?B?Qk1xWW9EWU5KY3ZDQWs2YUk1Yy9LZWRrbVlselU4d0JLekdRU2lTVlZtekFh?= =?utf-8?B?M2FlTDFCbDlNOUhMRSsyMThOL1p1bXJtSEI4VGNldGJsK3ZUemJxZWY1YVZZ?= =?utf-8?Q?evd9nlkUIJyMimD1lZPMgfQ=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 00f11d7d-50ff-4a78-a77b-08d9f0b6f152 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 19:11:17.9480 (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: OmgZvpU25YI+JgSe8tXm8YellZ09LeXLkt30nRDCB4mGYOe0lxeVRZ80FfqGK/FfCMxWyogdHKrScWNoNQg84A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2554 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 2/14/2022 6:41 PM, Ferruh Yigit wrote: > On 2/9/2022 7:35 AM, Min Hu (Connor) wrote: >> From: Huisong Li >> >> The "kni_dev" is the private data of the "net_device" in kni, and allocated >> with the "net_device" by calling "alloc_netdev()". The "net_device" is >> freed by calling "free_netdev()" when kni release. The freed memory >> includes the "kni_dev". So After "kni_dev" should not be accessed after >> "net_device" is released. >> > > The problem description looks valid and change looks good to me, > > only list_del after remove is like this for years, I wonder how > it is not caught until now, or if we are missing something, I > want to test some before ack, which I will do in next few days. Acked-by: Ferruh Yigit