map[SimplifiedCRepro:// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
uint64_t r[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};
int main(void)
{
syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
const char* reason;
(void)reason;
intptr_t res = 0;
if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
// mkdirat arguments: [
// fd: fd_dir (resource)
// path: ptr[in, buffer] {
// buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
// }
// mode: open_mode = 0x0 (8 bytes)
// ]
memcpy((void*)0x200000000000, "./file0\000", 8);
syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000000ul, /*mode=*/0ul);
// mkdirat arguments: [
// fd: fd_dir (resource)
// path: ptr[in, buffer] {
// buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8)
// }
// mode: open_mode = 0x0 (8 bytes)
// ]
memcpy((void*)0x200000000100, "./file1\000", 8);
syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000100ul, /*mode=*/0ul);
// mkdirat arguments: [
// fd: fd_dir (resource)
// path: ptr[in, buffer] {
// buffer: {2e 2f 62 75 73 00} (length 0x6)
// }
// mode: open_mode = 0x0 (8 bytes)
// ]
memcpy((void*)0x2000000000c0, "./bus\000", 6);
syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x2000000000c0ul, /*mode=*/0ul);
// mount$overlay arguments: [
// src: const = 0x0 (8 bytes)
// dst: ptr[in, buffer] {
// buffer: {2e 2f 62 75 73 00} (length 0x6)
// }
// type: ptr[in, buffer] {
// buffer: {6f 76 65 72 6c 61 79 00} (length 0x8)
// }
// flags: mount_flags = 0x0 (8 bytes)
// opts: ptr[in, fs_options[overlay_options]] {
// fs_options[overlay_options] {
// elems: array[fs_opt_elem[overlay_options]] {
// fs_opt_elem[overlay_options] {
// elem: union overlay_options {
// workdir: fs_opt["workdir", stringnoz[filename]] {
// name: buffer: {77 6f 72 6b 64 69 72} (length 0x7)
// eq: const = 0x3d (1 bytes)
// val: buffer: {2e 2f 62 75 73} (length 0x5)
// }
// }
// comma: const = 0x2c (1 bytes)
// }
// fs_opt_elem[overlay_options] {
// elem: union overlay_options {
// lowerdir: fs_opt["lowerdir", stringnoz[filename]] {
// name: buffer: {6c 6f 77 65 72 64 69 72} (length 0x8)
// eq: const = 0x3d (1 bytes)
// val: buffer: {2e 2f 66 69 6c 65 30} (length 0x7)
// }
// }
// comma: const = 0x2c (1 bytes)
// }
// fs_opt_elem[overlay_options] {
// elem: union overlay_options {
// upperdir: fs_opt["upperdir", stringnoz[filename]] {
// name: buffer: {75 70 70 65 72 64 69 72} (length 0x8)
// eq: const = 0x3d (1 bytes)
// val: buffer: {2e 2f 66 69 6c 65 31} (length 0x7)
// }
// }
// comma: const = 0x2c (1 bytes)
// }
// fs_opt_elem[overlay_options] {
// elem: union overlay_options {
// metacopy_on: buffer: {6d 65 74 61 63 6f 70 79 3d 6f 6e} (length 0xb)
// }
// comma: const = 0x2c (1 bytes)
// }
// }
// common: array[fs_opt_elem[fs_options_common]] {
// }
// null: const = 0x0 (1 bytes)
// }
// }
// ]
memcpy((void*)0x2000000000c0, "./bus\000", 6);
memcpy((void*)0x200000000340, "overlay\000", 8);
memcpy((void*)0x200000000240, "workdir", 7);
*(uint8_t*)0x200000000247 = 0x3d;
memcpy((void*)0x200000000248, "./bus", 5);
*(uint8_t*)0x20000000024d = 0x2c;
memcpy((void*)0x20000000024e, "lowerdir", 8);
*(uint8_t*)0x200000000256 = 0x3d;
memcpy((void*)0x200000000257, "./file0", 7);
*(uint8_t*)0x20000000025e = 0x2c;
memcpy((void*)0x20000000025f, "upperdir", 8);
*(uint8_t*)0x200000000267 = 0x3d;
memcpy((void*)0x200000000268, "./file1", 7);
*(uint8_t*)0x20000000026f = 0x2c;
memcpy((void*)0x200000000270, "metacopy=on", 11);
*(uint8_t*)0x20000000027b = 0x2c;
*(uint8_t*)0x20000000027c = 0;
syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x2000000000c0ul, /*type=*/0x200000000340ul, /*flags=*/0ul, /*opts=*/0x200000000240ul);
// chdir arguments: [
// dir: ptr[in, buffer] {
// buffer: {2e 2f 62 75 73 00} (length 0x6)
// }
// ]
memcpy((void*)0x200000000140, "./bus\000", 6);
syscall(__NR_chdir, /*dir=*/0x200000000140ul);
// open arguments: [
// file: ptr[in, buffer] {
// buffer: {2e 2f 62 75 73 00} (length 0x6)
// }
// flags: open_flags = 0x141042 (8 bytes)
// mode: open_mode = 0x0 (8 bytes)
// ]
// returns fd
memcpy((void*)0x200000000080, "./bus\000", 6);
syscall(__NR_open, /*file=*/0x200000000080ul, /*flags=O_SYNC|O_NOATIME|O_CREAT|O_RDWR*/0x141042ul, /*mode=*/0ul);
// mknod arguments: [
// file: ptr[in, buffer] {
// buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
// }
// mode: mknod_mode = 0x8001420 (8 bytes)
// dev: int32 = 0x0 (4 bytes)
// ]
memcpy((void*)0x200000000040, "./file0\000", 8);
syscall(__NR_mknod, /*file=*/0x200000000040ul, /*mode=S_ISGID|S_IFIFO|0x8000020*/0x8001420ul, /*dev=*/0);
// open$dir arguments: [
// file: ptr[in, buffer] {
// buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
// }
// flags: open_flags = 0x2 (8 bytes)
// mode: open_mode = 0x0 (8 bytes)
// ]
// returns fd_dir
memcpy((void*)0x200000000100, "./file0\000", 8);
res = syscall(__NR_open, /*file=*/0x200000000100ul, /*flags=O_RDWR*/2ul, /*mode=*/0ul);
if (res != -1)
r[0] = res;
// open arguments: [
// file: ptr[in, buffer] {
// buffer: {2e 2f 62 75 73 00} (length 0x6)
// }
// flags: open_flags = 0x42202 (8 bytes)
// mode: open_mode = 0x0 (8 bytes)
// ]
// returns fd
memcpy((void*)0x200000000080, "./bus\000", 6);
res = syscall(__NR_open, /*file=*/0x200000000080ul, /*flags=O_TRUNC|O_NOATIME|FASYNC|O_RDWR*/0x42202ul, /*mode=*/0ul);
if (res != -1)
r[1] = res;
// splice arguments: [
// fdin: fd (resource)
// offin: nil
// fdout: fd (resource)
// offout: nil
// len: intptr = 0xcd6 (8 bytes)
// f: splice_flags = 0x0 (8 bytes)
// ]
syscall(__NR_splice, /*fdin=*/r[0], /*offin=*/0ul, /*fdout=*/r[1], /*offout=*/0ul, /*len=*/0xcd6ul, /*f=*/0ul);
// open$dir arguments: [
// file: ptr[in, buffer] {
// buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
// }
// flags: open_flags = 0x10907e (8 bytes)
// mode: open_mode = 0x0 (8 bytes)
// ]
// returns fd_dir
memcpy((void*)0x200000000000, "./file0\000", 8);
res = syscall(__NR_open, /*file=*/0x200000000000ul, /*flags=O_SYNC|O_LARGEFILE|O_CREAT|O_RDWR|0x3c*/0x10907eul, /*mode=*/0ul);
if (res != -1)
r[2] = res;
// openat$sysfs arguments: [
// fd: const = 0xffffffffffffff9c (8 bytes)
// dir: ptr[in, buffer] {
// buffer: {2f 73 79 73 2f 70 6f 77 65 72 2f 72 65 73 75 6d 65} (length 0x11)
// }
// flags: open_flags = 0x149a82 (4 bytes)
// mode: open_mode = 0x0 (2 bytes)
// ]
// returns fd
memcpy((void*)0x2000000002c0, "/sys/power/resume", 17);
res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*dir=*/0x2000000002c0ul, /*flags=O_TRUNC|O_SYNC|O_NONBLOCK|O_NOATIME|O_LARGEFILE|O_EXCL|0x2*/0x149a82, /*mode=*/0);
if (res != -1)
r[3] = res;
// write$cgroup_int arguments: [
// fd: fd_cgroup_int (resource)
// buf: ptr[in, int64] {
// int64 = 0x0 (18 bytes)
// }
// len: bytesize = 0x12 (8 bytes)
// ]
sprintf((char*)0x200000000040, "0x%016llx", (long long)0);
syscall(__NR_write, /*fd=*/r[3], /*buf=*/0x200000000040ul, /*len=*/0x12ul);
// sendfile arguments: [
// fdout: fd (resource)
// fdin: fd (resource)
// off: nil
// count: intptr = 0x4 (8 bytes)
// ]
syscall(__NR_sendfile, /*fdout=*/r[2], /*fdin=*/r[3], /*off=*/0ul, /*count=*/4ul);
return 0;
}
]