Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3579577ybx; Fri, 8 Nov 2019 23:50:24 -0800 (PST) X-Google-Smtp-Source: APXvYqz2VHnbnBsC8uxqsVPuHfmP4M3DtbT3mFaA/knJc51cqddV296ueiXEWtDO5TfulHs771c/ X-Received: by 2002:a17:906:1c59:: with SMTP id l25mr12651624ejg.98.1573285823920; Fri, 08 Nov 2019 23:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573285823; cv=none; d=google.com; s=arc-20160816; b=Wm4Z4yXKhKZ162la7SY2o0OTtorpjITIeaaFUlD1iX0krEdAE5myzp3GHQO9lmruph h25WezIFKvI9zl1B7djIc45o8smeD4kAKQokJHxl1GEmgZK3qEe9chjzXeJTA4m/Fimd vunrDTX9JXZVXhcQWEq8cTq52i5oEuPJuQXvtxybKPaku6+/PUo00RbuISVrHGdxdPhn 0JL+bkEKIpcGezsfYS8E2uwiQEWUvetdJ2asVrpoLzQoWdQaNmDSJqbTYI18XyYiTmJM 6L2CaxZZgEAXm6jZoPIXsw2jO0LcZospmN/rk9KGG1Y5+OAWk45Chh8Mi6cFZxBHte95 YcmA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Nopz6p/0eVwA5MBkjexhZJgREL2RCccF+GgtiqK2rVo=; b=SUBV7HsIWM+lOs1l0rVaIyLAS+o7QD4K+Lllc7jGxAI/orWQ7GukP4iYQI48dX9HUf rRO9E6GBU3B48GcZkiA7yvBkvzB4KocMEdTotGE8xgog0idh8wWAPqMMFTM4ZiVCn6ca AvwP45O3WXv/f2dM/boHkOW6VrQ11TgF1Ga1xlW+ihjqWR8sk7KSmlnOuEbKyjOD309K MyxEusX3bRk0jFoOyskFZLnOcZVHR2Nbu+MLicQVyrnft7eqxLCUYo93pXf2xlRbDjaI Hbh4W1+Ygl7kJImzTIpapxdjaeO7Kl4fpvRSo8VN3kdx65dnJBOiOKAd8v/5otnIetWa QQxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fpMTxbz3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x50si6708139eda.155.2019.11.08.23.49.58; Fri, 08 Nov 2019 23:50:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fpMTxbz3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbfKIHt0 (ORCPT + 99 others); Sat, 9 Nov 2019 02:49:26 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43425 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbfKIHt0 (ORCPT ); Sat, 9 Nov 2019 02:49:26 -0500 Received: by mail-qk1-f193.google.com with SMTP id z23so7107360qkj.10; Fri, 08 Nov 2019 23:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Nopz6p/0eVwA5MBkjexhZJgREL2RCccF+GgtiqK2rVo=; b=fpMTxbz30dxR3eF4dparSCcLENWoeCgTlIuKzTPKueSzdbn5iiCY7/v3Wfhw1TOjpP OSVsGlvAtsWpRkLr2JQBpiiVhNvi2OH4UuYc6ctM+4aIOgIXUC+x2+/v+sKEsgz3OAQ9 35Tuyh2NSIwEVhNBQxZ8gfnfm3G3yNFU9sSc478UDmeoU6YmoewMuM0owirN3sDXQaEA FJ1Zju2FXnruaMcYmtkX2TVxFbs5p/NfPwVGZ9TdkivKB+mv0NLLiL03HVNlB7wLHBla yThKt4f/iohKEBzeLv0BWAKHWUNcDAA302DHnHfby0ddZZJGmKnrjH1omhe7QvEC17F2 UpsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Nopz6p/0eVwA5MBkjexhZJgREL2RCccF+GgtiqK2rVo=; b=n6S55kgNKZKu2ElktFhXn/7YD50DCqus7WgfQ9idvvYzmZ1JZUkQSOvLAZJASj88Xb MSEdB/QbPN2rZTCo2/B41ScXaGuhjYAW54e5eEjLNxdHdlu+zhayAPI2A+7HTFC0p81Z 1BmY+AVHlSqTiNWhzUY5WftmHqHeF2e5Oc4/Us65Mikfr6x3/R0o5GiDUgW+p1irm+Io PLHIEFhr+DmHhvIP+Ac9G8agbnkj1OocNuhjJ0aeqfyV/lkmy947VDycUBBaNQZM3uhh UgGxry+ZgUY9xEORgGyyda0ZmNuvKJYL6Owg//4Hbkkkk6JQGTuOB0djq476UDefQcW9 ysnA== X-Gm-Message-State: APjAAAVsh3f+kTcDaHyPEjDLQWp9gMeKlwVhGiDlPScLWK+S8fx3y6WP iobzS6TkUJ1djIujnR+qvW7bbSXUFiQsCWmCy70= X-Received: by 2002:a05:620a:532:: with SMTP id h18mr967425qkh.41.1573285763677; Fri, 08 Nov 2019 23:49:23 -0800 (PST) MIME-Version: 1.0 References: <1572749044-6091-1-git-send-email-yanghui.def@gmail.com> <20191103124201.GB619218@kroah.com> In-Reply-To: <20191103124201.GB619218@kroah.com> From: hui yang Date: Sat, 9 Nov 2019 15:49:13 +0800 Message-ID: Subject: Re: [PATCH 2/2] USB(u_serial.c): it has a NULL point To: Greg KH Cc: balbi@kernel.org, mirq-linux@rere.qmqm.pl, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm sorry for my fault . Now I send to everyone . When we use USB to transmit data with PC, the phone will crashed Low probability . We found port->port.tty became NULL. Thanks Greg KH =E4=BA=8E2019=E5=B9=B411=E6=9C=883=E6= =97=A5=E5=91=A8=E6=97=A5 =E4=B8=8B=E5=8D=888:42=E5=86=99=E9=81=93=EF=BC=9A > > On Sun, Nov 03, 2019 at 10:44:04AM +0800, hui yang wrote: > > From: YangHui > > > > Unable to handle kernel NULL pointer dereference at virtual address 000= 002a0 > > Kernel BUG at tty_wakeup+0x18/0x8c > > [<0000000095135e9d>] tty_wakeup+0x18/0x8c > > [<00000000c35f19e4>] gs_start_io+0xc8/0x158 > > [<00000000b11b184e>] gserial_connect+0xd0/0x174 > > [<00000000642201de>] acm_set_alt+0x70/0x180 > > [<00000000a9d38e8b>] composite_setup+0x1848/0x1a7c > > [<0000000072c88781>] android_setup+0x1ec/0x1f4 > > [<000000004c0127a5>] msm_udc_irq+0x8d0/0xc0c > > [<00000000f8bb9acf>] __handle_irq_event_percpu+0x74/0x294 > > [<00000000afd57256>] handle_irq_event+0x60/0xc8 > > [<0000000076719b24>] handle_fasteoi_irq+0xc8/0x1c4 > > [<00000000421f3d87>] generic_handle_irq+0x34/0x4c > > [<00000000b2f2d343>] __handle_domain_irq+0x6c/0xbc > > [<00000000c74325e8>] gic_handle_irq+0x6c/0xe0 > > yes,we can see the port->port.tty=3D=3DNULL, so system crashed > > > > Signed-off-by: YangHui > > --- > > drivers/usb/gadget/function/u_serial.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadge= t/function/u_serial.c > > index 65f634e..a1c2ac2 100644 > > --- a/drivers/usb/gadget/function/u_serial.c > > +++ b/drivers/usb/gadget/function/u_serial.c > > @@ -562,6 +562,8 @@ static int gs_start_io(struct gs_port *port) > > > > /* unblock any pending writes into our circular buffer */ > > if (started) { > > + if (port->port.tty =3D=3D NULL) > > + return -EIO; > > How can this happen? Shouldn't this be handled earlier? > > If not, can you document this how this can be true and what should be > done about it? > > thanks, > > greg k-h