linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Kees Cook <keescook@chromium.org>
Cc: David Gow <davidgow@google.com>,
	Daniel Latypov <dlatypov@google.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	KUnit Development <kunit-dev@googlegroups.com>,
	llvm@lists.linux.dev, linux-hardening@vger.kernel.org,
	linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH] lib: stackinit: Convert to KUnit
Date: Tue, 22 Mar 2022 15:30:22 +0100	[thread overview]
Message-ID: <CAMuHMdX_g1tbiUL9PUQdqaegrEzCNN3GtbSvSBFYAL4TzvstFg@mail.gmail.com> (raw)
In-Reply-To: <20220224055145.1853657-1-keescook@chromium.org>

Hi Kees,

On Thu, Feb 24, 2022 at 9:12 AM Kees Cook <keescook@chromium.org> wrote:
> Convert to running under Kunit (and retain being able to run stand-alone
> too). Building under Clang (or GCC 12) with CONFIG_INIT_STACK_ALL_ZERO=y,
> this now passes as expected:
>
> $ ./tools/testing/kunit/kunit.py config --make_option LLVM=1
> $ ./tools/testing/kunit/kunit.py run overflow --make_option LLVM=1 \
>         --kconfig_add CONFIG_INIT_STACK_ALL_ZERO=y
> ...

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

Thanks for your patch, which is now commit 02788ebcf521fe78 ("lib:
stackinit: Convert to KUnit") upstream.

Out of curiosity, I gave this a try on m68k, and it still seems to
fail the same way of before[1]:

    # Subtest: stackinit
    1..65
    # test_u8_zero: ASSERTION FAILED at lib/stackinit_kunit.c:333
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 1 wide, target offset by 16)
    not ok 1 - test_u8_zero
    # test_u16_zero: ASSERTION FAILED at lib/stackinit_kunit.c:333
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 2 wide, target offset by 16)
    not ok 2 - test_u16_zero
    # test_u32_zero: ASSERTION FAILED at lib/stackinit_kunit.c:333
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 4 wide, target offset by 16)
    not ok 3 - test_u32_zero
    # test_u64_zero: ASSERTION FAILED at lib/stackinit_kunit.c:333
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 8 wide, target offset by 16)
    not ok 4 - test_u64_zero
    # test_char_array_zero: ASSERTION FAILED at lib/stackinit_kunit.c:333
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 5 - test_char_array_zero
    # test_small_hole_zero: ASSERTION FAILED at lib/stackinit_kunit.c:334
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 6 - test_small_hole_zero
    # test_big_hole_zero: ASSERTION FAILED at lib/stackinit_kunit.c:334
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 128 wide, target offset by 64)
    not ok 7 - test_big_hole_zero
    # test_trailing_hole_zero: ASSERTION FAILED at lib/stackinit_kunit.c:334
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 8 - test_trailing_hole_zero
    # test_packed_zero: ASSERTION FAILED at lib/stackinit_kunit.c:334
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 9 - test_packed_zero
    # test_small_hole_dynamic_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:337
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 10 - test_small_hole_dynamic_partial
    ok 11 - test_big_hole_dynamic_partial
    # test_trailing_hole_dynamic_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:337
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 12 - test_trailing_hole_dynamic_partial
    # test_packed_dynamic_partial: ASSERTION FAILED at lib/stackinit_kunit.c:337
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 13 - test_packed_dynamic_partial
    # test_small_hole_assigned_dynamic_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:340
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 14 - test_small_hole_assigned_dynamic_partial
    ok 15 - test_big_hole_assigned_dynamic_partial
    # test_trailing_hole_assigned_dynamic_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:340
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 16 - test_trailing_hole_assigned_dynamic_partial
    # test_packed_assigned_dynamic_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:340
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 17 - test_packed_assigned_dynamic_partial
    # test_small_hole_static_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:336
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 18 - test_small_hole_static_partial
    ok 19 - test_big_hole_static_partial
    # test_trailing_hole_static_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:336
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 20 - test_trailing_hole_static_partial
    # test_packed_static_partial: ASSERTION FAILED at lib/stackinit_kunit.c:336
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 21 - test_packed_static_partial
    # test_small_hole_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:336
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 22 - test_small_hole_static_all
    ok 23 - test_big_hole_static_all
    # test_trailing_hole_static_all: ASSERTION FAILED at
lib/stackinit_kunit.c:336
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 24 - test_trailing_hole_static_all
    # test_packed_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:336
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 25 - test_packed_static_all
    # test_small_hole_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:337
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 26 - test_small_hole_dynamic_all
    ok 27 - test_big_hole_dynamic_all # SKIP XFAIL uninit bytes: 124
    # test_trailing_hole_dynamic_all: ASSERTION FAILED at
lib/stackinit_kunit.c:337
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 28 - test_trailing_hole_dynamic_all
    # test_packed_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:337
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 29 - test_packed_dynamic_all
    # test_small_hole_runtime_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:338
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 30 - test_small_hole_runtime_partial
    ok 31 - test_big_hole_runtime_partial # SKIP XFAIL uninit bytes: 127
    # test_trailing_hole_runtime_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:338
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 32 - test_trailing_hole_runtime_partial
    # test_packed_runtime_partial: ASSERTION FAILED at lib/stackinit_kunit.c:338
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 33 - test_packed_runtime_partial
    # test_small_hole_runtime_all: ASSERTION FAILED at lib/stackinit_kunit.c:338
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 34 - test_small_hole_runtime_all
    ok 35 - test_big_hole_runtime_all # SKIP XFAIL uninit bytes: 124
    # test_trailing_hole_runtime_all: ASSERTION FAILED at
lib/stackinit_kunit.c:338
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 36 - test_trailing_hole_runtime_all
    # test_packed_runtime_all: ASSERTION FAILED at lib/stackinit_kunit.c:338
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 37 - test_packed_runtime_all
    # test_small_hole_assigned_static_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:339
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 38 - test_small_hole_assigned_static_partial
    ok 39 - test_big_hole_assigned_static_partial
    # test_trailing_hole_assigned_static_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:339
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 40 - test_trailing_hole_assigned_static_partial
    # test_packed_assigned_static_partial: ASSERTION FAILED at
lib/stackinit_kunit.c:339
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 41 - test_packed_assigned_static_partial
    # test_small_hole_assigned_static_all: ASSERTION FAILED at
lib/stackinit_kunit.c:339
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 42 - test_small_hole_assigned_static_all
    ok 43 - test_big_hole_assigned_static_all
    # test_trailing_hole_assigned_static_all: ASSERTION FAILED at
lib/stackinit_kunit.c:339
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 44 - test_trailing_hole_assigned_static_all
    # test_packed_assigned_static_all: ASSERTION FAILED at
lib/stackinit_kunit.c:339
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 45 - test_packed_assigned_static_all
    # test_small_hole_assigned_dynamic_all: ASSERTION FAILED at
lib/stackinit_kunit.c:340
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 46 - test_small_hole_assigned_dynamic_all
    ok 47 - test_big_hole_assigned_dynamic_all # SKIP XFAIL uninit bytes: 124
    # test_trailing_hole_assigned_dynamic_all: ASSERTION FAILED at
lib/stackinit_kunit.c:340
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 48 - test_trailing_hole_assigned_dynamic_all
    # test_packed_assigned_dynamic_all: ASSERTION FAILED at
lib/stackinit_kunit.c:340
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 49 - test_packed_assigned_dynamic_all
    # test_small_hole_assigned_copy: ASSERTION FAILED at
lib/stackinit_kunit.c:341
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 50 - test_small_hole_assigned_copy
    ok 51 - test_big_hole_assigned_copy # SKIP XFAIL uninit bytes: 124
    # test_trailing_hole_assigned_copy: ASSERTION FAILED at
lib/stackinit_kunit.c:341
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 52 - test_trailing_hole_assigned_copy
    # test_packed_assigned_copy: ASSERTION FAILED at lib/stackinit_kunit.c:341
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 53 - test_packed_assigned_copy
    # test_u8_none: ASSERTION FAILED at lib/stackinit_kunit.c:343
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 1 wide, target offset by 16)
    not ok 54 - test_u8_none
    # test_u16_none: ASSERTION FAILED at lib/stackinit_kunit.c:343
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 2 wide, target offset by 16)
    not ok 55 - test_u16_none
    # test_u32_none: ASSERTION FAILED at lib/stackinit_kunit.c:343
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 4 wide, target offset by 16)
    not ok 56 - test_u32_none
    # test_u64_none: ASSERTION FAILED at lib/stackinit_kunit.c:343
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 8 wide, target offset by 16)
    not ok 57 - test_u64_none
    # test_char_array_none: ASSERTION FAILED at lib/stackinit_kunit.c:343
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 4)
    not ok 58 - test_char_array_none
    # test_switch_1_none: ASSERTION FAILED at lib/stackinit_kunit.c:409
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 80 wide, target offset by 16)
    not ok 59 - test_switch_1_none
    # test_switch_2_none: ASSERTION FAILED at lib/stackinit_kunit.c:410
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 80 wide, target offset by 16)
    not ok 60 - test_switch_2_none
    # test_small_hole_none: ASSERTION FAILED at lib/stackinit_kunit.c:344
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 61 - test_small_hole_none
    ok 62 - test_big_hole_none # SKIP XFAIL uninit bytes: 128
    # test_trailing_hole_none: ASSERTION FAILED at lib/stackinit_kunit.c:344
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 63 - test_trailing_hole_none
    # test_packed_none: ASSERTION FAILED at lib/stackinit_kunit.c:344
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 16 wide, target offset by 16)
    not ok 64 - test_packed_none
    # test_user: ASSERTION FAILED at lib/stackinit_kunit.c:346
    Expected range_contains(fill_start, fill_size, target_start,
target_size) to be true, but is false

stack fill missed target!? (fill 14 wide, target offset by 16)
    not ok 65 - test_user
# stackinit: pass:6 fail:53 skip:6 total:65
# Totals: pass:6 fail:53 skip:6 total:65
not ok 1 - stackinit

[1] https://lore.kernel.org/r/CAMuHMdW6N40+0gGQ+LSrN64Mo4A0-ELAm0pR3gWQ0mNanyBuUQ@mail.gmail.com

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

  parent reply	other threads:[~2022-03-22 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24  5:51 [PATCH] lib: stackinit: Convert to KUnit Kees Cook
2022-02-24 19:43 ` Daniel Latypov
2022-02-25  1:17   ` Kees Cook
2022-02-25  6:53 ` David Gow
2022-03-22 14:30 ` Geert Uytterhoeven [this message]
2022-03-23 15:46   ` Kees Cook

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=CAMuHMdX_g1tbiUL9PUQdqaegrEzCNN3GtbSvSBFYAL4TzvstFg@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=arnd@arndb.de \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=keescook@chromium.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.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.
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).