mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Prashanth K <quic_prashk@quicinc.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Xiu Jianfeng <xiujianfeng@huawei.com>,
	Pratham Pratap <quic_ppratap@quicinc.com>,
	Jack Pham <quic_jackp@quicinc.com>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5] usb: gadget: u_serial: Add null pointer check in gserial_resume
Date: Fri, 5 May 2023 14:51:31 +0530	[thread overview]
Message-ID: <0f33ea7f-d0a4-bc39-1d26-02518fa460a4@quicinc.com> (raw)
In-Reply-To: <Y+p6TUBtikbmnTGe@rowland.harvard.edu>



On 13-02-23 11:28 pm, Alan Stern wrote:
> On Mon, Feb 13, 2023 at 11:00:38PM +0530, Prashanth K wrote:
>> Consider a case where gserial_disconnect has already cleared
>> gser->ioport. And if a wakeup interrupt triggers afterwards,
>> gserial_resume gets called, which will lead to accessing of
>> gser->ioport and thus causing null pointer dereference.Add
>> a null pointer check to prevent this.
>>
>> Added a static spinlock to prevent gser->ioport from becoming
>> null after the newly added check.
>>
>> Fixes: aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks")
>> Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
>> ---
>> v5: Updated the comment in new patch
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> 
> I'm not very familiar with the u_serial function.  Is it possible for
> gserial_disconnect to cause a similar problem in gserial_suspend?
> 
> Alan Stern
> 
Hi Alen,

You were right, we have similar issue in suspend path also. I have 
pushed a patch for the same.

Regards,
Prashanth K

      reply	other threads:[~2023-05-05  9:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 17:30 Prashanth K
2023-02-13 17:58 ` Alan Stern
2023-05-05  9:21   ` Prashanth K [this message]

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=0f33ea7f-d0a4-bc39-1d26-02518fa460a4@quicinc.com \
    --to=quic_prashk@quicinc.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_ppratap@quicinc.com \
    --cc=stern@rowland.harvard.edu \
    --cc=xiujianfeng@huawei.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

all inboxes | Powered by JetHome®