linux_dsm_epyc7002/drivers/hwmon/occ
Gustavo A. R. Silva b0407d820b hwmon: (occ) Fix potential integer overflow
Cast get_unaligned_be32(...) to u64 in order to give the compiler
complete information about the proper arithmetic to use and avoid
a potential integer overflow.

Notice that such function call is used in contexts that expect
expressions of type u64 (64 bits, unsigned); and the following
expressions are currently being evaluated using 32-bit
arithmetic:

val = get_unaligned_be32(&power->update_tag) *
                        occ->powr_sample_time_us;

val = get_unaligned_be32(&power->vdn.update_tag) *
                        occ->powr_sample_time_us;

Addresses-Coverity-ID: 1442357 ("Unintentional integer overflow")
Addresses-Coverity-ID: 1442476 ("Unintentional integer overflow")
Addresses-Coverity-ID: 1442508 ("Unintentional integer overflow")
Fixes: ff692d80b2e2 ("hwmon (occ): Add sensor types and versions")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-01-07 21:03:59 -08:00
..
common.c hwmon: (occ) Fix potential integer overflow 2019-01-07 21:03:59 -08:00
common.h hwmon (occ): Add sysfs attributes for additional OCC data 2018-12-16 15:13:10 -08:00
Kconfig hwmon: Add On-Chip Controller (OCC) hwmon driver 2018-12-16 15:13:05 -08:00
Makefile hwmon (occ): Add sysfs attributes for additional OCC data 2018-12-16 15:13:10 -08:00
p8_i2c.c hwmon (occ): Add sysfs attributes for additional OCC data 2018-12-16 15:13:10 -08:00
p9_sbe.c hwmon (occ): Add sysfs attributes for additional OCC data 2018-12-16 15:13:10 -08:00
sysfs.c hwmon (occ): Add sysfs attributes for additional OCC data 2018-12-16 15:13:10 -08:00