| // WARNING in kmalloc_slab (2) |
| // https://syzkaller.appspot.com/bug?id=d88dde89ebf9081fccad49ae0dd51d0f2917009d |
| // status:fixed |
| // autogenerated by syzkaller (http://github.com/google/syzkaller) |
| |
| #define _GNU_SOURCE |
| |
| #include <fcntl.h> |
| #include <stdio.h> |
| #include <sys/stat.h> |
| #include <sys/syscall.h> |
| #include <unistd.h> |
| |
| #include <stdint.h> |
| #include <string.h> |
| |
| static uintptr_t syz_open_dev(uintptr_t a0, uintptr_t a1, uintptr_t 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)); |
| buf[sizeof(buf) - 1] = 0; |
| while ((hash = strchr(buf, '#'))) { |
| *hash = '0' + (char)(a1 % 10); |
| a1 /= 10; |
| } |
| return open(buf, a2, 0); |
| } |
| } |
| |
| long r[17]; |
| void loop() |
| { |
| memset(r, -1, sizeof(r)); |
| r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, |
| 0xfffffffffffffffful, 0x0ul); |
| memcpy((void*)0x202a0000, |
| "\x2f\x64\x65\x76\x2f\x6c\x6f\x6f\x70\x23\x00", 11); |
| r[2] = syz_open_dev(0x202a0000ul, 0x200000000004ul, 0x80ul); |
| *(uint32_t*)0x20ed6000 = (uint32_t)0x0; |
| *(uint32_t*)0x20ed6004 = (uint32_t)0x0; |
| *(uint32_t*)0x20ed6008 = (uint32_t)0x0; |
| *(uint32_t*)0x20ed600c = (uint32_t)0x0; |
| *(uint32_t*)0x20ed6010 = (uint32_t)0x6361; |
| *(uint32_t*)0x20ed6014 = (uint32_t)0xb; |
| *(uint32_t*)0x20ed6018 = (uint32_t)0xffbffffffffffffa; |
| *(uint32_t*)0x20ed601c = (uint32_t)0x1; |
| memcpy((void*)0x20ed6020, |
| "\x39\x9f\x23\x63\x1d\x00\x00\x00\x00\x00\x1a\x00\x5c\x69\x7b" |
| "\xbc\x15\xf2\x32\xe3\xeb\xd7\xbe\xd6\x5f\x90\xb0\xe6\x33\x0e" |
| "\xe7\x83\x1d\x19\xec\xf6\xaa\x04\xd5\x8d\x14\x43\x47\x44\x82" |
| "\xe8\x50\x40\xe7\x49\x47\xeb\xb5\x08\x00\x00\x00\x00\x00\x00" |
| "\x00\x30\xf3\xf3", |
| 64); |
| memcpy((void*)0x20ed6060, |
| "\xd5\xa4\x30\x74\x60\x54\x00\x00\x00\x08\xb7\xb8\x15\x79\xf6" |
| "\xa4\x1c\x01\xf7\xcf\xc1\x33\x22\x35\x82\xab\x86\x7d\xac\x76" |
| "\x7b\xaf", |
| 32); |
| *(uint64_t*)0x20ed6080 = (uint64_t)0x26; |
| *(uint64_t*)0x20ed6088 = (uint64_t)0x0; |
| *(uint32_t*)0x20ed6090 = (uint32_t)0x0; |
| r[16] = syscall(__NR_ioctl, r[2], 0xc0481273ul, 0x20ed6000ul); |
| } |
| |
| int main() |
| { |
| loop(); |
| return 0; |
| } |