ARM: 8503/1: clk_register_clkdev: remove format string interface
authorKees Cook <keescook@chromium.org>
Tue, 26 Jan 2016 00:21:26 +0000 (01:21 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 16 Feb 2016 16:34:18 +0000 (16:34 +0000)
commit416dd13ad620a14fbabe5d73584b12e07ce8d02e
treefb0833d4e38e932c5617ed5dd13db75a1fac593b
parenta34c66357e1328fef6388ef6e10ce67275f5f5fe
ARM: 8503/1: clk_register_clkdev: remove format string interface

Many callers either use NULL or const strings for the third argument of
clk_register_clkdev. For those that do not and use a non-const string,
this is a risk for format strings being accidentally processed (for
example in device names). As this interface is already used as if it
weren't a format string (prints nothing when NULL), and there are zero
users of the format strings, remove the format string interface to make
sure format strings will not leak into the clkdev.

$ git grep '\bclk_register_clkdev\b' | grep % | wc -l
0

Unfortunately, all the internals expect a va_list even though they treat
a NULL format string as special. To deal with this, we must pass either
(..., "%s", string) or (..., NULL) so that a the va_list will be created
correctly (passing the name as an argument, not as a format string).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/clk/clkdev.c
include/linux/clkdev.h
This page took 0.024849 seconds and 5 git commands to generate.