Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1301436

Re: [PATCH] PM / OPP: Use snprintf() instead of sprintf()

From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [PATCH] PM / OPP: Use snprintf() instead of sprintf()
Date 2016-01-05 12:00 +0100
Message-ID <qNxvm-Wb-49@gated-at.bofh.it> (permalink)
References <qNxlD-Sz-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jan 5, 2016 at 11:45 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> sprintf() can access memory outside of the range of the character array,
> and is risky in some situations. The driver specified prop_name string
> can be longer than NAME_MAX here (only an attacker will do that though)
> and so blindly copying it into the character array of size NAME_MAX
> isn't safe. Instead we must use snprintf() here.

Thanks!

> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] PM / OPP: Use snprintf() instead of sprintf() Viresh Kumar <viresh.kumar@linaro.org> - 2016-01-05 11:50 +0100
  Re: [PATCH] PM / OPP: Use snprintf() instead of sprintf() Geert Uytterhoeven <geert@linux-m68k.org> - 2016-01-05 12:00 +0100
  Re: [PATCH] PM / OPP: Use snprintf() instead of sprintf() Stephen Boyd <sboyd@codeaurora.org> - 2016-01-05 21:00 +0100
  Re: [PATCH] PM / OPP: Use snprintf() instead of sprintf() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-01-08 01:20 +0100

csiph-web