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


Groups > linux.kernel > #1234553

Re: [PATCH 2/4] lib/vsprintf.c: also improve sanity check in bstr_printf()

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] lib/vsprintf.c: also improve sanity check in bstr_printf()
Date 2015-09-29 00:40 +0200
Message-ID <qdPfr-4Ba-9@gated-at.bofh.it> (permalink)
References <qcFia-8p1-11@gated-at.bofh.it> <qcFia-8p1-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Sep 25, 2015 at 10:41 AM, Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
> Quoting from 2aa2f9e21e4e ("lib/vsprintf.c: improve sanity check in
> vsnprintf()"):
>
>     On 64 bit, size may very well be huge even if bit 31 happens to be 0.
>     Somehow it doesn't feel right that one can pass a 5 GiB buffer but not a
>     3 GiB one.  So cap at INT_MAX as was probably the intention all along.
>     This is also the made-up value passed by sprintf and vsprintf.
>
> I should have seen this copy-pasted instance back then, but let's just
> do it now.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

-- 
Kees Cook
Chrome OS Security
--
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 | Find similar | Unroll thread


Thread

[PATCH 2/4] lib/vsprintf.c: also improve sanity check in bstr_printf() Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-09-25 19:50 +0200
  Re: [PATCH 2/4] lib/vsprintf.c: also improve sanity check in bstr_printf() Kees Cook <keescook@chromium.org> - 2015-09-29 00:40 +0200

csiph-web