From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: 胡连勤 <hulianqin@vivo.com>
Cc: Prashanth K <quic_prashk@quicinc.com>,
"mwalle@kernel.org" <mwalle@kernel.org>,
"quic_jjohnson@quicinc.com" <quic_jjohnson@quicinc.com>,
"dbrownell@users.sourceforge.net"
<dbrownell@users.sourceforge.net>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"opensource.kernel" <opensource.kernel@vivo.com>
Subject: Re: [PATCH v2] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null
Date: Mon, 16 Dec 2024 13:34:28 +0100 [thread overview]
Message-ID: <2024121649-balancing-appliance-80f0@gregkh> (raw)
In-Reply-To: <TYUPR06MB6217DAA095A9863D4B58D57CD23B2@TYUPR06MB6217.apcprd06.prod.outlook.com>
On Mon, Dec 16, 2024 at 12:31:45PM +0000, 胡连勤 wrote:
> From: Lianqin Hu <hulianqin@vivo.com>
>
> Considering that in some extreme cases, when performing the
> unbinding operation, gserial_disconnect has cleared gser->ioport,
> which triggers gadget reconfiguration, and then calls gs_read_complete,
> resulting in access to a null pointer. Therefore, ep is disabled before
> gserial_disconnect sets port to null to prevent this from happening.
>
> Call trace:
> gs_read_complete+0x58/0x240
> usb_gadget_giveback_request+0x40/0x160
> dwc3_remove_requests+0x170/0x484
> dwc3_ep0_out_start+0xb0/0x1d4
> __dwc3_gadget_start+0x25c/0x720
> kretprobe_trampoline.cfi_jt+0x0/0x8
> kretprobe_trampoline.cfi_jt+0x0/0x8
> udc_bind_to_driver+0x1d8/0x300
> usb_gadget_probe_driver+0xa8/0x1dc
> gadget_dev_desc_UDC_store+0x13c/0x188
> configfs_write_iter+0x160/0x1f4
> vfs_write+0x2d0/0x40c
> ksys_write+0x7c/0xf0
> __arm64_sys_write+0x20/0x30
> invoke_syscall+0x60/0x150
> el0_svc_common+0x8c/0xf8
> do_el0_svc+0x28/0xa0
> el0_svc+0x24/0x84
>
> Fixes: c1dca562be8a ("usb gadget: split out serial core")
> Cc: stable@vger.kernel.org
>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
>
> v2:
> - Remove some address information from patch descriptions
> - Link to v1: https://lore.kernel.org/all/TYUPR06MB621763AB815989161F4033AFD2762@TYUPR06MB6217.apcprd06.prod.outlook.com/
> - Link to suggestions: https://lore.kernel.org/all/TYUPR06MB6217DE28012FFEC5E808DD64D2962@TYUPR06MB6217.apcprd06.prod.outlook.com/
The "v2:" needs to go below the --- line, what happened to that?
And no need to have a blank line after the cc: stable, right? Did you
run checkpatch.pl on this?
thanks,
greg k-h
next prev parent reply other threads:[~2024-12-16 12:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 12:31 [PATCH v2] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null 胡连勤
2024-12-16 12:34 ` gregkh [this message]
2024-12-16 13:40 ` 答复: " 胡连勤
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024121649-balancing-appliance-80f0@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=dbrownell@users.sourceforge.net \
--cc=hulianqin@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mwalle@kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=quic_jjohnson@quicinc.com \
--cc=quic_prashk@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox