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[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};
int main(void)
{
syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*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)) {}
// openat$nullb arguments: [
// fd: const = 0xffffffffffffff9c (8 bytes)
// file: ptr[in, buffer] {
// buffer: {2f 64 65 76 2f 6e 75 6c 6c 62 30 00} (length 0xc)
// }
// flags: open_flags = 0x48882 (4 bytes)
// mode: const = 0x0 (2 bytes)
// ]
// returns fd_block
memcpy((void*)0x200000001000, "/dev/nullb0\000", 12);
res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000001000ul, /*flags=O_NONBLOCK|O_NOATIME|O_LARGEFILE|O_EXCL|O_RDWR*/0x48882, /*mode=*/0);
if (res != -1)
r[0] = res;
// dup arguments: [
// oldfd: fd (resource)
// ]
// returns fd
res = syscall(__NR_dup, /*oldfd=*/r[0]);
if (res != -1)
r[1] = res;
// fallocate arguments: [
// fd: fd (resource)
// mode: fallocate_mode = 0x11 (8 bytes)
// off: intptr = 0x0 (8 bytes)
// len: intptr = 0x4000000000052000 (8 bytes)
// ]
syscall(__NR_fallocate, /*fd=*/r[1], /*mode=FALLOC_FL_ZERO_RANGE|FALLOC_FL_KEEP_SIZE*/0x11ul, /*off=*/0ul, /*len=*/0x4000000000052000ul);
// openat$nullb arguments: [
// fd: const = 0xffffffffffffff9c (8 bytes)
// file: ptr[in, buffer] {
// buffer: {2f 64 65 76 2f 6e 75 6c 6c 62 30 00} (length 0xc)
// }
// flags: open_flags = 0x4000000004002 (4 bytes)
// mode: const = 0x0 (2 bytes)
// ]
// returns fd_block
memcpy((void*)0x200000000240, "/dev/nullb0\000", 12);
res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000240ul, /*flags=O_DIRECT|O_RDWR*/0x4002, /*mode=*/0);
if (res != -1)
r[2] = res;
// mmap arguments: [
// addr: VMA[0xe7e000]
// len: len = 0xe7e000 (4 bytes)
// prot: mmap_prot = 0x200000e (8 bytes)
// flags: mmap_flags = 0x13 (8 bytes)
// fd: fd (resource)
// offset: intptr = 0x0 (8 bytes)
// ]
syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0xe7e000, /*prot=PROT_GROWSUP|PROT_SEM|PROT_WRITE|PROT_EXEC*/0x200000eul, /*flags=MAP_SHARED_VALIDATE|MAP_FIXED*/0x13ul, /*fd=*/r[2], /*offset=*/0ul);
return 0;
}
]