blob: 36615484bc16e993de51a627ac61ee7f27691a22 [file] [log] [blame]
// KMSAN: kernel-infoleak in capi_unlocked_ioctl
// https://syzkaller.appspot.com/bug?id=245acc19586c8dd9760d800af410110f2d1b9928
// status:fixed
// 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/syscall.h>
#include <sys/types.h>
#include <unistd.h>
uint64_t r[1] = {0xffffffffffffffff};
int main(void)
{
syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
long res = 0;
memcpy((void*)0x20000040, "/dev/capi20\x00", 12);
res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20000040, 0, 0);
if (res != -1)
r[0] = res;
*(uint32_t*)0x20000080 = 0;
syscall(__NR_ioctl, r[0], 0xc0044306, 0x20000080);
return 0;
}