From owner-dev-commits-src-all@freebsd.org Thu May 13 05:58:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFD7C6323CC; Thu, 13 May 2021 05:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FggvJ66y1z4VG8; Thu, 13 May 2021 05:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C02B719548; Thu, 13 May 2021 05:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14D5wa57057476; Thu, 13 May 2021 05:58:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14D5wa8P057475; Thu, 13 May 2021 05:58:36 GMT (envelope-from git) Date: Thu, 13 May 2021 05:58:36 GMT Message-Id: <202105130558.14D5wa8P057475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 1025baec7b78 - main - stress2: Added two new syzkaller reproducers. Update the exclude list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1025baec7b786df46ee63bf55369cf081002b8af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 May 2021 05:58:37 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=1025baec7b786df46ee63bf55369cf081002b8af commit 1025baec7b786df46ee63bf55369cf081002b8af Author: Peter Holm AuthorDate: 2021-05-13 05:57:32 +0000 Commit: Peter Holm CommitDate: 2021-05-13 05:57:32 +0000 stress2: Added two new syzkaller reproducers. Update the exclude list --- tools/test/stress2/misc/all.exclude | 2 - tools/test/stress2/misc/syzkaller37.sh | 99 ++++++++++++++++++++++++++++++++++ tools/test/stress2/misc/syzkaller38.sh | 63 ++++++++++++++++++++++ 3 files changed, 162 insertions(+), 2 deletions(-) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index e388fa8957d9..9f856c1b9d2f 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -70,8 +70,6 @@ syzkaller30.sh May change policy for random threads to to domainset_fixed 20210 syzkaller31.sh panic: Bad tailq NEXT(0xfffffe0079608f00->tqh_last) != NULL 20210322 syzkaller32.sh Fatal trap 18: integer divide fault while in kernel mode 20210322 syzkaller33.sh Fatal trap 18: integer divide fault while in kernel mode 20210418 -syzkaller35.sh panic: AEAD without a separate IV 20210508 -syzkaller36.sh panic: IV outside buffer length 20210508 truss3.sh WiP 20200915 unionfs.sh insmntque: non-locked vp: xx is not exclusive locked... 20130909 unionfs2.sh insmntque: mp-safe fs and non-locked vp is not ... 20111219 diff --git a/tools/test/stress2/misc/syzkaller37.sh b/tools/test/stress2/misc/syzkaller37.sh new file mode 100755 index 000000000000..cda44530af85 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller37.sh @@ -0,0 +1,99 @@ +#!/bin/sh + +# panic: crp_iv_start set when IV isn't used +# cpuid = 15 +# time = 1620460567 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe023ceef5d0 +# vpanic() at vpanic+0x181/frame 0xfffffe023ceef620 +# panic() at panic+0x43/frame 0xfffffe023ceef680 +# crp_sanity() at crp_sanity+0x236/frame 0xfffffe023ceef6b0 +# crypto_dispatch() at crypto_dispatch+0xf/frame 0xfffffe023ceef6d0 +# crypto_ioctl() at crypto_ioctl+0x1e33/frame 0xfffffe023ceef7e0 +# devfs_ioctl() at devfs_ioctl+0xcd/frame 0xfffffe023ceef830 +# VOP_IOCTL_APV() at VOP_IOCTL_APV+0x59/frame 0xfffffe023ceef850 +# vn_ioctl() at vn_ioctl+0x133/frame 0xfffffe023ceef960 +# devfs_ioctl_f() at devfs_ioctl_f+0x1e/frame 0xfffffe023ceef980 +# kern_ioctl() at kern_ioctl+0x289/frame 0xfffffe023ceef9f0 +# sys_ioctl() at sys_ioctl+0x12a/frame 0xfffffe023ceefac0 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe023ceefbf0 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe023ceefbf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x8003827da, rsp = 0x7fffffffe4e8, rbp = 0x7fffffffe540 --- +# KDB: enter: panic +# [ thread pid 18612 tid 109119 ] +# Stopped at kdb_enter+0x37: movq $0,0x1281a2e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n246560-2018d488628: Sat May 8 08:32:52 CEST 2021 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO +# db> + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller37.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t r[1] = {0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + intptr_t res = 0; + memcpy((void*)0x20000340, "/dev/crypto\000", 12); + res = syscall(SYS_openat, 0xffffffffffffff9cul, 0x20000340ul, 0ul, 0ul); + if (res != -1) + r[0] = res; + *(uint32_t*)0x20000040 = 0x10; + *(uint32_t*)0x20000044 = 0x1d; + *(uint32_t*)0x20000048 = 1; + *(uint64_t*)0x20000050 = 0x20000080; + memset((void*)0x20000080, 66, 1); + *(uint32_t*)0x20000058 = 0; + *(uint64_t*)0x20000060 = 0; + *(uint32_t*)0x20000068 = 0; + *(uint32_t*)0x2000006c = 0xfdffffff; + *(uint32_t*)0x20000070 = 0; + *(uint32_t*)0x20000074 = 0; + *(uint32_t*)0x20000078 = 0; + *(uint32_t*)0x2000007c = 0; + syscall(SYS_ioctl, r[0], 0xc040636aul, 0x20000040ul); + *(uint32_t*)0x20000000 = 0; + *(uint16_t*)0x20000004 = 2; + *(uint16_t*)0x20000006 = 0; + *(uint32_t*)0x20000008 = 0; + *(uint32_t*)0x2000000c = 0x10001; + *(uint32_t*)0x20000010 = 0; + *(uint64_t*)0x20000018 = 0; + *(uint64_t*)0x20000020 = 0; + *(uint64_t*)0x20000028 = 0x200001c0; + *(uint64_t*)0x20000030 = 0x20000380; + *(uint64_t*)0x20000038 = 0; + syscall(SYS_ioctl, r[0], 0xc040636dul, 0x20000000ul); + return 0; +} +EOF +mycc -o /tmp/syzkaller37 -Wall -Wextra -O0 /tmp/syzkaller37.c || + exit 1 + +kldload cryptodev.ko && loaded=1 +(cd /tmp; timeout 3m ./syzkaller37) +[ $loaded ] && kldunload cryptodev.ko + +rm -rf /tmp/syzkaller37 syzkaller37.c /tmp/syzkaller.* +exit 0 diff --git a/tools/test/stress2/misc/syzkaller38.sh b/tools/test/stress2/misc/syzkaller38.sh new file mode 100755 index 000000000000..2bd42e98a644 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller38.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +# panic: Assertion (cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0 failed at ../../../kern/vfs_lookup.c:490 +# cpuid = 22 +# time = 1620845561 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01499e7690 +# vpanic() at vpanic+0x181/frame 0xfffffe01499e76e0 +# panic() at panic+0x43/frame 0xfffffe01499e7740 +# namei() at namei+0xb4e/frame 0xfffffe01499e77f0 +# vn_open_cred() at vn_open_cred+0x11d/frame 0xfffffe01499e7960 +# kern_openat() at kern_openat+0x28f/frame 0xfffffe01499e7ac0 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe01499e7bf0 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01499e7bf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x80038254a, rsp = 0x7fffffffe4f8, rbp = 0x7fffffffe540 --- +# KDB: enter: panic +# [ thread pid 2990 tid 100320 ] +# Stopped at kdb_enter+0x37: movq $0,0x12819de(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n246600-e681dd3e2c1-dirty: Wed May 12 07:56:58 CEST 2021 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO\012 +# db> + +# Fixed by: 6de3cf14c47d - main - vn_open_cred(): disallow O_CREAT | O_EMPTY_PATH + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller38.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + + memset((void*)0x20000180, 0, 1); + syscall(SYS_open, 0x20000180ul, 0x20c0200ul, 0ul); + return 0; +} +EOF +mycc -o /tmp/syzkaller38 -Wall -Wextra -O0 /tmp/syzkaller38.c || + exit 1 + +(cd /tmp; timeout 3m ./syzkaller38) + +rm -rf /tmp/syzkaller38 syzkaller38.c /tmp/syzkaller.* +exit 0