public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Prashanth K <quic_prashk@quicinc.com>
To: 胡连勤 <hulianqin@vivo.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"mwalle@kernel.org" <mwalle@kernel.org>,
	"quic_jjohnson@quicinc.com" <quic_jjohnson@quicinc.com>,
	"David Brownell" <dbrownell@users.sourceforge.net>
Cc: "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 v3] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null
Date: Thu, 26 Dec 2024 10:29:59 +0530	[thread overview]
Message-ID: <a39cee8d-bf79-4fa3-96fd-e414af8c9f74@quicinc.com> (raw)
In-Reply-To: <TYUPR06MB6217705570D07BCEE6D7F771D20C2@TYUPR06MB6217.apcprd06.prod.outlook.com>



On 25-12-24 12:33 pm, 胡连勤 wrote:
> Hello  Prashanth K:
> 
>>> 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.
>>
>> gs_read_complete() gets port from ep->driver_data, and it shouldn't get
>> affected if gser->ioport is null as long as port[port_num].port is valid. Am I
>> missing something here?
> 
> This description is not very appropriate, thank you very much for your suggestion, I will modify it.

Seems like this patch has already accepted applied to Gregs tree. So I
think its fine for now, just update new description here.

> 
>>>
>>> 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
>>>
> 
> Thanks

Regards,
Prashanth K

  reply	other threads:[~2024-12-26  5:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17  7:58 [PATCH v3] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null 胡连勤
2024-12-24  4:53 ` Prashanth K
2024-12-25  7:03   ` 答复: " 胡连勤
2024-12-26  4:59     ` Prashanth K [this message]
2025-01-16 13:11 ` Jon Hunter
2025-01-16 13:28   ` gregkh
2025-01-16 15:01     ` Jon Hunter
2025-01-17  5:04       ` 答复: " 胡连勤
2025-01-17  8:24         ` gregkh
2025-01-17  9:48         ` Jon Hunter
2025-01-21 12:19       ` Jon Hunter
2025-01-23 14:56         ` Dan Carpenter
2025-02-05  6:38           ` 答复: " 胡连勤
2025-02-05 19:29             ` Pelle Windestam
2025-02-06  2:36               ` 答复: " 胡连勤
2025-02-06  4:24               ` Prashanth K
2025-02-06  7:47                 ` Pelle Windestam
  -- strict thread matches above, loose matches on Subject: below --
2024-12-26  6:21 胡连勤

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=a39cee8d-bf79-4fa3-96fd-e414af8c9f74@quicinc.com \
    --to=quic_prashk@quicinc.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --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 \
    /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