Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bsr: avoid format string leaking into device name

This makes sure a format string cannot accidentally leak into a device name.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kees Cook and committed by
Greg Kroah-Hartman
4171ee9e 7b883446

+1 -1
+1 -1
drivers/char/bsr.c
··· 259 259 } 260 260 261 261 cur->bsr_device = device_create(bsr_class, NULL, cur->bsr_dev, 262 - cur, cur->bsr_name); 262 + cur, "%s", cur->bsr_name); 263 263 if (IS_ERR(cur->bsr_device)) { 264 264 printk(KERN_ERR "device_create failed for %s\n", 265 265 cur->bsr_name);