Tang-ZW

Untitled

Apr 21st, 2026
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.37 KB | None | 0 0
  1. // autogenerated by syzkaller (https://github.com/google/syzkaller)
  2.  
  3. #define _GNU_SOURCE
  4.  
  5. #include <dirent.h>
  6. #include <endian.h>
  7. #include <errno.h>
  8. #include <fcntl.h>
  9. #include <signal.h>
  10. #include <stdarg.h>
  11. #include <stdbool.h>
  12. #include <stdint.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16. #include <sys/prctl.h>
  17. #include <sys/stat.h>
  18. #include <sys/syscall.h>
  19. #include <sys/types.h>
  20. #include <sys/wait.h>
  21. #include <time.h>
  22. #include <unistd.h>
  23.  
  24. static void sleep_ms(uint64_t ms)
  25. {
  26. usleep(ms * 1000);
  27. }
  28.  
  29. static uint64_t current_time_ms(void)
  30. {
  31. struct timespec ts;
  32. if (clock_gettime(CLOCK_MONOTONIC, &ts))
  33. exit(1);
  34. return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
  35. }
  36.  
  37. #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
  38. #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \
  39. *(type*)(addr) = \
  40. htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \
  41. (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))
  42.  
  43. static bool write_file(const char* file, const char* what, ...)
  44. {
  45. char buf[1024];
  46. va_list args;
  47. va_start(args, what);
  48. vsnprintf(buf, sizeof(buf), what, args);
  49. va_end(args);
  50. buf[sizeof(buf) - 1] = 0;
  51. int len = strlen(buf);
  52. int fd = open(file, O_WRONLY | O_CLOEXEC);
  53. if (fd == -1)
  54. return false;
  55. if (write(fd, buf, len) != len) {
  56. int err = errno;
  57. close(fd);
  58. errno = err;
  59. return false;
  60. }
  61. close(fd);
  62. return true;
  63. }
  64.  
  65. static void kill_and_wait(int pid, int* status)
  66. {
  67. kill(-pid, SIGKILL);
  68. kill(pid, SIGKILL);
  69. for (int i = 0; i < 100; i++) {
  70. if (waitpid(-1, status, WNOHANG | __WALL) == pid)
  71. return;
  72. usleep(1000);
  73. }
  74. DIR* dir = opendir("/sys/fs/fuse/connections");
  75. if (dir) {
  76. for (;;) {
  77. struct dirent* ent = readdir(dir);
  78. if (!ent)
  79. break;
  80. if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
  81. continue;
  82. char abort[300];
  83. snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort",
  84. ent->d_name);
  85. int fd = open(abort, O_WRONLY);
  86. if (fd == -1) {
  87. continue;
  88. }
  89. if (write(fd, abort, 1) < 0) {
  90. }
  91. close(fd);
  92. }
  93. closedir(dir);
  94. } else {
  95. }
  96. while (waitpid(-1, status, __WALL) != pid) {
  97. }
  98. }
  99.  
  100. static void setup_test()
  101. {
  102. prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
  103. setpgrp();
  104. write_file("/proc/self/oom_score_adj", "1000");
  105. }
  106.  
  107. static void execute_one(void);
  108.  
  109. #define WAIT_FLAGS __WALL
  110.  
  111. static void loop(void)
  112. {
  113. int iter = 0;
  114. for (;; iter++) {
  115. int pid = fork();
  116. if (pid < 0)
  117. exit(1);
  118. if (pid == 0) {
  119. setup_test();
  120. execute_one();
  121. exit(0);
  122. }
  123. int status = 0;
  124. uint64_t start = current_time_ms();
  125. for (;;) {
  126. sleep_ms(10);
  127. if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
  128. break;
  129. if (current_time_ms() - start < 5000)
  130. continue;
  131. kill_and_wait(pid, &status);
  132. break;
  133. }
  134. }
  135. }
  136.  
  137. void execute_one(void)
  138. {
  139. if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {
  140. }
  141. // perf_event_open arguments: [
  142. // attr: ptr[in, perf_event_attr] {
  143. // perf_event_attr {
  144. // type: perf_event_type = 0x2 (4 bytes)
  145. // size: len = 0x80 (4 bytes)
  146. // config0: int8 = 0x9 (1 bytes)
  147. // config1: int8 = 0x1 (1 bytes)
  148. // config2: int8 = 0x0 (1 bytes)
  149. // config3: int8 = 0x0 (1 bytes)
  150. // config4: const = 0x0 (4 bytes)
  151. // sample_freq: int64 = 0x2000004 (8 bytes)
  152. // sample_type: perf_sample_type = 0x100 (8 bytes)
  153. // read_format: perf_read_format = 0x4 (8 bytes)
  154. // disabled: int64 = 0x0 (0 bytes)
  155. // inherit: int64 = 0x0 (0 bytes)
  156. // pinned: int64 = 0x0 (0 bytes)
  157. // exclusive: int64 = 0x0 (0 bytes)
  158. // exclude_user: int64 = 0x0 (0 bytes)
  159. // exclude_kernel: int64 = 0x0 (0 bytes)
  160. // exclude_hv: int64 = 0x0 (0 bytes)
  161. // exclude_idle: int64 = 0x0 (0 bytes)
  162. // mmap: int64 = 0x0 (0 bytes)
  163. // comm: int64 = 0x0 (0 bytes)
  164. // freq: int64 = 0x0 (0 bytes)
  165. // inherit_stat: int64 = 0x0 (0 bytes)
  166. // enable_on_exec: int64 = 0x0 (0 bytes)
  167. // task: int64 = 0x0 (0 bytes)
  168. // watermark: int64 = 0x0 (0 bytes)
  169. // precise_ip: int64 = 0x0 (0 bytes)
  170. // mmap_data: int64 = 0x0 (0 bytes)
  171. // sample_id_all: int64 = 0x0 (0 bytes)
  172. // exclude_host: int64 = 0x0 (0 bytes)
  173. // exclude_guest: int64 = 0x0 (0 bytes)
  174. // exclude_callchain_kernel: int64 = 0x0 (0 bytes)
  175. // exclude_callchain_user: int64 = 0x0 (0 bytes)
  176. // mmap2: int64 = 0x0 (0 bytes)
  177. // comm_exec: int64 = 0x0 (0 bytes)
  178. // use_clockid: int64 = 0x0 (0 bytes)
  179. // context_switch: int64 = 0x0 (0 bytes)
  180. // write_backward: int64 = 0x0 (0 bytes)
  181. // namespaces: int64 = 0x0 (0 bytes)
  182. // ksymbol: int64 = 0x0 (0 bytes)
  183. // bpf_event: int64 = 0x0 (0 bytes)
  184. // aux_output: int64 = 0x0 (0 bytes)
  185. // cgroup: int64 = 0x0 (0 bytes)
  186. // text_poke: int64 = 0x0 (0 bytes)
  187. // build_id: int64 = 0x0 (0 bytes)
  188. // inherit_thread: int64 = 0x0 (0 bytes)
  189. // remove_on_exec: int64 = 0x0 (0 bytes)
  190. // sigtrap: int64 = 0x0 (0 bytes)
  191. // __reserved_1: const = 0x0 (8 bytes)
  192. // wakeup_events: int32 = 0x10 (4 bytes)
  193. // bp_type: perf_bp_type = 0x2 (4 bytes)
  194. // bp_config: union perf_bp_config {
  195. // perf_config_ext: perf_config_ext {
  196. // config1: int64 = 0x0 (8 bytes)
  197. // config2: int64 = 0x400000000 (8 bytes)
  198. // }
  199. // }
  200. // branch_sample_type: perf_branch_sample_type = 0x7d42 (8 bytes)
  201. // sample_regs_user: int64 = 0x1 (8 bytes)
  202. // sample_stack_user: int32 = 0x101c (4 bytes)
  203. // clockid: clock_type = 0x3 (4 bytes)
  204. // sample_regs_intr: int64 = 0x5 (8 bytes)
  205. // aux_watermark: int32 = 0x5 (4 bytes)
  206. // sample_max_stack: int16 = 0x5 (2 bytes)
  207. // __reserved_2: const = 0x0 (2 bytes)
  208. // aux_sample_size: int32 = 0x0 (4 bytes)
  209. // __reserved_3: const = 0x0 (4 bytes)
  210. // sig_data: int64 = 0x5 (8 bytes)
  211. // }
  212. // }
  213. // pid: pid (resource)
  214. // cpu: intptr = 0xffffffffffffffff (8 bytes)
  215. // group: fd_perf (resource)
  216. // flags: perf_flags = 0x0 (8 bytes)
  217. // ]
  218. // returns fd_perf
  219. *(uint32_t*)0x200000000040 = 2;
  220. *(uint32_t*)0x200000000044 = 0x80;
  221. *(uint8_t*)0x200000000048 = 9;
  222. *(uint8_t*)0x200000000049 = 1;
  223. *(uint8_t*)0x20000000004a = 0;
  224. *(uint8_t*)0x20000000004b = 0;
  225. *(uint32_t*)0x20000000004c = 0;
  226. *(uint64_t*)0x200000000050 = 0x2000004;
  227. *(uint64_t*)0x200000000058 = 0x100;
  228. *(uint64_t*)0x200000000060 = 4;
  229. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 0, 1);
  230. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 1, 1);
  231. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 2, 1);
  232. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 3, 1);
  233. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 4, 1);
  234. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 5, 1);
  235. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 6, 1);
  236. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 7, 1);
  237. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 8, 1);
  238. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 9, 1);
  239. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 10, 1);
  240. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 11, 1);
  241. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 12, 1);
  242. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 13, 1);
  243. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 14, 1);
  244. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 15, 2);
  245. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 17, 1);
  246. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 18, 1);
  247. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 19, 1);
  248. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 20, 1);
  249. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 21, 1);
  250. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 22, 1);
  251. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 23, 1);
  252. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 24, 1);
  253. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 25, 1);
  254. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 26, 1);
  255. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 27, 1);
  256. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 28, 1);
  257. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 29, 1);
  258. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 30, 1);
  259. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 31, 1);
  260. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 32, 1);
  261. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 33, 1);
  262. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 34, 1);
  263. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 35, 1);
  264. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 36, 1);
  265. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 37, 1);
  266. STORE_BY_BITMASK(uint64_t, , 0x200000000068, 0, 38, 26);
  267. *(uint32_t*)0x200000000070 = 0x10;
  268. *(uint32_t*)0x200000000074 = 2;
  269. *(uint64_t*)0x200000000078 = 0;
  270. *(uint64_t*)0x200000000080 = 0x400000000;
  271. *(uint64_t*)0x200000000088 = 0x7d42;
  272. *(uint64_t*)0x200000000090 = 1;
  273. *(uint32_t*)0x200000000098 = 0x101c;
  274. *(uint32_t*)0x20000000009c = 3;
  275. *(uint64_t*)0x2000000000a0 = 5;
  276. *(uint32_t*)0x2000000000a8 = 5;
  277. *(uint16_t*)0x2000000000ac = 5;
  278. *(uint16_t*)0x2000000000ae = 0;
  279. *(uint32_t*)0x2000000000b0 = 0;
  280. *(uint32_t*)0x2000000000b4 = 0;
  281. *(uint64_t*)0x2000000000b8 = 5;
  282. syscall(__NR_perf_event_open, /*attr=*/0x200000000040ul, /*pid=*/0,
  283. /*cpu=*/(intptr_t)-1, /*group=*/(intptr_t)-1, /*flags=*/0ul);
  284. for (int i = 0; i < 32; i++) {
  285. syscall(__NR_perf_event_open, /*attr=*/0x200000000040ul, /*pid=*/0,
  286. /*cpu=*/(intptr_t)-1, /*group=*/(intptr_t)-1, /*flags=*/0ul);
  287. }
  288. // perf_event_open arguments: [
  289. // attr: ptr[in, perf_event_attr] {
  290. // perf_event_attr {
  291. // type: perf_event_type = 0x1 (4 bytes)
  292. // size: len = 0x80 (4 bytes)
  293. // config0: int8 = 0x0 (1 bytes)
  294. // config1: int8 = 0x0 (1 bytes)
  295. // config2: int8 = 0x0 (1 bytes)
  296. // config3: int8 = 0x80000000 (1 bytes)
  297. // config4: const = 0x0 (4 bytes)
  298. // sample_freq: int64 = 0x7b (8 bytes)
  299. // sample_type: perf_sample_type = 0x0 (8 bytes)
  300. // read_format: perf_read_format = 0x0 (8 bytes)
  301. // disabled: int64 = 0x0 (0 bytes)
  302. // inherit: int64 = 0x0 (0 bytes)
  303. // pinned: int64 = 0x0 (0 bytes)
  304. // exclusive: int64 = 0x0 (0 bytes)
  305. // exclude_user: int64 = 0x0 (0 bytes)
  306. // exclude_kernel: int64 = 0x3 (0 bytes)
  307. // exclude_hv: int64 = 0x0 (0 bytes)
  308. // exclude_idle: int64 = 0x0 (0 bytes)
  309. // mmap: int64 = 0x0 (0 bytes)
  310. // comm: int64 = 0x0 (0 bytes)
  311. // freq: int64 = 0x0 (0 bytes)
  312. // inherit_stat: int64 = 0x0 (0 bytes)
  313. // enable_on_exec: int64 = 0x0 (0 bytes)
  314. // task: int64 = 0x0 (0 bytes)
  315. // watermark: int64 = 0x0 (0 bytes)
  316. // precise_ip: int64 = 0x0 (0 bytes)
  317. // mmap_data: int64 = 0x0 (0 bytes)
  318. // sample_id_all: int64 = 0x0 (0 bytes)
  319. // exclude_host: int64 = 0x0 (0 bytes)
  320. // exclude_guest: int64 = 0x0 (0 bytes)
  321. // exclude_callchain_kernel: int64 = 0x0 (0 bytes)
  322. // exclude_callchain_user: int64 = 0x2008000000 (0 bytes)
  323. // mmap2: int64 = 0x0 (0 bytes)
  324. // comm_exec: int64 = 0x0 (0 bytes)
  325. // use_clockid: int64 = 0x0 (0 bytes)
  326. // context_switch: int64 = 0x0 (0 bytes)
  327. // write_backward: int64 = 0x0 (0 bytes)
  328. // namespaces: int64 = 0x0 (0 bytes)
  329. // ksymbol: int64 = 0x0 (0 bytes)
  330. // bpf_event: int64 = 0x0 (0 bytes)
  331. // aux_output: int64 = 0x0 (0 bytes)
  332. // cgroup: int64 = 0x0 (0 bytes)
  333. // text_poke: int64 = 0x0 (0 bytes)
  334. // build_id: int64 = 0x0 (0 bytes)
  335. // inherit_thread: int64 = 0x0 (0 bytes)
  336. // remove_on_exec: int64 = 0x0 (0 bytes)
  337. // sigtrap: int64 = 0x0 (0 bytes)
  338. // __reserved_1: const = 0x0 (8 bytes)
  339. // wakeup_events: int32 = 0x0 (4 bytes)
  340. // bp_type: perf_bp_type = 0x0 (4 bytes)
  341. // bp_config: union perf_bp_config {
  342. // perf_bp: perf_bp {
  343. // bp_addr: nil
  344. // bp_len: perf_bp_lens = 0x0 (8 bytes)
  345. // }
  346. // }
  347. // branch_sample_type: perf_branch_sample_type = 0x0 (8 bytes)
  348. // sample_regs_user: int64 = 0x0 (8 bytes)
  349. // sample_stack_user: int32 = 0x0 (4 bytes)
  350. // clockid: clock_type = 0x0 (4 bytes)
  351. // sample_regs_intr: int64 = 0x0 (8 bytes)
  352. // aux_watermark: int32 = 0x0 (4 bytes)
  353. // sample_max_stack: int16 = 0x0 (2 bytes)
  354. // __reserved_2: const = 0x0 (2 bytes)
  355. // aux_sample_size: int32 = 0x0 (4 bytes)
  356. // __reserved_3: const = 0x0 (4 bytes)
  357. // sig_data: int64 = 0x0 (8 bytes)
  358. // }
  359. // }
  360. // pid: pid (resource)
  361. // cpu: intptr = 0xffffffffffffffff (8 bytes)
  362. // group: fd_perf (resource)
  363. // flags: perf_flags = 0x0 (8 bytes)
  364. // ]
  365. // returns fd_perf
  366. *(uint32_t*)0x20000001d000 = 1;
  367. *(uint32_t*)0x20000001d004 = 0x80;
  368. *(uint8_t*)0x20000001d008 = 0;
  369. *(uint8_t*)0x20000001d009 = 0;
  370. *(uint8_t*)0x20000001d00a = 0;
  371. *(uint8_t*)0x20000001d00b = 0;
  372. *(uint32_t*)0x20000001d00c = 0;
  373. *(uint64_t*)0x20000001d010 = 0x7b;
  374. *(uint64_t*)0x20000001d018 = 0;
  375. *(uint64_t*)0x20000001d020 = 0;
  376. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 0, 1);
  377. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 1, 1);
  378. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 2, 1);
  379. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 3, 1);
  380. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 4, 1);
  381. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 3, 5, 1);
  382. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 6, 1);
  383. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 7, 1);
  384. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 8, 1);
  385. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 9, 1);
  386. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 10, 1);
  387. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 11, 1);
  388. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 12, 1);
  389. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 13, 1);
  390. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 14, 1);
  391. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 15, 2);
  392. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 17, 1);
  393. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 18, 1);
  394. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 19, 1);
  395. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 20, 1);
  396. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 21, 1);
  397. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0x2008000000, 22, 1);
  398. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 23, 1);
  399. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 24, 1);
  400. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 25, 1);
  401. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 26, 1);
  402. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 27, 1);
  403. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 28, 1);
  404. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 29, 1);
  405. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 30, 1);
  406. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 31, 1);
  407. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 32, 1);
  408. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 33, 1);
  409. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 34, 1);
  410. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 35, 1);
  411. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 36, 1);
  412. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 37, 1);
  413. STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 38, 26);
  414. *(uint32_t*)0x20000001d030 = 0;
  415. *(uint32_t*)0x20000001d034 = 0;
  416. *(uint64_t*)0x20000001d038 = 0;
  417. *(uint64_t*)0x20000001d040 = 0;
  418. *(uint64_t*)0x20000001d048 = 0;
  419. *(uint64_t*)0x20000001d050 = 0;
  420. *(uint32_t*)0x20000001d058 = 0;
  421. *(uint32_t*)0x20000001d05c = 0;
  422. *(uint64_t*)0x20000001d060 = 0;
  423. *(uint32_t*)0x20000001d068 = 0;
  424. *(uint16_t*)0x20000001d06c = 0;
  425. *(uint16_t*)0x20000001d06e = 0;
  426. *(uint32_t*)0x20000001d070 = 0;
  427. *(uint32_t*)0x20000001d074 = 0;
  428. *(uint64_t*)0x20000001d078 = 0;
  429. syscall(__NR_perf_event_open, /*attr=*/0x20000001d000ul, /*pid=*/0,
  430. /*cpu=*/(intptr_t)-1, /*group=*/(intptr_t)-1, /*flags=*/0ul);
  431. }
  432. int main(void)
  433. {
  434. syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul,
  435. /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul,
  436. /*fd=*/(intptr_t)-1, /*offset=*/0ul);
  437. syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul,
  438. /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul,
  439. /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul,
  440. /*fd=*/(intptr_t)-1, /*offset=*/0ul);
  441. syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul,
  442. /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul,
  443. /*fd=*/(intptr_t)-1, /*offset=*/0ul);
  444. const char* reason;
  445. (void)reason;
  446. loop();
  447. return 0;
  448. }
  449.  
Advertisement
Add Comment
Please, Sign In to add comment