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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Sep 2020 15:07:35 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Michael Ellerman <mpe@...erman.id.au>
Cc:     linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        jcmvbkbc@...il.com
Subject: Re: [PATCH] selftests/harness: Flush stdout before forking

On Thu, Sep 17, 2020 at 02:15:19PM +1000, Michael Ellerman wrote:
> The test harness forks() a child to run each test. Both the parent and
> the child print to stdout using libc functions. That can lead to
> duplicated (or more) output if the libc buffers are not flushed before
> forking.
> 
> It's generally not seen when running programs directly, because stdout
> will usually be line buffered when it's pointing to a terminal.
> 
> This was noticed when running the seccomp_bpf test, eg:
> 
>   $ ./seccomp_bpf | tee test.log
>   $ grep -c "TAP version 13" test.log
>   2

Oh thank you for tracking this down! I thought seccomp wasn't killing a
child or something, and hadn't found it yet. :)

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

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ