diff options
author | David Wang <00107082@163.com> | 2024-11-20 13:30:55 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-22 15:31:35 +0100 |
commit | acfeb6defcb9310b1ff44db1e633798ba766337d (patch) | |
tree | aae532b7933945de4d4d8b045e75627fa5876234 /drivers/gpio/gpio-aspeed-sgpio.c | |
parent | e7240bd91f96f925a3bb8d2b9348fcb1db457b10 (diff) | |
download | linux-acfeb6defcb9310b1ff44db1e633798ba766337d.tar.gz linux-acfeb6defcb9310b1ff44db1e633798ba766337d.tar.bz2 linux-acfeb6defcb9310b1ff44db1e633798ba766337d.zip |
Fix a potential abuse of seq_printf() format string in drivers
Using device name as format string of seq_printf() is proned to
"Format string attack", opens possibility for exploitation.
Seq_puts() is safer and more efficient.
Signed-off-by: David Wang <00107082@163.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20241120053055.225195-1-00107082@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpio/gpio-aspeed-sgpio.c')
-rw-r--r-- | drivers/gpio/gpio-aspeed-sgpio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-aspeed-sgpio.c b/drivers/gpio/gpio-aspeed-sgpio.c index 72755fee6478..34eb26298e32 100644 --- a/drivers/gpio/gpio-aspeed-sgpio.c +++ b/drivers/gpio/gpio-aspeed-sgpio.c @@ -420,7 +420,7 @@ static void aspeed_sgpio_irq_print_chip(struct irq_data *d, struct seq_file *p) int offset; irqd_to_aspeed_sgpio_data(d, &gpio, &bank, &bit, &offset); - seq_printf(p, dev_name(gpio->dev)); + seq_puts(p, dev_name(gpio->dev)); } static const struct irq_chip aspeed_sgpio_irq_chip = { |