android_kernel_xiaomi_sm8450/drivers/parport
Takashi Iwai 1826b6d69b parport: Proper fix for array out-of-bounds access
commit 02ac3a9ef3a18b58d8f3ea2b6e46de657bf6c4f9 upstream.

The recent fix for array out-of-bounds accesses replaced sprintf()
calls blindly with snprintf().  However, since snprintf() returns the
would-be-printed size, not the actually output size, the length
calculation can still go over the given limit.

Use scnprintf() instead of snprintf(), which returns the actually
output letters, for addressing the potential out-of-bounds access
properly.

Fixes: ab11dac93d2d ("dev/parport: fix the array out-of-bounds risk")
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240920103318.19271-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-22 15:39:28 +02:00
..
BUGS-parport
daisy.c parport: daisy: Convert DPRINTK to pr_debug 2020-04-23 17:05:38 +02:00
ieee1284_ops.c parport: remove non-zero check on count 2021-09-18 13:40:34 +02:00
ieee1284.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile parport: Add missing newline at end of file 2019-08-05 17:56:45 +02:00
multiface.h
parport_amiga.c parport_amiga: Convert DPRINTK to pr_debug 2020-04-23 17:05:38 +02:00
parport_atari.c parport: Convert printk(KERN_<LEVEL> to pr_<level>( 2020-04-23 17:05:37 +02:00
parport_ax88796.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
parport_cs.c parport: Convert printk(KERN_<LEVEL> to pr_<level>( 2020-04-23 17:05:37 +02:00
parport_gsc.c parport: Standardize use of printmode 2020-04-23 17:05:39 +02:00
parport_gsc.h parport: Use more comon logging styles 2020-04-23 17:05:37 +02:00
parport_ip32.c parport: Use more comon logging styles 2020-04-23 17:05:37 +02:00
parport_mfc3.c parport_mfc3: Convert DPRINTK to pr_debug 2020-04-23 17:05:38 +02:00
parport_pc.c parport: Add support for Brainboxes IX/UC/PX parallel cards 2023-12-13 18:27:04 +01:00
parport_serial.c parport: parport_serial: Add Brainboxes device IDs and geometry 2024-01-25 14:37:39 -08:00
parport_sunbpp.c parport: Convert printk(KERN_<LEVEL> to pr_<level>( 2020-04-23 17:05:37 +02:00
probe.c parport: Use more comon logging styles 2020-04-23 17:05:37 +02:00
procfs.c parport: Proper fix for array out-of-bounds access 2024-10-22 15:39:28 +02:00
share.c parport: remove use of devmodel 2020-04-23 17:05:40 +02:00
TODO-parport