Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp119603pxf; Wed, 10 Mar 2021 22:55:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJydeQrJRrp2V7PHIm/9ddLkqOuOKbe1wshe3LDUFDnfRemUdWYh+XIqfIyTEcDaUckD/IgP X-Received: by 2002:a17:906:6c4:: with SMTP id v4mr1590466ejb.198.1615445750293; Wed, 10 Mar 2021 22:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615445750; cv=none; d=google.com; s=arc-20160816; b=PY3URLQF2IO0tM8X5kzuqleiyIuRdwJg7vA0m4Kj9Mgu9IihhKtAb7Av0dYXisHZ0m J2e5J0fL6qezk7q2Oga/xZ3tf/sceLBCyjSEYaE4OrDhLmcXz4flTgqQaUjaMBvxSPLT 5CVfKrsTEGvzd5vlF7UHXIzLVDIW1gyAtnSU+wBWdAe9IYr+I7iQzDgOmmCC1LA7loqm RX8RRFLjJbCvJGWwlvMiIRPr7e++y57KjpDxzQJkd3YZ5QdAo7n91Jy9jePyI24/qERV vgxKTNaE5G+gVPy/cqmOa1EpdMsVdx05VUI/iqYLL/V8QHmGdsA5yueFyOgjDLhui3IU p0Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=HXvdSSzvJwcQp7ImGoV9GE6S8/ULPWjlIYaMv49d5ww=; b=wVs0z/UEYuaVwcCbTBD/B0ftTf9lWWO522AyriY/In/Ti3ZniYy/9SQ99G4uH2DL6+ zm95nabcYsJ8jUIgeG3udtWj70oMMmK2thTAW16090kesiKy5vvXYDTnVJQ16oVHNzrk IcdmFVSEQdXwSte9JdW9Akej+pwRCRB++E8Z6wVoneXjYyNMEl+Wh8GzhtXW5gkTGZwh tvTyAWqvuDJYNXJv2XSwH1G53LH9Dqj109otubJQqV6Phtdm0LVs5ATSe5k/ls1QhAmp 9IUZgxbfxjNj1HLp4ZlAOT9pyktBeBdKTvyJ/BG27wwogXoJK3sMoMNAphUtkRSZdvwa flPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=mwWehAuu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si1177997ejv.110.2021.03.10.22.55.27; Wed, 10 Mar 2021 22:55:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=mwWehAuu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbhCKGyN (ORCPT + 99 others); Thu, 11 Mar 2021 01:54:13 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:51427 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230435AbhCKGyB (ORCPT ); Thu, 11 Mar 2021 01:54:01 -0500 X-UUID: 18f687241c5745ffae71f379279041dc-20210311 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=HXvdSSzvJwcQp7ImGoV9GE6S8/ULPWjlIYaMv49d5ww=; b=mwWehAuu50llSWl9rhY4UGPEw/phO7v9eV+XYfWvje1f1tZN84LEkMxc8L0ERbvUaPy5YksIfNhIjdyxWXio4EwKj8XrYWXrGPqCXaUxcmFOfVQMchHrEFxelb+OXRjTp7NZhKGM9TMteO3kWcs7pmDCCkpu86uRsAnNoLt5fDg=; X-UUID: 18f687241c5745ffae71f379279041dc-20210311 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 734091626; Thu, 11 Mar 2021 14:53:55 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 11 Mar 2021 14:53:52 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 11 Mar 2021 14:53:52 +0800 Message-ID: <1615445632.13420.2.camel@mtkswgap22> Subject: Re: [PATCH v4] usb: gadget: configfs: Fix KASAN use-after-free From: Macpaul Lin To: Jim Lin , Thadeu Lima de Souza Cascardo CC: Thadeu Lima de Souza Cascardo , Felipe Balbi , Greg Kroah-Hartman , Matthias Brugger , , , , , Ainge Hsu , Eddie Hung , Kuohong Wang , Mediatek WSD Upstream , Macpaul Lin , Date: Thu, 11 Mar 2021 14:53:52 +0800 In-Reply-To: <1615444961-13376-1-git-send-email-macpaul.lin@mediatek.com> References: <1484647168-30135-1-git-send-email-jilin@nvidia.com> <1615444961-13376-1-git-send-email-macpaul.lin@mediatek.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: 1AFDD4A18497C1AB79C36991DF15FA0620D45CD5E2DE115D246BC0D32C71F9902000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org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