From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413AbdAQJct (ORCPT ); Tue, 17 Jan 2017 04:32:49 -0500 Received: from mga02.intel.com ([134.134.136.20]:8280 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbdAQJcd (ORCPT ); Tue, 17 Jan 2017 04:32:33 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,243,1477983600"; d="asc'?scan'208";a="54801765" From: Felipe Balbi To: Greg KH Cc: Jim Lin , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: gadget: configfs: Fix KASAN use-after-free In-Reply-To: <20170117092151.GB2879@kroah.com> References: <1484640082-28193-1-git-send-email-jilin@nvidia.com> <8760leun1v.fsf@linux.intel.com> <20170117092151.GB2879@kroah.com> Date: Tue, 17 Jan 2017 11:29:36 +0200 Message-ID: <87bmv6kpa7.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Greg KH writes: > On Tue, Jan 17, 2017 at 10:07:40AM +0200, Felipe Balbi wrote: >>=20 >> Hi, >>=20 >> Jim Lin writes: >> > When gadget is disconnected, running sequence is like this. >> > . android_work: sent uevent USB_STATE=3DDISCONNECTED >>=20 >> I'm gonna have to ask you to try with actual mainline where there are no >> Android changes. > > What is android changing these days in the gadget stack that is not > already upstream? quite a bit, actually. They have their own android_setup() and an android_worker thread for notifications. These notifications actually duplicate (poorly) what we already have for usb_gadget_set_state(). They also completely ditch composite_setup() to reimplement it with their own additions. There's also an android class added to configfs. Android-specific uevents. Android-specific ->disconnect() implementation, overwriting what we have on composite.c. I just took a diff from v4.4.10 to current Android head which we're using for some other project drivers/usb/gadget/Kconfig | 50 +++++ drivers/usb/gadget/composite.c | 6 + drivers/usb/gadget/configfs.c | 264 ++++++++++++++++++++++= +- drivers/usb/gadget/function/Makefile | 8 + drivers/usb/gadget/function/f_accessory.c | 1335 ++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++ drivers/usb/gadget/function/f_audio_source.c | 1060 ++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/gadget/function/f_fs.c | 11 +- drivers/usb/gadget/function/f_midi.c | 66 ++++++ drivers/usb/gadget/function/f_mtp.c | 1533 ++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++ drivers/usb/gadget/function/f_mtp.h | 18 ++ drivers/usb/gadget/function/f_ptp.c | 38 ++++ drivers/usb/gadget/function/f_rndis.c | 30 +++ drivers/usb/gadget/function/rndis.c | 112 ++++++++-- drivers/usb/gadget/function/rndis.h | 2 + drivers/usb/gadget/function/u_ether.c | 305 ++++++++++++++++++++++= ------ drivers/usb/gadget/function/u_ether.h | 3 + drivers/usb/gadget/functions.c | 2 +- 17 files changed, 4757 insertions(+), 86 deletions(-) rather extensive. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlh95AAACgkQzL64meEa mQZ+SQ//d/ufDGMyWD8ZULQ1aQ3PG8G0Yt76A7n0A6hAantcKThFEudCtkvyCvWQ ul3+cSMPtpOTclTW/WKbY7uh/S1DZiKSpGrHge06T+WwAyCOUyAwt7B+zluw1X3X GTbZriUxH2RUnmW9I/Qu6FnwduEgJCewCAf5bPWqUs/1e07lWNBxRk8hmMKrAflq 1HLJPjGpNLtjCIEazJXziHda/M3mXFjJi73fagrOj+H00HI7g2Q80larHTBr3VgI 9tyZRWReBrAlBdyhEWke8FDPEIlan6wtbDITjRqrQehOGnzT5biOP380HrHwRXUZ 3lRz5ZudtHH0kxtWq+Bi4SKDlrHsNy7DkB6ZTk+LH+O6DSJ62wGqhDPCtLRfgTzj QuaAzL/yK3czemAYvelRSmEWpn3wx1+o0k4mkT9BSgs3s1+40f3ZB3ImG0B7+Cgk F47+UUXUIIUr3s4kIEsoiNGt6A18mirU2GmeYNDcp9+QYQsEFRF7ZS+W4bEbJHyT BealW8DT/eMlGeOXmgX6LpwrkoWibCFH4yP8UXn0BogUrJOHEABk3P1ZIzhw7Jr4 7UkZkpZS39x2Msz5xl4E5FP/g0IapPkPyYgo95qAzJCiX0Cdi3Pg6d1ZwGCLaYLS GFyajfXTRX6n2CPiEpsRewDXS4G1GMMQIfW9lMjrLPDb826kOTo= =+/m/ -----END PGP SIGNATURE----- --=-=-=--