Message ID | 20221017044345.15496-1-Jason@zx2c4.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1271551wrs; Sun, 16 Oct 2022 21:53:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7iW/eKaKu8oaTOEpAiKvimTv2rTyjXvOlLn7K2vUbzCxLLDj81KZ25IZOJzovTGkDk6fVy X-Received: by 2002:aa7:db4d:0:b0:458:908f:a372 with SMTP id n13-20020aa7db4d000000b00458908fa372mr8569468edt.248.1665982431075; Sun, 16 Oct 2022 21:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665982431; cv=none; d=google.com; s=arc-20160816; b=YBFIOpdRJweRfIaYor2Ett2fS3l2HqRPWI4H04TLhpNh+eGaXE7cC1HI/qDMPCWkph WaBj1Mdi18OzMeY6XBmOAXAPnlV0CiE/ALIhjSmKMiiCiJkABr4rIBIVjhGjlyQQIPuF oD6vG4l+ZdeJCszKIWctNX3pv16PAHDHWdMWhupUU0JyR/DwyF4rfd0dcj2AvRb5t5BQ kqGiCPRfYeR+zmjkEaihQqm+yaPl1LyDqKuiYHG32T7VjoWPRFOeHi1sVxKEXWlxdqlE wyv6kH1Qfsxa3e1RFsnI6VJe4B0WluFSNoxnuc9xPK+mOMPTM80exi65voaj0nCJ1QZ7 y9EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5JStNHk0+LrndNMdMSbJEck91l1dLZQIDKk5fDCxAUY=; b=IffOtKUtPgE1VNULjSox3nT4JHVYAe62fydgG0xny4Sid8aabtjCdxrE5G+wsdX3lx XKRAwOWeIKPrzCAJr+Abi9dsdiOuUcQZgT0TwVBfiIs1r9I3sVGf+dbK5XX49WxJf/X+ nF+IqDAxUP7KZMFMYWXrZcxxvXf3gkfChd08omLp4yzETsT0FtoGD5aCrHk7sFqk8M6W ADx2WHXFMw691ZIioOya8vrslURlQxENrDf8mRtjCgNAzUtCuBradO2vlYcdfnu3K56c N9twdl698348GdDK8/rWyu7M06d9naVqaQA/NvFHZd6rwxwZSfhubb/Hxl2Oz7jzATeX NZkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=hHKZuBt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020aa7cd0b000000b0045bd55b1240si6910326edw.313.2022.10.16.21.53.25; Sun, 16 Oct 2022 21:53:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=hHKZuBt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbiJQEoA (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Mon, 17 Oct 2022 00:44:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbiJQEn5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Oct 2022 00:43:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C11A4DB7B for <linux-kernel@vger.kernel.org>; Sun, 16 Oct 2022 21:43:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9ADCBB80B37 for <linux-kernel@vger.kernel.org>; Mon, 17 Oct 2022 04:43:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7A3EC433D6; Mon, 17 Oct 2022 04:43:53 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="hHKZuBt1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1665981832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5JStNHk0+LrndNMdMSbJEck91l1dLZQIDKk5fDCxAUY=; b=hHKZuBt1dhIZVxR7pPoKZxLznoX4ZftXyKbJQtV6fhyAYX26oVGicJpmigexe5u6UI9rK/ YcINALw7riGAkc2dsp31wTXopBBQgHKWiZTXD6fW3+rA6H5pMLkMQKGqZ+B/QZ5ytwKMMP nZp+adi6HYSw3ENQ6AS+bM/xyC4G1ko= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 850eec55 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 17 Oct 2022 04:43:52 +0000 (UTC) From: "Jason A. Donenfeld" <Jason@zx2c4.com> To: elver@google.com, dvyukov@google.com, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" <Jason@zx2c4.com> Subject: [PATCH] kcsan: remove rng selftest Date: Sun, 16 Oct 2022 22:43:45 -0600 Message-Id: <20221017044345.15496-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746909193625094230?= X-GMAIL-MSGID: =?utf-8?q?1746909193625094230?= |
Series |
kcsan: remove rng selftest
|
|
Commit Message
Jason A. Donenfeld
Oct. 17, 2022, 4:43 a.m. UTC
The first test of the kcsan selftest appears to test if get_random_u32()
returns two zeros in a row, and requires that it doesn't. This seems
like a bogus critera. Remove it.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
kernel/kcsan/selftest.c | 8 --------
1 file changed, 8 deletions(-)
Comments
On Sun, 16 Oct 2022 at 21:43, Jason A. Donenfeld <Jason@zx2c4.com> wrote: > > The first test of the kcsan selftest appears to test if get_random_u32() > returns two zeros in a row, and requires that it doesn't. This seems > like a bogus critera. Remove it. > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Acked-by: Marco Elver <elver@google.com> Looks pretty redundant at this point (I think some early version had it because somehow I managed to run the test too early and wanted to avoid that accidentally happening again). > --- > kernel/kcsan/selftest.c | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/kernel/kcsan/selftest.c b/kernel/kcsan/selftest.c > index 00cdf8fa5693..1740ce389e7f 100644 > --- a/kernel/kcsan/selftest.c > +++ b/kernel/kcsan/selftest.c > @@ -22,13 +22,6 @@ > > #define ITERS_PER_TEST 2000 > > -/* Test requirements. */ > -static bool __init test_requires(void) > -{ > - /* random should be initialized for the below tests */ > - return get_random_u32() + get_random_u32() != 0; > -} > - > /* > * Test watchpoint encode and decode: check that encoding some access's info, > * and then subsequent decode preserves the access's info. > @@ -259,7 +252,6 @@ static int __init kcsan_selftest(void) > pr_err("selftest: " #do_test " failed"); \ > } while (0) > > - RUN_TEST(test_requires); > RUN_TEST(test_encode_decode); > RUN_TEST(test_matching_access); > RUN_TEST(test_barrier); > -- > 2.37.3 >
On Sun, 16 Oct 2022 at 22:07, Marco Elver <elver@google.com> wrote: > > On Sun, 16 Oct 2022 at 21:43, Jason A. Donenfeld <Jason@zx2c4.com> wrote: > > > > The first test of the kcsan selftest appears to test if get_random_u32() > > returns two zeros in a row, and requires that it doesn't. This seems > > like a bogus critera. Remove it. > > > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > > Acked-by: Marco Elver <elver@google.com> > > Looks pretty redundant at this point (I think some early version had > it because somehow I managed to run the test too early and wanted to > avoid that accidentally happening again). > And kindly queue it in your tree with all the rng related changes. Thanks! > > --- > > kernel/kcsan/selftest.c | 8 -------- > > 1 file changed, 8 deletions(-) > > > > diff --git a/kernel/kcsan/selftest.c b/kernel/kcsan/selftest.c > > index 00cdf8fa5693..1740ce389e7f 100644 > > --- a/kernel/kcsan/selftest.c > > +++ b/kernel/kcsan/selftest.c > > @@ -22,13 +22,6 @@ > > > > #define ITERS_PER_TEST 2000 > > > > -/* Test requirements. */ > > -static bool __init test_requires(void) > > -{ > > - /* random should be initialized for the below tests */ > > - return get_random_u32() + get_random_u32() != 0; > > -} > > - > > /* > > * Test watchpoint encode and decode: check that encoding some access's info, > > * and then subsequent decode preserves the access's info. > > @@ -259,7 +252,6 @@ static int __init kcsan_selftest(void) > > pr_err("selftest: " #do_test " failed"); \ > > } while (0) > > > > - RUN_TEST(test_requires); > > RUN_TEST(test_encode_decode); > > RUN_TEST(test_matching_access); > > RUN_TEST(test_barrier); > > -- > > 2.37.3 > >
On Sun, Oct 16, 2022 at 11:09 PM Marco Elver <elver@google.com> wrote: > > On Sun, 16 Oct 2022 at 22:07, Marco Elver <elver@google.com> wrote: > > > > On Sun, 16 Oct 2022 at 21:43, Jason A. Donenfeld <Jason@zx2c4.com> wrote: > > > > > > The first test of the kcsan selftest appears to test if get_random_u32() > > > returns two zeros in a row, and requires that it doesn't. This seems > > > like a bogus critera. Remove it. > > > > > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > > > > Acked-by: Marco Elver <elver@google.com> > > > > Looks pretty redundant at this point (I think some early version had > > it because somehow I managed to run the test too early and wanted to > > avoid that accidentally happening again). > > > > And kindly queue it in your tree with all the rng related changes. Thanks! Okay sure, will do. Jason
diff --git a/kernel/kcsan/selftest.c b/kernel/kcsan/selftest.c index 00cdf8fa5693..1740ce389e7f 100644 --- a/kernel/kcsan/selftest.c +++ b/kernel/kcsan/selftest.c @@ -22,13 +22,6 @@ #define ITERS_PER_TEST 2000 -/* Test requirements. */ -static bool __init test_requires(void) -{ - /* random should be initialized for the below tests */ - return get_random_u32() + get_random_u32() != 0; -} - /* * Test watchpoint encode and decode: check that encoding some access's info, * and then subsequent decode preserves the access's info. @@ -259,7 +252,6 @@ static int __init kcsan_selftest(void) pr_err("selftest: " #do_test " failed"); \ } while (0) - RUN_TEST(test_requires); RUN_TEST(test_encode_decode); RUN_TEST(test_matching_access); RUN_TEST(test_barrier);