mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Possible oversight in setvbuf()
Date: Fri, 13 Jul 2018 18:06:06 -0400	[thread overview]
Message-ID: <20180713220606.GE1392@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAF4BF-QbMJZYp_Zd0FtCCBq8opXOBEBRnAGxDY4BvemjOHG5GQ@mail.gmail.com>

On Fri, Jul 13, 2018 at 05:46:54PM -0400, Christopher Friedt wrote:
> On Fri, Jul 13, 2018, 5:31 PM Rich Felker, <dalias@libc.org> wrote:
> 
> > One thing this highlights is that we could really use better testing
> > and security review process. I'll write and
> >
> 
> Using some static analysis tool would be good too - not sure if that's in
> use already.

We have in the past, and they caught a small number of real issues
along with a lot of false positives. Stuff like this is hard for
static analysis to test without also having knowledge of the relevant
interface contract(s).

> A good process for adding new features is to add tests with them. Even if
> there is only a test for expected behaviour, at least it will catch one
> possible regression.

Yes, I should really do that more. Sometimes it's not obvious what
should be tested though. In the case of setvbuf, the intended behavior
is in some sense untestable (the previous implementation not using the
caller-provided buffer was valid); in hindsight the obvious important
thing to test is that it doesn't result in writes outside the buffer.

Rich


  reply	other threads:[~2018-07-13 22:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 14:40 Markus Wichmann
2018-07-13 21:31 ` Rich Felker
2018-07-13 21:46   ` Christopher Friedt
2018-07-13 22:06     ` Rich Felker [this message]
2018-07-13 22:19       ` Christopher Friedt
2018-07-14  2:03         ` Rich Felker
2018-07-14  2:05 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180713220606.GE1392@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).