lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211114124309.799dc917@rorschach.local.home>
Date:   Sun, 14 Nov 2021 12:43:09 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Daniel Bristot de Oliveira <bristot@...nel.org>,
        Kalesh Singh <kaleshsingh@...gle.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [GIT PULL] tracing: Three small fixes for 5.16

On Sat, 13 Nov 2021 10:26:29 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:

> On Sat, Nov 13, 2021 at 5:35 AM Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> >  - Copy just actual size of histogram strings  
> 
> I have pulled this, but I think it's wrong. Or at least it looks
> _very_ suspicious.
> 
> > -                       strscpy(str, val_str, STR_VAR_LEN_MAX);
> > +                       strscpy(str, val_str, val->size);  
> 
> So now it doesn't overrun the source string any more, but I don't see
> what protects it from not overrunning the destination - which is
> indeed STR_VAR_LEN_MAX.
> 
> Maybe 'val->size' is guaranteed to be sufficiently limited, but that
> sure as hell isn't obvious at least lkocally.

Ideally this should be checked on the time the histogram is created.
But looking into it, the size could be determined by the size of a
string of an event field. Now in practice, no event field should be
bigger than 256 bytes, but nothing prevents it from happening.

I'll add logic here to include:

	size = min(val->size, STR_VAR_LEN_MAX);

and use that instead.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ