From: "Kumar, M Chetan" <m.chetan.kumar@linux.intel.com>
To: Simon Horman <simon.horman@corigine.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net,
johannes@sipsolutions.net, ryazanov.s.a@gmail.com,
loic.poulain@linaro.org, linuxwwan@intel.com,
m.chetan.kumar@intel.com, edumazet@google.com, pabeni@redhat.com,
Samuel Wein PhD <sam@samwein.com>
Subject: Re: [PATCH net] net: wwan: iosm: fix NULL pointer dereference when removing device
Date: Mon, 15 May 2023 12:06:05 +0530 [thread overview]
Message-ID: <c99dca8e-1628-b3ef-3ca1-09a4e10e6981@linux.intel.com> (raw)
In-Reply-To: <ZF5x3OK2+Rm2njd6@corigine.com>
On 5/12/2023 10:35 PM, Simon Horman wrote:
> On Thu, May 11, 2023 at 03:34:44PM +0530, m.chetan.kumar@linux.intel.com wrote:
>> From: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
>>
>> In suspend and resume cycle, the removal and rescan of device ends
>> up in NULL pointer dereference.
>>
>> During driver initialization, if the ipc_imem_wwan_channel_init()
>> fails to get the valid device capabilities it returns an error and
>> further no resource (wwan struct) will be allocated. Now in this
>> situation if driver removal procedure is initiated it would result
>> in NULL pointer exception since unallocated wwan struct is dereferenced
>> inside ipc_wwan_deinit().
>>
>> ipc_imem_run_state_worker() to handle the called functions return value
>> and to release the resource in failure case. It also reports the link
>> down event in failure cases. The user space application can handle this
>> event to do a device reset for restoring the device communication.
>>
>> Fixes: 3670970dd8c6 ("net: iosm: shared memory IPC interface")
>> Reported-by: Samuel Wein PhD <sam@samwein.com>
>> Closes: https://lore.kernel.org/netdev/20230427140819.1310f4bd@kernel.org/T/
>> Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
>
<skip>
> err_out:
> ipc_mux_deinit(ipc_imem->mux);
> ipc_uevent_send(ipc_imem->dev, UEVENT_CD_READY_LINK_DOWN);
>
>> }
Thank you for reviewing the patch and sharing the feedback.
I will post the v2 with the above suggested changes.
prev parent reply other threads:[~2023-05-15 6:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 10:04 [PATCH net] net: wwan: iosm: fix NULL pointer dereference when removing device m.chetan.kumar
2023-05-12 17:05 ` Simon Horman
2023-05-15 6:36 ` Kumar, M Chetan [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=c99dca8e-1628-b3ef-3ca1-09a4e10e6981@linux.intel.com \
--to=m.chetan.kumar@linux.intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linuxwwan@intel.com \
--cc=loic.poulain@linaro.org \
--cc=m.chetan.kumar@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
--cc=sam@samwein.com \
--cc=simon.horman@corigine.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;
as well as URLs for NNTP newsgroup(s).