linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hwmon: Error handling in w83793.c, w83791d.c, w83792d.c
@ 2021-08-11 16:15 Nadezda Lutovinova
  2021-08-11 16:15 ` [PATCH] hwmon: Correct the error " Nadezda Lutovinova
  2021-08-11 17:51 ` hwmon: Error handling in w83793.c, w83791d.c, w83792d.c Guenter Roeck
  0 siblings, 2 replies; 11+ messages in thread
From: Nadezda Lutovinova @ 2021-08-11 16:15 UTC (permalink / raw)
  To: Marc Hulsman
  Cc: Nadezda Lutovinova, Jean Delvare, Guenter Roeck, Rudolf Marek,
	linux-hwmon, linux-kernel, ldv-project

In w83793_detect_subclients(): if driver read tmp value sufficient for 
(tmp & 0x08) && (!(tmp & 0x80)) && ((tmp & 0x7) == ((tmp >> 4) & 0x7))
from device then Null pointer dereference occurs.
(It is possible if tmp = 0b0xyz1xyz, where same chars mean same numbers).

It can be fixed just by adding a checking for null pointer, patch for 
this is in the next letter. But a question arised:
The array w83793_data->lm75 is used once in this function after switching 
to devm_i2c_new_dummy_device() instead of i2c_new_dummy(). And this 
function is called once (from w83793_probe()). Maybe this array should be 
deleted from struct w83793_data?

The same situation in w83791d.c and in w83792d.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Nadezda Lutovinova <lutovinova@ispras.ru>

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

end of thread, other threads:[~2021-10-02 12:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 16:15 hwmon: Error handling in w83793.c, w83791d.c, w83792d.c Nadezda Lutovinova
2021-08-11 16:15 ` [PATCH] hwmon: Correct the error " Nadezda Lutovinova
2021-08-11 18:18   ` Guenter Roeck
2021-09-21 15:51     ` [PATCH v2 1/3] hwmon: (w83791d) Fix NULL pointer dereference by removing unnecessary structure field Nadezda Lutovinova
2021-10-02 12:07       ` Guenter Roeck
2021-09-21 15:51     ` [PATCH v2 2/3] hwmon: (w83792d) " Nadezda Lutovinova
2021-10-02 12:12       ` Guenter Roeck
2021-09-21 15:51     ` [PATCH v2 3/3] hwmon: (w83793) " Nadezda Lutovinova
2021-10-02 12:15       ` Guenter Roeck
2021-08-11 17:51 ` hwmon: Error handling in w83793.c, w83791d.c, w83792d.c Guenter Roeck
2021-08-11 18:19   ` Guenter Roeck

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).