1#!/bin/sh 2 3# panic: sched_pickcpu: Failed to find a cpu. 4# cpuid = 1 5# time = 1607419071 6# KDB: stack backtrace: 7# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01bb640770 8# vpanic() at vpanic+0x181/frame 0xfffffe01bb6407c0 9# panic() at panic+0x43/frame 0xfffffe01bb640820 10# sched_pickcpu() at sched_pickcpu+0x4a2/frame 0xfffffe01bb6408d0 11# sched_add() at sched_add+0x5d/frame 0xfffffe01bb640900 12# setrunnable() at setrunnable+0x77/frame 0xfffffe01bb640930 13# wakeup_one() at wakeup_one+0x1d/frame 0xfffffe01bb640950 14# do_lock_umutex() at do_lock_umutex+0x64c/frame 0xfffffe01bb640a40 15# __umtx_op_wait_umutex() at __umtx_op_wait_umutex+0x49/frame 0xfffffe01bb640a80 16# sys__umtx_op() at sys__umtx_op+0x7a/frame 0xfffffe01bb640ac0 17# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe01bb640bf0 18# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01bb640bf0 19# --- syscall (454, FreeBSD ELF64, sys__umtx_op), rip = 0x800254a8c, rsp = 0x7fffdf3f7e88, rbp = 0x7fffdf3f7eb0 --- 20# KDB: enter: panic 21# [ thread pid 58597 tid 106100 ] 22# Stopped at kdb_enter+0x37: movq $0,0x10a7766(%rip) 23# db> x/s version 24# version: FreeBSD 13.0-CURRENT #0 r368405: Mon Dec 7 10:33:35 CET 2020 25# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO 26# db> 27 28[ `uname -p` != "amd64" ] && exit 0 29 30# Fixed by r368462 31 32. ../default.cfg 33cat > /tmp/syzkaller30.c <<EOF 34// https://syzkaller.appspot.com/bug?id=6652adb41773e5c471c98342fefcbfb041af9ac8 35// autogenerated by syzkaller (https://github.com/google/syzkaller) 36// Reported-by: syzbot+4e3b1009de98d2fabcda@syzkaller.appspotmail.com 37 38#define _GNU_SOURCE 39 40#include <pwd.h> 41#include <stdarg.h> 42#include <stdbool.h> 43#include <stdint.h> 44#include <stdio.h> 45#include <stdlib.h> 46#include <string.h> 47#include <sys/endian.h> 48#include <sys/syscall.h> 49#include <unistd.h> 50 51int main(void) 52{ 53 syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); 54 55 *(uint64_t*)0x200000c0 = 0; 56 syscall(SYS_cpuset_setaffinity, 2ul, 2ul, 0x100000000000000ul, 0x20ul, 57 0x200000c0ul); 58 return 0; 59} 60EOF 61mycc -o /tmp/syzkaller30 -Wall -Wextra -O0 /tmp/syzkaller30.c || 62 exit 1 63 64(cd /tmp; timeout 3m ./syzkaller30) 65 66rm -rf /tmp/syzkaller30 syzkaller30.c /tmp/syzkaller.* 67exit 0 68