Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1016143ybg; Wed, 10 Jun 2020 21:28:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1rNscSfuW8+uXVbw7JZpGSpzCaEyYQlLbeH/00dGSV/DC2T2RY6WldMuEnzZvWrCCf2/e X-Received: by 2002:a50:b0a1:: with SMTP id j30mr5387281edd.387.1591849687629; Wed, 10 Jun 2020 21:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591849687; cv=none; d=google.com; s=arc-20160816; b=Y2HHm04YdeDFaY/GJsOFnlgBY3hRuxF/PN332Z5Wzs2fXiM0eclO3AW21Uv0ZvIoET lwpritI70f0Vwtc0emjNihftQ7t0pIF1fHhvF4mP+Ok6QeUYXzpNNUdo+oGIHrPmT8he 9pAY9d/Uw5gAgJTkeCaJarv2lZquvP7vZRAkm7LnaEMMnaOllWFs+7IQMAGClV03VYEF dwww7NCO+2fNAltCuL3gVNmxAtqYbVkxovoCnH7iFlVmi1zcTibEWnEloTDZW+b7XFRo 72Hd5ydgiUr3GtdeFs+juEEZngW/BjRM9S5okL856HvkqewI/lbfhhEsngZfV1CVsMjn 1H6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:to:reply-to:from:subject:message-id :dkim-signature; bh=9koF6CFHB5bfjnigNtEtT8Nwa33piiOWJpOgL6Qy/xA=; b=dZkVmKUKen7cpWigmadgAl54pJnVNo1xgrcqJYJHNzMoEIHpF4lxQyope2y6IsCkdp gNaEEZAp5Wr2ZTgM3KSDz+ctxCFYpweQHW65yO5vc+Hm0CG+BvoXK5heDWgnKUA00pyx Ga57MsLwXyvfQLupbqYRwDXWbj/FI5nzDXkyaNe0tNzRqvy0A2nOLFIRTMVvCGEOabOZ cP5fQGe2w+kH4TbLgV3aKvwJvyZQma90EkmgbZUkPJ8kZC+1YNWECH7FhcWO8Njs7dZv ud5KzvyrjCNp7gUTVTdQS8Xu7hOTPpn6tk1uup6Pc4e+t0lCZDCsbf/uq1Oys2bBm4Fw AO0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=RirTj+SX; 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 q17si1169582edb.42.2020.06.10.21.27.28; Wed, 10 Jun 2020 21:28:07 -0700 (PDT) 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=RirTj+SX; 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 S1726312AbgFKEYo (ORCPT + 99 others); Thu, 11 Jun 2020 00:24:44 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:52342 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725799AbgFKEYo (ORCPT ); Thu, 11 Jun 2020 00:24:44 -0400 X-UUID: f9f3ecb57a2445499a99fad18d155855-20200611 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:To:Reply-To:From:Subject:Message-ID; bh=9koF6CFHB5bfjnigNtEtT8Nwa33piiOWJpOgL6Qy/xA=; b=RirTj+SX0+dmOUHbYB0UrEwtkYCD38agrkHM97AwevMKSACLmVyP9tbN8G4P+YKOKLtAgsUGBdB7Sh4LGHarl69o0AImhOxTM9A51t6dfHEhUEICf2bzxgkTbUgd0VQv7DzuIJS3l8QmQahQx8E+tpZr49xPpDH49WLgr1+igR8=; X-UUID: f9f3ecb57a2445499a99fad18d155855-20200611 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 268571297; Thu, 11 Jun 2020 12:24:38 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 11 Jun 2020 12:24:36 +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 Jun 2020 12:24:35 +0800 Message-ID: <1591849476.15994.18.camel@mtkswgap22> Subject: Re: [PATCH v2] usb: gadget: configfs: Fix KASAN use-after-free From: Macpaul Lin Reply-To: <1484645392-29819-1-git-send-email-jilin@nvidia.com> To: Macpaul Lin , Jim Lin , "Felipe Balbi" , , , Greg KH , "Steve Beattie" , Kees Cook , Steve Beattie , Siqi Lin Date: Thu, 11 Jun 2020 12:24:36 +0800 In-Reply-To: References: <1484645392-29819-1-git-send-email-jilin@nvidia.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: 90582FA388D51A6F2BD0EF1B90F2F16B2872F2141A6CFDD258B7A1A1A65D698F2000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gVGh1LCAyMDE3LTA5LTAxIGF0IDEwOjI1OjMyIC0wNzAwLCBLZWVzIENvb2sgd3JvdGU6DQo+ IFN1YmplY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