// https://syzkaller.appspot.com/bug?id=e5aec54f6af0730f1ebfb6fbf4e53409ae0a5c87 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2) { if (a0 == 0xc || a0 == 0xb) { char buf[128]; sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2); return open(buf, O_RDWR, 0); } else { char buf[1024]; char* hash; strncpy(buf, (char*)a0, sizeof(buf) - 1); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(a1 % 10); a1 /= 10; } return open(buf, a2, 0); } } uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); intptr_t res = 0; memcpy((void*)0x20000200, "/dev/swradio#\000", 14); res = syz_open_dev(0x20000200, 1, 2); if (res != -1) r[0] = res; *(uint32_t*)0x20000440 = 0; *(uint32_t*)0x20000444 = 9; *(uint32_t*)0x20000448 = 4; *(uint32_t*)0x20000450 = 0xb; *(uint32_t*)0x20000458 = 0; *(uint32_t*)0x2000045c = 1; *(uint8_t*)0x20000460 = 0; *(uint8_t*)0x20000461 = 0; *(uint8_t*)0x20000462 = 0; *(uint8_t*)0x20000463 = 0; *(uint8_t*)0x20000464 = 0; *(uint8_t*)0x20000465 = 0; *(uint8_t*)0x20000466 = 0; *(uint8_t*)0x20000467 = 0; *(uint8_t*)0x20000468 = 0; *(uint8_t*)0x20000469 = 0; *(uint8_t*)0x2000046a = 0; *(uint8_t*)0x2000046b = 0; *(uint8_t*)0x2000046c = 0; *(uint8_t*)0x2000046d = 0; *(uint8_t*)0x2000046e = 0; *(uint8_t*)0x2000046f = 0; *(uint8_t*)0x20000470 = 0; *(uint8_t*)0x20000471 = 0; *(uint8_t*)0x20000472 = 0; *(uint8_t*)0x20000473 = 0; *(uint8_t*)0x20000474 = 0; *(uint8_t*)0x20000475 = 0; *(uint8_t*)0x20000476 = 0; *(uint8_t*)0x20000477 = 0; *(uint32_t*)0x20000520 = -1; *(uint32_t*)0x20000524 = 0; *(uint32_t*)0x20000528 = 0; *(uint32_t*)0x2000052c = 0; *(uint32_t*)0x20000530 = 0; *(uint32_t*)0x20000534 = 0; *(uint32_t*)0x20000538 = 0; *(uint32_t*)0x2000053c = 0; syscall(__NR_ioctl, r[0], 0xc100565c, 0x20000440ul); *(uint32_t*)0x20000440 = 0; *(uint32_t*)0x20000444 = 9; *(uint32_t*)0x20000448 = 1; *(uint32_t*)0x20000450 = 0xb; *(uint32_t*)0x20000458 = 0; *(uint32_t*)0x2000045c = 0x100000ff; *(uint32_t*)0x20000460 = 0; *(uint32_t*)0x20000464 = 0; *(uint32_t*)0x20000468 = 0; *(uint32_t*)0x2000046c = 0; *(uint32_t*)0x20000470 = 0; *(uint32_t*)0x20000474 = 0; *(uint32_t*)0x20000478 = 0; *(uint32_t*)0x2000047c = 0; *(uint32_t*)0x20000480 = 0; *(uint32_t*)0x20000484 = 0; *(uint32_t*)0x20000520 = 0; *(uint32_t*)0x20000524 = 0; *(uint32_t*)0x20000528 = 0; *(uint32_t*)0x2000052c = 0; *(uint32_t*)0x20000530 = 0; *(uint32_t*)0x20000534 = 0; *(uint32_t*)0x20000538 = 0; *(uint32_t*)0x2000053c = 0; syscall(__NR_ioctl, r[0], 0xc100565c, 0x20000440ul); return 0; }