linux-stable/drivers
Zhang Rui 1b0bc99cf3 hwmon: (coretemp) Fix potentially truncated sysfs attribute name
[ Upstream commit bbfff736d3 ]

When build with W=1 and "-Werror=format-truncation", below error is
observed in coretemp driver,

   drivers/hwmon/coretemp.c: In function 'create_core_data':
>> drivers/hwmon/coretemp.c:393:34: error: '%s' directive output may be truncated writing likely 5 or more bytes into a region of size between 3 and 13 [-Werror=format-truncation=]
     393 |                          "temp%d_%s", attr_no, suffixes[i]);
         |                                  ^~
   drivers/hwmon/coretemp.c:393:26: note: assuming directive output of 5 bytes
     393 |                          "temp%d_%s", attr_no, suffixes[i]);
         |                          ^~~~~~~~~~~
   drivers/hwmon/coretemp.c:392:17: note: 'snprintf' output 7 or more bytes (assuming 22) into a destination of size 19
     392 |                 snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH,
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     393 |                          "temp%d_%s", attr_no, suffixes[i]);
         |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors

Given that
1. '%d' could take 10 charactors,
2. '%s' could take 10 charactors ("crit_alarm"),
3. "temp", "_" and the NULL terminator take 6 charactors,
fix the problem by increasing CORETEMP_NAME_LENGTH to 28.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Fixes: 7108b80a54 ("hwmon/coretemp: Handle large core ID value")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310200443.iD3tUbbK-lkp@intel.com/
Link: https://lore.kernel.org/r/20231025122316.836400-1-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:08:18 +01:00
..
accessibility
acpi ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() 2023-11-20 11:08:16 +01:00
amba amba: bus: fix refcount leak 2023-09-19 12:22:47 +02:00
android binder: fix memory leak in binder_init() 2023-08-16 18:21:59 +02:00
ata ata: libata-eh: Fix compilation warning in ata_eh_link_report() 2023-10-25 11:59:00 +02:00
atm
auxdisplay
base regmap: debugfs: Fix a erroneous check after snprintf() 2023-11-20 11:08:16 +01:00
bcma
block rbd: take header_rwsem in rbd_dev_refresh() only when updating 2023-10-10 21:59:05 +02:00
bluetooth Bluetooth: btusb: add shutdown function for QCA6174 2023-10-25 11:59:00 +02:00
bus bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up 2023-10-06 13:18:13 +02:00
cdrom
char parisc: sba: Fix compile warning wrt list of SBA devices 2023-10-06 13:18:15 +02:00
clk clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM 2023-11-20 11:08:18 +01:00
clocksource clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe 2023-07-23 13:46:45 +02:00
comedi
connector
counter counter: microchip-tcb-capture: Fix the use of internal GCLK logic 2023-10-19 23:05:37 +02:00
cpufreq cpufreq: brcmstb-avs-cpufreq: Fix -Warray-bounds bug 2023-09-19 12:22:52 +02:00
cpuidle powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-19 12:22:42 +02:00
crypto crypto: stm32 - fix loop iterating through scatterlist for DMA 2023-09-19 12:22:52 +02:00
cxl
dax dax/kmem: Pass valid argument to memory_group_register_static 2023-07-23 13:47:17 +02:00
dca
devfreq PM / devfreq: rockchip-dfi: Make pmu regmap mandatory 2023-11-20 11:08:15 +01:00
dio
dma dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe 2023-11-08 17:26:45 +01:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:18:21 +02:00
edac EDAC/igen6: Fix the issue of no error events 2023-09-19 12:22:40 +02:00
eisa
extcon extcon: usbc-tusb320: Convert to i2c's .probe_new() 2023-07-23 13:47:31 +02:00
firewire firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-08-26 14:23:24 +02:00
firmware firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels() 2023-11-08 17:26:37 +01:00
fpga
fsi fsi: aspeed: Reset master errors after CFAM reset 2023-09-19 12:22:46 +02:00
gnss
gpio gpio: vf610: set value before the direction to avoid a glitch 2023-10-25 11:59:03 +02:00
gpu drm/amd: Disable ASPM for VI w/ all Intel systems 2023-11-08 17:26:49 +01:00
greybus
hid HID: multitouch: Add required quirk for Synaptics 0xcd7e device 2023-10-25 11:59:01 +02:00
hsi
hv
hwmon hwmon: (coretemp) Fix potentially truncated sysfs attribute name 2023-11-20 11:08:18 +01:00
hwspinlock
hwtracing coresight: tmc: Explicit type conversions to prevent integer overflow 2023-09-19 12:22:45 +02:00
i2c i2c: aspeed: Fix i2c bus hang in slave read 2023-11-08 17:26:41 +01:00
i3c i3c: master: svc: fix probe failure when no i3c device exist 2023-09-19 12:22:51 +02:00
idle
iio iio: afe: rescale: Accept only offset channels 2023-11-08 17:26:42 +01:00
infiniband RDMA/cxgb4: Check skb value for failure to allocate 2023-10-19 23:05:32 +02:00
input Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport 2023-11-08 17:26:45 +01:00
interconnect Fix up backport of 1361917030 ("interconnect: Teach lockdep about icc_bw_lock order") 2023-10-06 13:18:09 +02:00
iommu iommu/vt-d: Avoid memory allocation in iommu_suspend() 2023-10-19 23:05:32 +02:00
ipack
irqchip irqchip/stm32-exti: add missing DT IRQ flag translation 2023-11-08 17:26:45 +01:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:22:01 +02:00
leds leds: trigger: tty: Do not use LED_ON/OFF constants, use led_blink_set_oneshot instead 2023-09-19 12:22:49 +02:00
macintosh
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-07-23 13:47:28 +02:00
mcb mcb-lpc: Reallocate memory region to avoid memory overlapping 2023-11-08 17:26:35 +01:00
md dm zoned: free dmz->ddev array in dmz_put_zoned_devices 2023-10-10 21:59:08 +02:00
media media: mtk-jpeg: Fix use after free bug due to uncanceled work 2023-10-19 23:05:35 +02:00
memory memory: brcmstb_dpfe: fix testing array offset after use 2023-07-23 13:47:03 +02:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-07-23 13:46:52 +02:00
message
mfd mfd: pm8008: Fix module autoloading 2023-07-23 13:47:51 +02:00
misc misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support 2023-11-08 17:26:51 +01:00
mmc mmc: core: Capture correct oemid-bits for eMMC cards 2023-10-25 11:59:02 +02:00
most
mtd mtd: physmap-core: Restore map_rom fallback 2023-10-25 11:59:02 +02:00
mux
net ipvlan: properly track tx_errors 2023-11-20 11:08:16 +01:00
nfc nfcsim.c: Fix error checking for debugfs_create_dir 2023-06-28 10:29:51 +02:00
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-19 12:22:51 +02:00
nubus nubus: Partially revert proc_create_single_data() conversion 2023-07-05 18:25:05 +01:00
nvdimm
nvme nvme-rdma: do not try to stop unallocated queues 2023-10-25 11:59:02 +02:00
nvmem nvmem: imx: correct nregs for i.MX6UL 2023-11-08 17:26:41 +01:00
of of: overlay: Reorder struct fragment fields kerneldoc 2023-10-19 23:05:32 +02:00
opp OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-19 12:22:31 +02:00
parisc parisc: iosapic.c: Fix sparse warnings 2023-10-06 13:18:15 +02:00
parport
pci PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device 2023-11-08 17:26:49 +01:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-26 14:23:24 +02:00
perf perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7 2023-10-19 23:05:32 +02:00
phy phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins 2023-10-25 11:59:03 +02:00
pinctrl pinctrl: qcom: lpass-lpi: fix concurrent register updates 2023-11-08 17:26:35 +01:00
platform platform/x86: wmi: Fix opening of char device 2023-11-20 11:08:18 +01:00
pnp
power power: supply: ucs1002: fix error code in ucs1002_get_property() 2023-10-06 13:18:13 +02:00
powercap powercap: RAPL: Fix CONFIG_IOSF_MBI dependency 2023-07-23 13:46:46 +02:00
pps
ps3
ptp ptp: ocp: Fix error handling in ptp_ocp_device_init 2023-10-10 21:59:07 +02:00
pwm pwm: lpc32xx: Remove handling of PWM channels 2023-09-19 12:22:58 +02:00
rapidio
ras
regulator regulator/core: Revert "fix kobject release warning and memory leak in regulator_register()" 2023-10-25 11:59:00 +02:00
remoteproc
reset
rpmsg rpmsg: Fix possible refcount leak in rpmsg_register_device_override() 2023-11-08 17:26:44 +01:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-06 21:28:37 +01:00
s390 s390/cio: fix a memleak in css_alloc_subchannel 2023-10-25 11:59:03 +02:00
sbus
scsi scsi: mpt3sas: Fix in error path 2023-11-08 17:26:47 +01:00
sh
siox
slimbus
soc soc: imx8m: Enable OCOTP clock for imx8mm before reading registers 2023-10-06 13:18:14 +02:00
soundwire soundwire: fix enumeration completion 2023-08-11 15:14:00 +02:00
spi spi: nxp-fspi: use the correct ioremap function 2023-11-20 11:08:17 +01:00
spmi
ssb
staging media: dvb: symbol fixup for dvb_attach() 2023-09-19 12:22:51 +02:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-10-10 21:59:07 +02:00
tc
tee tee: amdtee: fix use-after-free vulnerability in amdtee_close_session 2023-10-19 23:05:37 +02:00
thermal thermal: core: prevent potential string overflow 2023-11-20 11:08:15 +01:00
thunderbolt thunderbolt: Check that lane 1 is in CL0 before enabling lane bonding 2023-10-19 23:05:36 +02:00
tty tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks 2023-11-08 17:26:51 +01:00
uio
usb usb: raw-gadget: properly handle interrupted requests 2023-11-08 17:26:50 +01:00
vdpa vduse: Use proper spinlock for IRQ injection 2023-08-26 14:23:30 +02:00
vfio vfio/type1: fix cap_migration information leak 2023-09-19 12:22:41 +02:00
vhost vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE 2023-11-08 17:26:36 +01:00
video fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() 2023-11-08 17:26:47 +01:00
virt
virtio virtio-mmio: fix memory leak of vm_dev 2023-11-08 17:26:36 +01:00
visorbus
vlynq
vme
w1 w1: fix loop in w1_fini() 2023-07-23 13:47:20 +02:00
watchdog watchdog: iTCO_wdt: Set NO_REBOOT if the watchdog is not already running 2023-10-06 13:18:20 +02:00
xen xen/events: replace evtchn_rwlock with RCU 2023-10-10 21:59:09 +02:00
zorro
Kconfig
Makefile