public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* Unitialized Variable and Null Pointer Dereference bug in gb_bootrom_get_firmware
@ 2022-06-21 14:36 Dongliang Mu
  2022-06-21 14:40 ` Johan Hovold
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dongliang Mu @ 2022-06-21 14:36 UTC (permalink / raw)
  To: vireshk, Johan Hovold, elder, Greg KH
  Cc: greybus-dev, linux-staging, linux-kernel

Hi maintainers,

I would like to send one bug report.

In gb_bootrom_get_firmware, if the first branch is satisfied, it will
go to queue_work, leading to the dereference of uninitialized const
variable "fw". If the second branch is satisfied, it will go to unlock
with fw as NULL pointer, leading to a NULL Pointer Dereference.

The Fixes commit should be [1], introducing the dereference of "fw" in
the error handling code.

I am not sure how to fix this bug. Any comment on removing the
dereference of fw?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a4293e1d4e6416477976ee3bd248589d3fc4bb19

--
My best regards to you.

     No System Is Safe!
     Dongliang Mu

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-22  2:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-21 14:36 Unitialized Variable and Null Pointer Dereference bug in gb_bootrom_get_firmware Dongliang Mu
2022-06-21 14:40 ` Johan Hovold
2022-06-22  2:19   ` Viresh Kumar
2022-06-21 14:48 ` Greg KH
2022-06-21 14:55 ` Dan Carpenter
2022-06-21 23:21   ` Dongliang Mu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox