xref: /freebsd/tools/test/stress2/misc/syzkaller3.sh (revision acb1f1269c6f4ff89a0d28ba742f6687e9ef779d)
1#!/bin/sh
2
3# panic: mutex process lock not owned at ../../../kern/kern_time.c:261
4# cpuid = 17
5# time = 1580844484
6# KDB: stack backtrace:
7# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01387b7920
8# vpanic() at vpanic+0x185/frame 0xfffffe01387b7980
9# panic() at panic+0x43/frame 0xfffffe01387b79e0
10# __mtx_assert() at __mtx_assert+0xb0/frame 0xfffffe01387b79f0
11# kern_thread_cputime() at kern_thread_cputime+0x99/frame 0xfffffe01387b7a30
12# kern_clock_gettime() at kern_clock_gettime+0x2a6/frame 0xfffffe01387b7a90
13# sys_clock_gettime() at sys_clock_gettime+0x17/frame 0xfffffe01387b7ac0
14# amd64_syscall() at amd64_syscall+0x2f1/frame 0xfffffe01387b7bf0
15# fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe01387b7bf0
16# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x80041b8ca, rsp = 0x7fffffffe9f8, rbp = 0x7fffffffea10 ---
17
18. ../default.cfg
19cat > /tmp/syzkaller3.c <<EOF
20// https://syzkaller.appspot.com/bug?id=6245c550ba855e94618dbc1dec0a21e9e89a2ddd
21// autogenerated by syzkaller (https://github.com/google/syzkaller)
22
23#define _GNU_SOURCE
24
25#include <pwd.h>
26#include <stdarg.h>
27#include <stdbool.h>
28#include <stdint.h>
29#include <stdio.h>
30#include <stdlib.h>
31#include <string.h>
32#include <sys/endian.h>
33#include <sys/syscall.h>
34#include <unistd.h>
35
36int main(void)
37{
38  syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul);
39  syscall(SYS_clock_gettime, 0xeul, 0ul);
40  return 0;
41}
42EOF
43mycc -o /tmp/syzkaller3 -Wall -Wextra -O2 /tmp/syzkaller3.c ||
44    exit 1
45
46(cd /tmp; ./syzkaller3)
47
48rm /tmp/syzkaller3 /tmp/syzkaller3.c
49exit 0
50