From owner-svn-src-user@freebsd.org Wed Dec 9 09:53:22 2020 Return-Path: Delivered-To: svn-src-user@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 0D2C0475E75 for ; Wed, 9 Dec 2020 09:53:22 +0000 (UTC) (envelope-from pho@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CrXRj70HBz4gl4; Wed, 9 Dec 2020 09:53:21 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8B7824425; Wed, 9 Dec 2020 09:53:21 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0B99rLjG093530; Wed, 9 Dec 2020 09:53:21 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0B99rLXU093529; Wed, 9 Dec 2020 09:53:21 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202012090953.0B99rLXU093529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 9 Dec 2020 09:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r368484 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 368484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2020 09:53:22 -0000 Author: pho Date: Wed Dec 9 09:53:21 2020 New Revision: 368484 URL: https://svnweb.freebsd.org/changeset/base/368484 Log: Added a syzkaller reproducer. Added: user/pho/stress2/misc/syzkaller30.sh (contents, props changed) Added: user/pho/stress2/misc/syzkaller30.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/syzkaller30.sh Wed Dec 9 09:53:21 2020 (r368484) @@ -0,0 +1,69 @@ +#!/bin/sh + +# panic: sched_pickcpu: Failed to find a cpu. +# cpuid = 1 +# time = 1607419071 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01bb640770 +# vpanic() at vpanic+0x181/frame 0xfffffe01bb6407c0 +# panic() at panic+0x43/frame 0xfffffe01bb640820 +# sched_pickcpu() at sched_pickcpu+0x4a2/frame 0xfffffe01bb6408d0 +# sched_add() at sched_add+0x5d/frame 0xfffffe01bb640900 +# setrunnable() at setrunnable+0x77/frame 0xfffffe01bb640930 +# wakeup_one() at wakeup_one+0x1d/frame 0xfffffe01bb640950 +# do_lock_umutex() at do_lock_umutex+0x64c/frame 0xfffffe01bb640a40 +# __umtx_op_wait_umutex() at __umtx_op_wait_umutex+0x49/frame 0xfffffe01bb640a80 +# sys__umtx_op() at sys__umtx_op+0x7a/frame 0xfffffe01bb640ac0 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe01bb640bf0 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01bb640bf0 +# --- syscall (454, FreeBSD ELF64, sys__umtx_op), rip = 0x800254a8c, rsp = 0x7fffdf3f7e88, rbp = 0x7fffdf3f7eb0 --- +# KDB: enter: panic +# [ thread pid 58597 tid 106100 ] +# Stopped at kdb_enter+0x37: movq $0,0x10a7766(%rip) +# db> x/s version +# version: FreeBSD 13.0-CURRENT #0 r368405: Mon Dec 7 10:33:35 CET 2020 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO +# db> + +# $FreeBSD$ + +[ `uname -p` != "amd64" ] && exit 0 + +# Fixed by r368462 + +. ../default.cfg +cat > /tmp/syzkaller30.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + + *(uint64_t*)0x200000c0 = 0; + syscall(SYS_cpuset_setaffinity, 2ul, 2ul, 0x100000000000000ul, 0x20ul, + 0x200000c0ul); + return 0; +} +EOF +mycc -o /tmp/syzkaller30 -Wall -Wextra -O0 /tmp/syzkaller30.c || + exit 1 + +(cd /tmp; timeout 3m ./syzkaller30) + +rm -rf /tmp/syzkaller30 syzkaller30.c /tmp/syzkaller.* +exit 0