Thread (11 messages) flat view 11 messages, 5 authors, 2021-08-05

Re: [PATCH] net: pegasus: fix uninit-value in get_interrupt_interval

From: Pavel Skripkin <hidden>
Date: 2021-08-01 19:35:24
Also in: linux-usb, lkml

On Sun, 1 Aug 2021 15:36:27 +0300
Petko Manolov [off-list ref] wrote:
On 21-07-31 00:44:11, Pavel Skripkin wrote:
quoted
Syzbot reported uninit value pegasus_probe(). The problem was in
missing error handling.

get_interrupt_interval() internally calls read_eprom_word() which
can fail in some cases. For example: failed to receive usb control
message. These cases should be handled to prevent uninit value bug,
since read_eprom_word() will not initialize passed stack variable
in case of internal failure.
Well, this is most definitelly a bug.

ACK!


		Petko
Thank you, Petko!


BTW: I found a lot uses of {get,set}_registers without error
checking. I think, some of them could be fixed easily (like in
enable_eprom_write), but, I guess, disable_eprom_write is not so easy.
For example, if we cannot disable eprom should we retry? If not, will
device get in some unexpected state?

Im not familiar with this device, but I can prepare a patch to wrap all
these calls with proper error checking



With regards,
Pavel Skripkin

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help