Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp129759ybf; Wed, 26 Feb 2020 10:04:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxmcqP1om/JxM7azSGLLVncbQ05DYGmEcSI3KtyjOVW0KQg7T/2mMHsFV2pviakKfe327Iq X-Received: by 2002:a9d:7f8d:: with SMTP id t13mr3865451otp.175.1582740287426; Wed, 26 Feb 2020 10:04:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582740287; cv=none; d=google.com; s=arc-20160816; b=YlHgMaDMGY9JTxwUdvrzkM4me08X6+LLSH7OSoZ1ppSgViK0qORXkDYbJ/qgSfpXnI VR9aPFrhbEvvwURn7OBaQokNRfgpG6B88QZ1LCzvso01OlFqKkBvtNeEvAed5BUtMwQC gQpcjboZ3boiGCOK/kULNK/zFP5m9sp/fKaFRcPecHp6SsHI69Ys6mewuWukErgF0F0A V+V+XIFuXegqG+S8xQfV2cYwQgkLp7jGMM7vIhztg7gvYI1NEW2jTaD2hbQxKBRxWMoO bsJ0IUb6qSchAmbGidu/MN7SwGHGqELir+TcYaVcZkAhTLBRDNeNY0Ygm17nSSjg1dK7 6wIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pWXKGdBdSX89CKR49e5HffMWoYSUP5rUcqDtF+HPtwU=; b=DsL3g7/vwD0NfPllbArypIalxNg1ozMBr6x3tGFaZar9UUcyMp+l5hituIAsf2KkC5 rwTfwMI+KUfvrS00yGzy9jIsNYJ3S3/7nEep38iMTgil7SxSxktVLGkUIk4os1DzrhwX /FS6wMp9wMk26pHRugNxoUIkjFzUwaBSsQKwHYXvIXS7+m1QiUvrSbG4b3Va4uKdd9E7 IXJiQHPuSBmZ++78Wv9HDJZgGwcETpYxhGRJHa1q+pB1H4JWWTc9nmF9E3zQGLX7U+GP Llr8Ds3121CjhJQs4iB5faU6XiB1lK/bgGyQuBEbS2MnahlhJvq61ys7paQ7XFRVn1O3 +sww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ACh0SRAb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si15190oih.41.2020.02.26.10.04.30; Wed, 26 Feb 2020 10:04:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ACh0SRAb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727154AbgBZSDB (ORCPT + 99 others); Wed, 26 Feb 2020 13:03:01 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37998 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbgBZSDB (ORCPT ); Wed, 26 Feb 2020 13:03:01 -0500 Received: by mail-lj1-f193.google.com with SMTP id w1so86694ljh.5 for ; Wed, 26 Feb 2020 10:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pWXKGdBdSX89CKR49e5HffMWoYSUP5rUcqDtF+HPtwU=; b=ACh0SRAboVy9RI/D8WrK7VHkxi4+ta5eLMnNWoJU0tAoPcYq0HEVIC0YNpBboxDBBp DpR1O8hBxPP0kZqekZjQfwjMvKF0/rceGQYMiduSe9uU33KJEqOl0XfIVgVG4Uue1oAb eVgTwOVA6OYfqaxp2t5hYREjGDebc8qEbVXx/3Hr//pVlBp/Kz4ugcx8oJqathS4eVa8 nCNSrWLI4SKd3GV6hrw4LMIlcvCRvHjCoMFbd3fVu9zbVD8WR4i0fl4hgcTYWSXHG65x P3s905idwsUc6DxrPHyDsUTFz2KjVkN9fJkwK1xGlaa0vicxuiGumwphYAMOTQyK8FGa e38A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pWXKGdBdSX89CKR49e5HffMWoYSUP5rUcqDtF+HPtwU=; b=oTek1CKJcEwjE9XiCvVXNeugXPQpT9vw2An8Jiev9olZLsNRjhjyKQqybDzVHcS4H+ c5cdWdqbU6R2kTsuxJZl7/BIRjgGE2udwGsyJqFy+gP76sxY5soUIFYGLePuGuIK1Ru1 GWqsivimbi9ve4i9rvcGKJOEHbZT8RFvpw9ylv6sCHrKPpQ2+FWLL+jNWD+znjUwz4IY VdJpqxky3KDnizqCR6M6PIcIOzzjdx8WOWI1v0Q8pP7/mtsrUy7zKqj2aLctWcPK6QUF /Vdx4/6Nbf9cZUUEXMEUQbLQ8weoDNDE96eufBI1bOARx8xSO6dPdjASMfbjCxKvRUMI G8Lw== X-Gm-Message-State: ANhLgQ3cZhYL9gH4mYbqwvBWWMb5gabXx0f8b3ov0rGX95XLQBF5AkLP pK/rwaLjq4MFx0PMqTKzVDiBMxguSU9f5UWi3uesXg== X-Received: by 2002:a05:651c:414:: with SMTP id 20mr83919lja.165.1582740178341; Wed, 26 Feb 2020 10:02:58 -0800 (PST) MIME-Version: 1.0 References: <202002251131.3216B3B50C@keescook> In-Reply-To: From: Naresh Kamboju Date: Wed, 26 Feb 2020 23:32:46 +0530 Message-ID: Subject: Re: selftests: Linux Kernel Dump Test Module output To: Cristian Marussi Cc: Kees Cook , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan , Anders Roxell , lkft-triage@lists.linaro.org, open list , ankita@in.ibm.com, Will Deacon , ardb@kernel.org, "Guohanjun (Hanjun Guo)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Feb 2020 at 17:23, Cristian Marussi wrote: > > Hi Kees > > ./run_kselftest.sh 2>/dev/null | grep "SKIP" > not ok 1 selftests: lkdtm: PANIC.sh # SKIP > not ok 6 selftests: lkdtm: LOOP.sh # SKIP > not ok 7 selftests: lkdtm: EXHAUST_STACK.sh # SKIP > not ok 8 selftests: lkdtm: CORRUPT_STACK.sh # SKIP > not ok 9 selftests: lkdtm: CORRUPT_STACK_STRONG.sh # SKIP > not ok 15 selftests: lkdtm: UNSET_SMEP.sh # SKIP > not ok 16 selftests: lkdtm: DOUBLE_FAULT.sh # SKIP > not ok 18 selftests: lkdtm: OVERWRITE_ALLOCATION.sh # SKIP > not ok 19 selftests: lkdtm: WRITE_AFTER_FREE.sh # SKIP > not ok 21 selftests: lkdtm: WRITE_BUDDY_AFTER_FREE.sh # SKIP > not ok 26 selftests: lkdtm: SOFTLOCKUP.sh # SKIP > not ok 27 selftests: lkdtm: HARDLOCKUP.sh # SKIP > not ok 28 selftests: lkdtm: SPINLOCKUP.sh # SKIP > not ok 29 selftests: lkdtm: HUNG_TASK.sh # SKIP > not ok 59 selftests: lkdtm: REFCOUNT_TIMING.sh # SKIP > not ok 60 selftests: lkdtm: ATOMIC_TIMING.sh # SKIP > > BUT, if I look at one LKDTM test script > (lkdtm/USERCOPY_STACK_FRAME_TO.sh): > > ... > # If the test is commented out, report a skip Yeah i see this case at my end also. my two cents, I have two comments, 1) shell check 2) I see the debugfs mounted and test required details are available in a given path. 1) Shell check show these warnings * SHELLCHECK: [FAILED]: run.sh * SHELLCHECK: [OUTPUT]: In run.sh line 26: test=$(basename $0 .sh) ^-- SC2086: Double quote to prevent globbing and word splitting. In run.sh line 28: line=$(egrep '^#?'"$test"'\b' tests.txt) ^---^ SC2196: egrep is non-standard and deprecated. Use grep -E instead. In run.sh line 34: if ! egrep -q '^'"$test"'$' "$TRIGGER" ; then ^---^ SC2196: egrep is non-standard and deprecated. Use grep -E instead. In run.sh line 81: if egrep -qi "$expect" "$LOG" ; then ^---^ SC2196: egrep is non-standard and deprecated. Use grep -E instead. In run.sh line 85: if egrep -qi XFAIL: "$LOG" ; then ^---^ SC2196: egrep is non-standard and deprecated. Use grep -E instead. Test output with set -x for debugging shell scripts. + ls /sys/kernel/debug/provoke-crash/DIRECT /sys/kernel/debug/provoke-crash/DIRECT + ls /sys/kernel/debug/provoke-crash/DIRECT /sys/kernel/debug/provoke-crash/FS_DEVRW /sys/kernel/debug/provoke-crash/IDE_CORE_CP /sys/kernel/debug/provoke-crash/INT_HARDWARE_ENTRY /sys/kernel/debug/provoke-crash/INT_HW_IRQ_EN /sys/kernel/debug/provoke-crash/INT_TASKLET_ENTRY /sys/kernel/debug/provoke-crash/MEM_SWAPOUT /sys/kernel/debug/provoke-crash/SCSI_DISPATCH_CMD /sys/kernel/debug/provoke-crash/TIMERADD /sys/kernel/debug/provoke-crash/DIRECT /sys/kernel/debug/provoke-crash/FS_DEVRW /sys/kernel/debug/provoke-crash/IDE_CORE_CP /sys/kernel/debug/provoke-crash/INT_HARDWARE_ENTRY /sys/kernel/debug/provoke-crash/INT_HW_IRQ_EN /sys/kernel/debug/provoke-crash/INT_TASKLET_ENTRY /sys/kernel/debug/provoke-crash/MEM_SWAPOUT /sys/kernel/debug/provoke-crash/SCSI_DISPATCH_CMD /sys/kernel/debug/provoke-crash/TIMERADD + cat /sys/kernel/debug/provoke-crash/DIRECT Available crash types: PANIC BUG WARNING WARNING_MESSAGE EXCEPTION LOOP EXHAUST_STACK CORRUPT_STACK CORRUPT_STACK_STRONG CORRUPT_LIST_ADD CORRUPT_LIST_DEL CORRUPT_USER_DS STACK_GUARD_PAGE_LEADING STACK_GUARD_PAGE_TRAILING UNSET_SMEP UNALIGNED_LOAD_STORE_WRITE OVERWRITE_ALLOCATION WRITE_AFTER_FREE READ_AFTER_FREE WRITE_BUDDY_AFTER_FREE READ_BUDDY_AFTER_FREE SLAB_FREE_DOUBLE SLAB_FREE_CROSS SLAB_FREE_PAGE SOFTLOCKUP HARDLOCKUP SPINLOCKUP HUNG_TASK EXEC_DATA EXEC_STACK EXEC_KMALLOC EXEC_VMALLOC EXEC_RODATA EXEC_USERSPACE EXEC_NULL ACCESS_USERSPACE ACCESS_NULL WRITE_RO WRITE_RO_AFTER_INIT WRITE_KERN REFCOUNT_INC_OVERFLOW REFCOUNT_ADD_OVERFLOW REFCOUNT_INC_NOT_ZERO_OVERFLOW REFCOUNT_ADD_NOT_ZERO_OVERFLOW REFCOUNT_DEC_ZERO REFCOUNT_DEC_NEGATIVE REFCOUNT_DEC_AND_TEST_NEGATIVE REFCOUNT_SUB_AND_TEST_NEGATIVE REFCOUNT_INC_ZERO REFCOUNT_ADD_ZERO REFCOUNT_INC_SATURATED REFCOUNT_DEC_SATURATED REFCOUNT_ADD_SATURATED REFCOUNT_INC_NOT_ZERO_SATURATED REFCOUNT_ADD_NOT_ZERO_SATURATED REFCOUNT_DEC_AND_TEST_SATURATED REFCOUNT_SUB_AND_TEST_SATURATED REFCOUNT_TIMING ATOMIC_TIMING USERCOPY_HEAP_SIZE_TO USERCOPY_HEAP_SIZE_FROM USERCOPY_HEAP_WHITELIST_TO USERCOPY_HEAP_WHITELIST_FROM USERCOPY_STACK_FRAME_TO USERCOPY_STACK_FRAME_FROM USERCOPY_STACK_BEYOND USERCOPY_KERNEL USERCOPY_KERNEL_DS STACKLEAK_ERASING CFI_FORWARD_PROTO + cd /opt/kselftests/default-in-kernel/lkdtm + sed -i '1i set -x' ACCESS_NULL.sh ACCESS_USERSPACE.sh ATOMIC_TIMING.sh BUG.sh CFI_FORWARD_PROTO.sh CORRUPT_LIST_ADD.sh CORRUPT_LIST_DEL.sh CORRUPT_STACK.sh CORRUPT_STACK_STRONG.sh CORRUPT_USER_DS.sh DOUBLE_FAULT.sh EXCEPTION.sh EXEC_DATA.sh EXEC_KMALLOC.sh EXEC_NULL.sh EXEC_RODATA.sh EXEC_STACK.sh EXEC_USERSPACE.sh EXEC_VMALLOC.sh EXHAUST_STACK.sh HARDLOCKUP.sh HUNG_TASK.sh LOOP.sh OVERWRITE_ALLOCATION.sh PANIC.sh READ_AFTER_FREE.sh READ_BUDDY_AFTER_FREE.sh REFCOUNT_ADD_NOT_ZERO_OVERFLOW.sh REFCOUNT_ADD_NOT_ZERO_SATURATED.sh REFCOUNT_ADD_OVERFLOW.sh REFCOUNT_ADD_SATURATED.sh REFCOUNT_ADD_ZERO.sh REFCOUNT_DEC_AND_TEST_NEGATIVE.sh REFCOUNT_DEC_AND_TEST_SATURATED.sh REFCOUNT_DEC_NEGATIVE.sh REFCOUNT_DEC_SATURATED.sh REFCOUNT_DEC_ZERO.sh REFCOUNT_INC_NOT_ZERO_OVERFLOW.sh REFCOUNT_INC_NOT_ZERO_SATURATED.sh REFCOUNT_INC_OVERFLOW.sh REFCOUNT_INC_SATURATED.sh REFCOUNT_INC_ZERO.sh REFCOUNT_SUB_AND_TEST_NEGATIVE.sh REFCOUNT_SUB_AND_TEST_SATURATED.sh REFCOUNT_TIMING.sh SLAB_FREE_CROSS.sh SLAB_FREE_DOUBLE.sh SLAB_FREE_PAGE.sh SOFTLOCKUP.sh SPINLOCKUP.sh STACKLEAK_ERASING.sh STACK_GUARD_PAGE_LEADING.sh STACK_GUARD_PAGE_TRAILING.sh UNALIGNED_LOAD_STORE_WRITE.sh UNSET_SMEP.sh USERCOPY_HEAP_SIZE_FROM.sh USERCOPY_HEAP_SIZE_TO.sh USERCOPY_HEAP_WHITELIST_FROM.sh USERCOPY_HEAP_WHITELIST_TO.sh USERCOPY_KERNEL.sh USERCOPY_KERNEL_DS.sh USERCOPY_STACK_BEYOND.sh USERCOPY_STACK_FRAME_FROM.sh USERCOPY_STACK_FRAME_TO.sh WARNING.sh WARNING_MESSAGE.sh WRITE_AFTER_FREE.sh WRITE_BUDDY_AFTER_FREE.sh WRITE_KERN.sh WRITE_RO.sh WRITE_RO_AFTER_INIT.sh + ./PANIC.sh ++ set -e ++ TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT ++ KSELFTEST_SKIP_TEST=4 ++ '[' '!' -r /sys/kernel/debug/provoke-crash/DIRECT ']' +++ basename ./PANIC.sh .sh ++ test=PANIC +++ egrep '^#?PANIC\b' tests.txt ++ line='#PANIC' ++ '[' -z '#PANIC' ']' ++ egrep -q '^PANIC$' /sys/kernel/debug/provoke-crash/DIRECT +++ echo '#PANIC' +++ cut '-d ' -f1 ++ test='#PANIC' ++ echo '#PANIC' ++ grep -q ' ' ++ expect= ++ echo '#PANIC' ++ grep -q '^#' +++ echo '#PANIC' +++ cut -c2- ++ test=PANIC ++ '[' -z '' ']' ++ expect='crashes entire system' ++ echo 'Skipping PANIC: crashes entire system' Skipping PANIC: crashes entire system ++ exit 4 + true + ./BUG.sh ++ set -e ++ TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT ++ KSELFTEST_SKIP_TEST=4 ++ '[' '!' -r /sys/kernel/debug/provoke-crash/DIRECT ']' +++ basename ./BUG.sh .sh ++ test=BUG +++ egrep '^#?BUG\b' tests.txt ++ line='BUG kernel BUG at' ++ '[' -z 'BUG kernel BUG at' ']' ++ egrep -q '^BUG$' /sys/kernel/debug/provoke-crash/DIRECT +++ echo 'BUG kernel BUG at' +++ cut '-d ' -f1 ++ test=BUG ++ echo 'BUG kernel BUG at' ++ grep -q ' ' +++ echo 'BUG kernel BUG at' +++ cut '-d ' -f2- ++ expect='kernel BUG at' ++ echo BUG ++ grep -q '^#' ++ '[' -z 'kernel BUG at' ']' ++ dmesg -c +++ mktemp --tmpdir -t lkdtm-XXXXXX ++ LOG=/tmp/lkdtm-r5yZ7K ++ trap cleanup EXIT ++ /bin/sh -c 'cat <(echo BUG) >/sys/kernel/debug/provoke-crash/DIRECT' ++ true ++ dmesg -c ++ cat /tmp/lkdtm-r5yZ7K ++ egrep -qi 'kernel BUG at' /tmp/lkdtm-r5yZ7K ++ egrep -qi XFAIL: /tmp/lkdtm-r5yZ7K ++ echo 'BUG: missing '\''kernel BUG at'\'': [FAIL]' BUG: missing 'kernel BUG at': [FAIL] ... ref: https://lkft.validation.linaro.org/scheduler/job/1251181#L1311