From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D52FC433E2 for ; Tue, 15 Sep 2020 12:54:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3731D20756 for ; Tue, 15 Sep 2020 12:54:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tXyrNZSB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="FfFXLMeE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3731D20756 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w8I3kUp9Nj5opadXrIH3M+KX1BXl3FSbDtIBtSf+xtI=; b=tXyrNZSBgCAne2c9Xkj7Mt1kk aYB+cvw7vUjk46R+OiO2CAQHGCpjq2mpPeLf4WTSMzmjzx245qTDQcRviIhaR4NDraj6cobkyxWah WlJukDKvVaLr8KGUat7Y47B3+92LBOOdD7AjxJ0Guyd59aF4/Y0100eSdyyNE882jptP8GIeFO/ku AXapVyUTIKo9b7/iwg3seNmJjaf5+y37MJrw4Q1+ZNy75/gYomGq0HMW3pi+kEOrSCGkUeP6ee0Qh 59sgDfAbdcT23ycHAfmnotl1T8+fwuJQFFhaYttRcvHvl7fq+HyJNCdpgk8WD4sHlP+qyx8eEFlUo Ps27JZ2Eg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIARk-0004wE-QN; Tue, 15 Sep 2020 12:52:32 +0000 Received: from bilbo.ozlabs.org ([203.11.71.1] helo=ozlabs.org) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIARh-0004v0-3z for linux-arm-kernel@lists.infradead.org; Tue, 15 Sep 2020 12:52:30 +0000 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BrNRX3vxHz9sTH; Tue, 15 Sep 2020 22:52:24 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1600174345; bh=d/1zO1TaulNZ9TriOX5RFloiXPE2NV9jxfBjB11mp0w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FfFXLMeE2/ukRgHVh1faaE5PJKdoiqxv+CnQForJcVqIfgnCirEobNGOuirFbQArI d2NntCSaLCpCM5Bq2xN5x1kCIalVsLtXdKMNwHsT5qmjtyEbfV+Z4b7+aL87r0Ogvz lPdMr15Ykp2zmNjFy7Fn+qRhRvEeqP86GZDzRJ/qjT+pl42nsJ0n1K3DQIbU6FJJP9 7Cat14dfRK7pcReb0Am4FQowrlCURdSk5w1YFGjc4rouv0CRpMsdj18pm867aogkiV hqbEVsF3mw0FiANRbWn6629as6qXyzKEFbNtu8PCrAzu5DZzMxiotCuCOV0Hb317oY Ebi5ZNT7djt1g== From: Michael Ellerman To: Kees Cook Subject: Re: [PATCH 00/15] selftests/seccomp: Refactor change_syscall() In-Reply-To: <202009141321.366935EF52@keescook> References: <20200912110820.597135-1-keescook@chromium.org> <87wo0wpnah.fsf@mpe.ellerman.id.au> <202009141321.366935EF52@keescook> Date: Tue, 15 Sep 2020 22:52:21 +1000 Message-ID: <87een3p5h6.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200915_085229_501573_F30ADB0F X-CRM114-Status: GOOD ( 19.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thadeu Lima de Souza Cascardo , Will Drewry , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Max Filippov , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Christian Brauner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Kees Cook writes: > On Mon, Sep 14, 2020 at 10:15:18PM +1000, Michael Ellerman wrote: >> Kees Cook writes: >> > Hi, >> > >> > This refactors the seccomp selftest macros used in change_syscall(), >> > in an effort to remove special cases for mips, arm, arm64, and xtensa, >> > which paves the way for powerpc fixes. >> > >> > I'm not entirely done testing, but all-arch build tests and x86_64 >> > selftests pass. I'll be doing arm, arm64, and i386 selftests shortly, >> > but I currently don't have an easy way to check xtensa, mips, nor >> > powerpc. Any help there would be appreciated! >> >> The series builds fine for me, and all the tests pass (see below). >> >> Thanks for picking up those changes to deal with powerpc being oddball. >> >> Tested-by: Michael Ellerman (powerpc) > > Awesome; thanks! > > However... > >> ./seccomp_bpf >> TAP version 13 >> 1..86 >> # Starting 86 tests from 7 test cases. >> # RUN global.kcmp ... >> # OK global.kcmp >> ok 1 global.kcmp >> [...] >> # RUN global.KILL_thread ... >> TAP version 13 >> 1..86 >> # Starting 86 tests from 7 test cases. > > Was this a mis-paste, or has something very very bad happened here in > global.KILL_one_arg_six finishes? > ... >> TAP version 13 >> 1..86 >> # Starting 86 tests from 7 test cases. >> [...] >> # PASSED: 86 / 86 tests passed. >> # Totals: pass:86 fail:0 xfail:0 xpass:0 skip:0 error:0 > > And after every user_notification test? O_O Haha, I thought that was normal :) It's because of redirection, I run the tests with: find . -executable -type f -print -execdir '{}' ';' | tee test.log If I just run it directly on the terminal everything is normal. It'll be fork() vs libc buffering. I can fix it with: $ stdbuf -oL ./seccomp_bpf | tee test.log Or the patch below. I can send a proper patch for that tomorrow, I don't know that harness code, but I think that's the right fix. cheers diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 4f78e4805633..b1bd00ff3d94 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -971,6 +971,7 @@ void __run_test(struct __fixture_metadata *f, ksft_print_msg(" RUN %s%s%s.%s ...\n", f->name, variant->name[0] ? "." : "", variant->name, t->name); + fflush(stdout); t->pid = fork(); if (t->pid < 0) { ksft_print_msg("ERROR SPAWNING TEST CHILD\n"); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel