linux-stable/drivers
Christophe JAILLET f6a14247f9 ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias()
[ Upstream commit 48cf49d319 ]

snprintf() does not return negative values on error.

To know if the buffer was too small, the returned value needs to be
compared with the length of the passed buffer. If it is greater or
equal, the output has been truncated, so add checks for the truncation
to create_pnp_modalias() and create_of_modalias(). Also make them
return -ENOMEM in that case, as they already do that elsewhere.

Moreover, the remaining size of the buffer used by snprintf() needs to
be updated after the first write to avoid out-of-bounds access as
already done correctly in create_pnp_modalias(), but not in
create_of_modalias(), so change the latter accordingly.

Fixes: 8765c5ba19 ("ACPI / scan: Rework modalias creation when "compatible" is present")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[ rjw: Merge two patches into one, combine changelogs, add subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 10:29:17 +01:00
..
accessibility
acpi ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() 2023-11-20 10:29:17 +01:00
amba amba: bus: fix refcount leak 2023-09-23 10:48:09 +02:00
android binder: fix memory leak in binder_init() 2023-08-16 18:13:00 +02:00
ata ata: ahci: fix enum constants for gcc-13 2023-11-08 11:22:21 +01:00
atm treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
auxdisplay
base driver: platform: Add helper for safer setting of driver_override 2023-11-08 11:22:18 +01:00
bcma
block remove the sx8 block driver 2023-11-08 11:22:21 +01:00
bluetooth Bluetooth: vhci: Fix race when opening vhci device 2023-10-25 11:16:40 +02:00
bus bus: imx-weim: fix branch condition evaluates to a garbage value 2023-04-05 11:15:38 +02:00
cdrom
char parisc: sba: Fix compile warning wrt list of SBA devices 2023-10-10 21:44:58 +02:00
clk clk: tegra: fix error return case for recalc_rate 2023-10-10 21:44:58 +02:00
clocksource clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe 2023-08-11 11:45:02 +02:00
connector
cpufreq cpufreq: brcmstb-avs-cpufreq: Fix -Warray-bounds bug 2023-09-23 10:48:11 +02:00
cpuidle sched,idle,rcu: Push rcu_idle deeper into the idle path 2023-10-25 11:16:26 +02:00
crypto chtls: fix tp->rcv_tstamp initialization 2023-11-20 10:29:17 +01:00
dax
dca
devfreq PM / devfreq: Fix leak in devfreq_dev_release() 2023-09-23 10:48:10 +02:00
dio
dma dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe 2023-11-08 11:22:20 +01:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:31:56 +02:00
edac EDAC/skx: Fix overflows on the DRAM row address mapping arrays 2023-05-17 11:13:09 +02:00
eisa
extcon extcon: Fix kernel doc of property capability fields to avoid warnings 2023-08-11 11:45:12 +02:00
firewire treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
firmware firmware: arm_sdei: Fix sleep from invalid context BUG 2023-05-30 12:42:08 +01:00
fmc
fpga fpga: bridge: fix kernel-doc parameter description 2023-05-17 11:13:15 +02:00
fsi fsi: master-ast-cf: Add MODULE_FIRMWARE macro 2023-09-23 10:47:57 +02:00
gnss
gpio gpio: vf610: set value before the direction to avoid a glitch 2023-10-25 11:17:02 +02:00
gpu drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() 2023-11-08 11:22:17 +01:00
hid HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event 2023-10-25 11:16:55 +02:00
hsi
hv Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs 2023-06-28 10:15:28 +02:00
hwmon hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled 2023-08-11 11:45:34 +02:00
hwspinlock
hwtracing coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet() 2023-05-30 12:42:15 +01:00
i2c i2c: stm32f7: Fix PEC handling in case of SMBUS transfers 2023-11-08 11:22:16 +01:00
ide treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
idle
iio iio: exynos-adc: request second interupt only when touchscreen mode is used 2023-11-08 11:22:17 +01:00
infiniband RDMA/cxgb4: Check skb value for failure to allocate 2023-10-25 11:16:19 +02:00
input Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport 2023-11-08 11:22:20 +01:00
iommu
ipack
irqchip irqchip/stm32-exti: add missing DT IRQ flag translation 2023-11-08 11:22:19 +01:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:13:00 +02:00
leds
lightnvm
macintosh macintosh: via-pmu-led: requires ATA to be set 2023-05-17 11:13:18 +02:00
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-08-11 11:45:13 +02:00
mcb mcb-lpc: Reallocate memory region to avoid memory overlapping 2023-11-08 11:22:15 +01:00
md md/raid1: fix error: ISO C90 forbids mixed declarations 2023-09-23 10:48:17 +02:00
media media: dvb: symbol fixup for dvb_attach() - again 2023-10-10 21:45:00 +02:00
memory
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-08-11 11:45:06 +02:00
message scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-05-30 12:42:09 +01:00
mfd mfd: stmpe: Only disable the regulators if they are enabled 2023-08-11 11:45:13 +02:00
misc misc: pci_endpoint_test: Re-init completion for every test 2023-08-11 11:45:21 +02:00
mmc mmc: core: sdio: hold retuning if sdio in 1-bit mode 2023-11-08 11:22:14 +01:00
mtd mtd: spinand: micron: correct bitmask for ecc status 2023-10-25 11:17:00 +02:00
mux
net can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() 2023-11-20 10:29:17 +01:00
nfc nfcsim.c: Fix error checking for debugfs_create_dir 2023-06-28 10:15:31 +02:00
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-23 10:48:10 +02:00
nubus
nvdimm
nvme nvme-pci: do not set the NUMA node of device if it has none 2023-10-10 21:44:59 +02:00
nvmem nvmem: imx: correct nregs for i.MX6UL 2023-11-08 11:22:16 +01:00
of of: unittest: Fix overlay type in apply/revert check 2023-09-23 10:48:04 +02:00
opp
oprofile
parisc parisc: iosapic.c: Fix sparse warnings 2023-10-10 21:44:58 +02:00
parport
pci PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device 2023-11-08 11:22:21 +01:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-30 16:31:43 +02:00
perf
phy phy: mapphone-mdm6600: Fix runtime PM for remove 2023-10-25 11:17:02 +02:00
pinctrl Revert "pinctrl: avoid unsafe code pattern in find_pinctrl()" 2023-10-25 11:17:01 +02:00
platform platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e 2023-11-08 11:22:20 +01:00
pnp
power power: supply: Fix logic checking if system is running from battery 2023-06-21 15:39:56 +02:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-11 16:31:36 +01:00
pps
ps3
ptp
pwm pwm: lpc32xx: Remove handling of PWM channels 2023-09-23 10:48:13 +02:00
rapidio
ras
regulator regulator: Fix error checking for debugfs_create_dir 2023-06-21 15:39:56 +02:00
remoteproc
reset
rpmsg rpmsg: Fix possible refcount leak in rpmsg_register_device_override() 2023-11-08 11:22:19 +01:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-23 10:47:56 +02:00
s390 scsi: zfcp: Fix a double put in zfcp_port_enqueue() 2023-10-10 21:45:00 +02:00
sbus
scsi scsi: mpt3sas: Fix in error path 2023-11-08 11:22:20 +01:00
sfi
sh
siox
slimbus
sn
soc soc: qcom: qmi_encdec: Restrict string length in decode 2023-09-23 10:48:12 +02:00
soundwire
spi spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() 2023-09-23 10:48:00 +02:00
spmi spmi: Add a check for remove callback when removing a SPMI driver 2023-05-17 11:13:17 +02:00
ssb treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
staging erofs: ensure that the post-EOF tails are all zeroed 2023-09-23 10:47:56 +02:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-10-10 21:45:01 +02:00
tc
tee
thermal thermal: core: prevent potential string overflow 2023-11-20 10:29:17 +01:00
thunderbolt thunderbolt: Use const qualifier for ring_interrupt_index 2023-04-05 11:15:35 +02:00
tty tty: 8250: Add support for Intashield IS-100 2023-11-08 11:22:21 +01:00
uio
usb usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility 2023-11-08 11:22:21 +01:00
uwb
vfio
vhost treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
video fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() 2023-11-08 11:22:20 +01:00
virt
virtio virtio-mmio: fix memory leak of vm_dev 2023-11-08 11:22:15 +01:00
visorbus
vlynq
vme
w1 w1: fix loop in w1_fini() 2023-08-11 11:45:11 +02:00
watchdog watchdog: iTCO_wdt: Set NO_REBOOT if the watchdog is not already running 2023-10-10 21:44:59 +02:00
xen xen/events: replace evtchn_rwlock with RCU 2023-10-10 21:45:02 +02:00
zorro
Kconfig
Makefile