Tang-ZW

Untitled

Feb 4th, 2026
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.15 KB | None | 0 0
  1. #define _GNU_SOURCE
  2.  
  3. #include <arpa/inet.h>
  4. #include <dirent.h>
  5. #include <endian.h>
  6. #include <errno.h>
  7. #include <fcntl.h>
  8. #include <net/if.h>
  9. #include <netinet/in.h>
  10. #include <setjmp.h>
  11. #include <signal.h>
  12. #include <stdarg.h>
  13. #include <stdbool.h>
  14. #include <stdint.h>
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18. #include <sys/prctl.h>
  19. #include <sys/socket.h>
  20. #include <sys/stat.h>
  21. #include <sys/syscall.h>
  22. #include <sys/types.h>
  23. #include <sys/wait.h>
  24. #include <time.h>
  25. #include <unistd.h>
  26.  
  27. #include <linux/genetlink.h>
  28. #include <linux/if_addr.h>
  29. #include <linux/if_link.h>
  30. #include <linux/in6.h>
  31. #include <linux/neighbour.h>
  32. #include <linux/net.h>
  33. #include <linux/netlink.h>
  34. #include <linux/rtnetlink.h>
  35. #include <linux/veth.h>
  36.  
  37. static __thread int clone_ongoing;
  38. static __thread int skip_segv;
  39. static __thread jmp_buf segv_env;
  40.  
  41. static void segv_handler(int sig, siginfo_t* info, void* ctx)
  42. {
  43. if (__atomic_load_n(&clone_ongoing, __ATOMIC_RELAXED) != 0) {
  44. exit(sig);
  45. }
  46. uintptr_t addr = (uintptr_t)info->si_addr;
  47. const uintptr_t prog_start = 1 << 20;
  48. const uintptr_t prog_end = 100 << 20;
  49. int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0;
  50. int valid = addr < prog_start || addr > prog_end;
  51. if (skip && valid) {
  52. _longjmp(segv_env, 1);
  53. }
  54. exit(sig);
  55. }
  56.  
  57. static void install_segv_handler(void)
  58. {
  59. struct sigaction sa;
  60. memset(&sa, 0, sizeof(sa));
  61. sa.sa_handler = SIG_IGN;
  62. syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8);
  63. syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8);
  64. memset(&sa, 0, sizeof(sa));
  65. sa.sa_sigaction = segv_handler;
  66. sa.sa_flags = SA_NODEFER | SA_SIGINFO;
  67. sigaction(SIGSEGV, &sa, NULL);
  68. sigaction(SIGBUS, &sa, NULL);
  69. }
  70.  
  71. #define NONFAILING(...) \
  72. ({ \
  73. int ok = 1; \
  74. __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \
  75. if (_setjmp(segv_env) == 0) { \
  76. __VA_ARGS__; \
  77. } else \
  78. ok = 0; \
  79. __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \
  80. ok; \
  81. })
  82.  
  83. static void sleep_ms(uint64_t ms)
  84. {
  85. usleep(ms * 1000);
  86. }
  87.  
  88. static uint64_t current_time_ms(void)
  89. {
  90. struct timespec ts;
  91. if (clock_gettime(CLOCK_MONOTONIC, &ts))
  92. exit(1);
  93. return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
  94. }
  95.  
  96. #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
  97. #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \
  98. *(type*)(addr) = \
  99. htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \
  100. (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))
  101.  
  102. static bool write_file(const char* file, const char* what, ...)
  103. {
  104. char buf[1024];
  105. va_list args;
  106. va_start(args, what);
  107. vsnprintf(buf, sizeof(buf), what, args);
  108. va_end(args);
  109. buf[sizeof(buf) - 1] = 0;
  110. int len = strlen(buf);
  111. int fd = open(file, O_WRONLY | O_CLOEXEC);
  112. if (fd == -1)
  113. return false;
  114. if (write(fd, buf, len) != len) {
  115. int err = errno;
  116. close(fd);
  117. errno = err;
  118. return false;
  119. }
  120. close(fd);
  121. return true;
  122. }
  123.  
  124. struct nlmsg {
  125. char* pos;
  126. int nesting;
  127. struct nlattr* nested[8];
  128. char buf[4096];
  129. };
  130.  
  131. static void netlink_init(struct nlmsg* nlmsg, int typ, int flags,
  132. const void* data, int size)
  133. {
  134. memset(nlmsg, 0, sizeof(*nlmsg));
  135. struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf;
  136. hdr->nlmsg_type = typ;
  137. hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags;
  138. memcpy(hdr + 1, data, size);
  139. nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size);
  140. }
  141.  
  142. static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data,
  143. int size)
  144. {
  145. struct nlattr* attr = (struct nlattr*)nlmsg->pos;
  146. attr->nla_len = sizeof(*attr) + size;
  147. attr->nla_type = typ;
  148. if (size > 0)
  149. memcpy(attr + 1, data, size);
  150. nlmsg->pos += NLMSG_ALIGN(attr->nla_len);
  151. }
  152.  
  153. static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type,
  154. int* reply_len, bool dofail)
  155. {
  156. if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting)
  157. exit(1);
  158. struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf;
  159. hdr->nlmsg_len = nlmsg->pos - nlmsg->buf;
  160. struct sockaddr_nl addr;
  161. memset(&addr, 0, sizeof(addr));
  162. addr.nl_family = AF_NETLINK;
  163. ssize_t n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0,
  164. (struct sockaddr*)&addr, sizeof(addr));
  165. if (n != (ssize_t)hdr->nlmsg_len) {
  166. if (dofail)
  167. exit(1);
  168. return -1;
  169. }
  170. n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0);
  171. if (reply_len)
  172. *reply_len = 0;
  173. if (n < 0) {
  174. if (dofail)
  175. exit(1);
  176. return -1;
  177. }
  178. if (n < (ssize_t)sizeof(struct nlmsghdr)) {
  179. errno = EINVAL;
  180. if (dofail)
  181. exit(1);
  182. return -1;
  183. }
  184. if (hdr->nlmsg_type == NLMSG_DONE)
  185. return 0;
  186. if (reply_len && hdr->nlmsg_type == reply_type) {
  187. *reply_len = n;
  188. return 0;
  189. }
  190. if (n < (ssize_t)(sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr))) {
  191. errno = EINVAL;
  192. if (dofail)
  193. exit(1);
  194. return -1;
  195. }
  196. if (hdr->nlmsg_type != NLMSG_ERROR) {
  197. errno = EINVAL;
  198. if (dofail)
  199. exit(1);
  200. return -1;
  201. }
  202. errno = -((struct nlmsgerr*)(hdr + 1))->error;
  203. return -errno;
  204. }
  205.  
  206. static int netlink_query_family_id(struct nlmsg* nlmsg, int sock,
  207. const char* family_name, bool dofail)
  208. {
  209. struct genlmsghdr genlhdr;
  210. memset(&genlhdr, 0, sizeof(genlhdr));
  211. genlhdr.cmd = CTRL_CMD_GETFAMILY;
  212. netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr));
  213. netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, family_name,
  214. strnlen(family_name, GENL_NAMSIZ - 1) + 1);
  215. int n = 0;
  216. int err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n, dofail);
  217. if (err < 0) {
  218. return -1;
  219. }
  220. uint16_t id = 0;
  221. struct nlattr* attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN +
  222. NLMSG_ALIGN(sizeof(genlhdr)));
  223. for (; (char*)attr < nlmsg->buf + n;
  224. attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) {
  225. if (attr->nla_type == CTRL_ATTR_FAMILY_ID) {
  226. id = *(uint16_t*)(attr + 1);
  227. break;
  228. }
  229. }
  230. if (!id) {
  231. errno = EINVAL;
  232. return -1;
  233. }
  234. recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0);
  235. return id;
  236. }
  237.  
  238. static long syz_genetlink_get_family_id(volatile long name,
  239. volatile long sock_arg)
  240. {
  241. int fd = sock_arg;
  242. if (fd < 0) {
  243. fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
  244. if (fd == -1) {
  245. return -1;
  246. }
  247. }
  248. struct nlmsg nlmsg_tmp;
  249. int ret = netlink_query_family_id(&nlmsg_tmp, fd, (char*)name, false);
  250. if ((int)sock_arg < 0)
  251. close(fd);
  252. if (ret < 0) {
  253. return -1;
  254. }
  255. return ret;
  256. }
  257.  
  258. static void kill_and_wait(int pid, int* status)
  259. {
  260. kill(-pid, SIGKILL);
  261. kill(pid, SIGKILL);
  262. for (int i = 0; i < 100; i++) {
  263. if (waitpid(-1, status, WNOHANG | __WALL) == pid)
  264. return;
  265. usleep(1000);
  266. }
  267. DIR* dir = opendir("/sys/fs/fuse/connections");
  268. if (dir) {
  269. for (;;) {
  270. struct dirent* ent = readdir(dir);
  271. if (!ent)
  272. break;
  273. if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
  274. continue;
  275. char abort[300];
  276. snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort",
  277. ent->d_name);
  278. int fd = open(abort, O_WRONLY);
  279. if (fd == -1) {
  280. continue;
  281. }
  282. if (write(fd, abort, 1) < 0) {
  283. }
  284. close(fd);
  285. }
  286. closedir(dir);
  287. } else {
  288. }
  289. while (waitpid(-1, status, __WALL) != pid) {
  290. }
  291. }
  292.  
  293. static void setup_test()
  294. {
  295. prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
  296. setpgrp();
  297. write_file("/proc/self/oom_score_adj", "1000");
  298. }
  299.  
  300. static void execute_one(void);
  301.  
  302. #define WAIT_FLAGS __WALL
  303.  
  304. static void loop(void)
  305. {
  306. int iter = 0;
  307. for (;; iter++) {
  308. int pid = fork();
  309. if (pid < 0)
  310. exit(1);
  311. if (pid == 0) {
  312. setup_test();
  313. execute_one();
  314. exit(0);
  315. }
  316. int status = 0;
  317. uint64_t start = current_time_ms();
  318. for (;;) {
  319. sleep_ms(10);
  320. if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
  321. break;
  322. if (current_time_ms() - start < 5000)
  323. continue;
  324. kill_and_wait(pid, &status);
  325. break;
  326. }
  327. }
  328. }
  329.  
  330. uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};
  331.  
  332. void execute_one(void)
  333. {
  334. intptr_t res = 0;
  335. if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {
  336. }
  337. // perf_event_open arguments: [
  338. // attr: ptr[in, perf_event_attr] {
  339. // perf_event_attr {
  340. // type: perf_event_type = 0x1 (4 bytes)
  341. // size: len = 0x80 (4 bytes)
  342. // config0: int8 = 0x1 (1 bytes)
  343. // config1: int8 = 0x0 (1 bytes)
  344. // config2: int8 = 0x0 (1 bytes)
  345. // config3: int8 = 0x0 (1 bytes)
  346. // config4: const = 0x0 (4 bytes)
  347. // sample_freq: int64 = 0x18a (8 bytes)
  348. // sample_type: perf_sample_type = 0x0 (8 bytes)
  349. // read_format: perf_read_format = 0x0 (8 bytes)
  350. // disabled: int64 = 0x0 (0 bytes)
  351. // inherit: int64 = 0x0 (0 bytes)
  352. // pinned: int64 = 0x0 (0 bytes)
  353. // exclusive: int64 = 0x0 (0 bytes)
  354. // exclude_user: int64 = 0x0 (0 bytes)
  355. // exclude_kernel: int64 = 0x0 (0 bytes)
  356. // exclude_hv: int64 = 0x0 (0 bytes)
  357. // exclude_idle: int64 = 0x0 (0 bytes)
  358. // mmap: int64 = 0x0 (0 bytes)
  359. // comm: int64 = 0x0 (0 bytes)
  360. // freq: int64 = 0x0 (0 bytes)
  361. // inherit_stat: int64 = 0x0 (0 bytes)
  362. // enable_on_exec: int64 = 0x0 (0 bytes)
  363. // task: int64 = 0x0 (0 bytes)
  364. // watermark: int64 = 0x0 (0 bytes)
  365. // precise_ip: int64 = 0x0 (0 bytes)
  366. // mmap_data: int64 = 0x0 (0 bytes)
  367. // sample_id_all: int64 = 0x0 (0 bytes)
  368. // exclude_host: int64 = 0x0 (0 bytes)
  369. // exclude_guest: int64 = 0x0 (0 bytes)
  370. // exclude_callchain_kernel: int64 = 0x0 (0 bytes)
  371. // exclude_callchain_user: int64 = 0x0 (0 bytes)
  372. // mmap2: int64 = 0x0 (0 bytes)
  373. // comm_exec: int64 = 0x0 (0 bytes)
  374. // use_clockid: int64 = 0x0 (0 bytes)
  375. // context_switch: int64 = 0x0 (0 bytes)
  376. // write_backward: int64 = 0x0 (0 bytes)
  377. // namespaces: int64 = 0x0 (0 bytes)
  378. // ksymbol: int64 = 0x0 (0 bytes)
  379. // bpf_event: int64 = 0x0 (0 bytes)
  380. // aux_output: int64 = 0x0 (0 bytes)
  381. // cgroup: int64 = 0x0 (0 bytes)
  382. // text_poke: int64 = 0x0 (0 bytes)
  383. // build_id: int64 = 0x0 (0 bytes)
  384. // inherit_thread: int64 = 0x0 (0 bytes)
  385. // remove_on_exec: int64 = 0x0 (0 bytes)
  386. // sigtrap: int64 = 0x0 (0 bytes)
  387. // __reserved_1: const = 0x0 (8 bytes)
  388. // wakeup_events: int32 = 0x0 (4 bytes)
  389. // bp_type: perf_bp_type = 0x0 (4 bytes)
  390. // bp_config: union perf_bp_config {
  391. // perf_config_ext: perf_config_ext {
  392. // config1: int64 = 0x2 (8 bytes)
  393. // config2: int64 = 0xe (8 bytes)
  394. // }
  395. // }
  396. // branch_sample_type: perf_branch_sample_type = 0x0 (8 bytes)
  397. // sample_regs_user: int64 = 0x0 (8 bytes)
  398. // sample_stack_user: int32 = 0x0 (4 bytes)
  399. // clockid: clock_type = 0x0 (4 bytes)
  400. // sample_regs_intr: int64 = 0x0 (8 bytes)
  401. // aux_watermark: int32 = 0x0 (4 bytes)
  402. // sample_max_stack: int16 = 0x3 (2 bytes)
  403. // __reserved_2: const = 0x0 (2 bytes)
  404. // aux_sample_size: int32 = 0x0 (4 bytes)
  405. // __reserved_3: const = 0x0 (4 bytes)
  406. // sig_data: int64 = 0x0 (8 bytes)
  407. // }
  408. // }
  409. // pid: pid (resource)
  410. // cpu: intptr = 0xffffffffffffffff (8 bytes)
  411. // group: fd_perf (resource)
  412. // flags: perf_flags = 0x0 (8 bytes)
  413. // ]
  414. // returns fd_perf
  415. NONFAILING(*(uint32_t*)0x20000001d000 = 1);
  416. NONFAILING(*(uint32_t*)0x20000001d004 = 0x80);
  417. NONFAILING(*(uint8_t*)0x20000001d008 = 1);
  418. NONFAILING(*(uint8_t*)0x20000001d009 = 0);
  419. NONFAILING(*(uint8_t*)0x20000001d00a = 0);
  420. NONFAILING(*(uint8_t*)0x20000001d00b = 0);
  421. NONFAILING(*(uint32_t*)0x20000001d00c = 0);
  422. NONFAILING(*(uint64_t*)0x20000001d010 = 0x18a);
  423. NONFAILING(*(uint64_t*)0x20000001d018 = 0);
  424. NONFAILING(*(uint64_t*)0x20000001d020 = 0);
  425. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 0, 1));
  426. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 1, 1));
  427. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 2, 1));
  428. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 3, 1));
  429. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 4, 1));
  430. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 5, 1));
  431. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 6, 1));
  432. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 7, 1));
  433. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 8, 1));
  434. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 9, 1));
  435. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 10, 1));
  436. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 11, 1));
  437. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 12, 1));
  438. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 13, 1));
  439. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 14, 1));
  440. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 15, 2));
  441. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 17, 1));
  442. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 18, 1));
  443. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 19, 1));
  444. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 20, 1));
  445. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 21, 1));
  446. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 22, 1));
  447. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 23, 1));
  448. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 24, 1));
  449. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 25, 1));
  450. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 26, 1));
  451. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 27, 1));
  452. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 28, 1));
  453. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 29, 1));
  454. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 30, 1));
  455. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 31, 1));
  456. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 32, 1));
  457. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 33, 1));
  458. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 34, 1));
  459. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 35, 1));
  460. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 36, 1));
  461. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 37, 1));
  462. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 38, 26));
  463. NONFAILING(*(uint32_t*)0x20000001d030 = 0);
  464. NONFAILING(*(uint32_t*)0x20000001d034 = 0);
  465. NONFAILING(*(uint64_t*)0x20000001d038 = 2);
  466. NONFAILING(*(uint64_t*)0x20000001d040 = 0xe);
  467. NONFAILING(*(uint64_t*)0x20000001d048 = 0);
  468. NONFAILING(*(uint64_t*)0x20000001d050 = 0);
  469. NONFAILING(*(uint32_t*)0x20000001d058 = 0);
  470. NONFAILING(*(uint32_t*)0x20000001d05c = 0);
  471. NONFAILING(*(uint64_t*)0x20000001d060 = 0);
  472. NONFAILING(*(uint32_t*)0x20000001d068 = 0);
  473. NONFAILING(*(uint16_t*)0x20000001d06c = 3);
  474. NONFAILING(*(uint16_t*)0x20000001d06e = 0);
  475. NONFAILING(*(uint32_t*)0x20000001d070 = 0);
  476. NONFAILING(*(uint32_t*)0x20000001d074 = 0);
  477. NONFAILING(*(uint64_t*)0x20000001d078 = 0);
  478. res = syscall(__NR_perf_event_open, /*attr=*/0x20000001d000ul, /*pid=*/0,
  479. /*cpu=*/(intptr_t)-1, /*group=*/(intptr_t)-1, /*flags=*/0ul);
  480. if (res != -1)
  481. r[0] = res;
  482. // perf_event_open arguments: [
  483. // attr: ptr[in, perf_event_attr] {
  484. // perf_event_attr {
  485. // type: perf_event_type = 0x3 (4 bytes)
  486. // size: len = 0x80 (4 bytes)
  487. // config0: int8 = 0x0 (1 bytes)
  488. // config1: int8 = 0x0 (1 bytes)
  489. // config2: int8 = 0x0 (1 bytes)
  490. // config3: int8 = 0x0 (1 bytes)
  491. // config4: const = 0x0 (4 bytes)
  492. // sample_freq: int64 = 0x588 (8 bytes)
  493. // sample_type: perf_sample_type = 0x0 (8 bytes)
  494. // read_format: perf_read_format = 0x0 (8 bytes)
  495. // disabled: int64 = 0x0 (0 bytes)
  496. // inherit: int64 = 0x0 (0 bytes)
  497. // pinned: int64 = 0x0 (0 bytes)
  498. // exclusive: int64 = 0x0 (0 bytes)
  499. // exclude_user: int64 = 0x0 (0 bytes)
  500. // exclude_kernel: int64 = 0x0 (0 bytes)
  501. // exclude_hv: int64 = 0x0 (0 bytes)
  502. // exclude_idle: int64 = 0x0 (0 bytes)
  503. // mmap: int64 = 0x0 (0 bytes)
  504. // comm: int64 = 0x0 (0 bytes)
  505. // freq: int64 = 0x0 (0 bytes)
  506. // inherit_stat: int64 = 0x0 (0 bytes)
  507. // enable_on_exec: int64 = 0x0 (0 bytes)
  508. // task: int64 = 0x0 (0 bytes)
  509. // watermark: int64 = 0x0 (0 bytes)
  510. // precise_ip: int64 = 0x0 (0 bytes)
  511. // mmap_data: int64 = 0x0 (0 bytes)
  512. // sample_id_all: int64 = 0x0 (0 bytes)
  513. // exclude_host: int64 = 0x0 (0 bytes)
  514. // exclude_guest: int64 = 0x0 (0 bytes)
  515. // exclude_callchain_kernel: int64 = 0x0 (0 bytes)
  516. // exclude_callchain_user: int64 = 0x0 (0 bytes)
  517. // mmap2: int64 = 0x0 (0 bytes)
  518. // comm_exec: int64 = 0x0 (0 bytes)
  519. // use_clockid: int64 = 0x0 (0 bytes)
  520. // context_switch: int64 = 0x0 (0 bytes)
  521. // write_backward: int64 = 0x0 (0 bytes)
  522. // namespaces: int64 = 0x0 (0 bytes)
  523. // ksymbol: int64 = 0x0 (0 bytes)
  524. // bpf_event: int64 = 0x0 (0 bytes)
  525. // aux_output: int64 = 0x0 (0 bytes)
  526. // cgroup: int64 = 0x0 (0 bytes)
  527. // text_poke: int64 = 0x0 (0 bytes)
  528. // build_id: int64 = 0x0 (0 bytes)
  529. // inherit_thread: int64 = 0x0 (0 bytes)
  530. // remove_on_exec: int64 = 0x0 (0 bytes)
  531. // sigtrap: int64 = 0x0 (0 bytes)
  532. // __reserved_1: const = 0x0 (8 bytes)
  533. // wakeup_events: int32 = 0x0 (4 bytes)
  534. // bp_type: perf_bp_type = 0x0 (4 bytes)
  535. // bp_config: union perf_bp_config {
  536. // perf_bp: perf_bp {
  537. // bp_addr: nil
  538. // bp_len: perf_bp_lens = 0x0 (8 bytes)
  539. // }
  540. // }
  541. // branch_sample_type: perf_branch_sample_type = 0x0 (8 bytes)
  542. // sample_regs_user: int64 = 0x0 (8 bytes)
  543. // sample_stack_user: int32 = 0x80bd5 (4 bytes)
  544. // clockid: clock_type = 0x0 (4 bytes)
  545. // sample_regs_intr: int64 = 0x0 (8 bytes)
  546. // aux_watermark: int32 = 0x5 (4 bytes)
  547. // sample_max_stack: int16 = 0x8 (2 bytes)
  548. // __reserved_2: const = 0x0 (2 bytes)
  549. // aux_sample_size: int32 = 0x0 (4 bytes)
  550. // __reserved_3: const = 0x0 (4 bytes)
  551. // sig_data: int64 = 0x0 (8 bytes)
  552. // }
  553. // }
  554. // pid: pid (resource)
  555. // cpu: intptr = 0xffffffffffffffff (8 bytes)
  556. // group: fd_perf (resource)
  557. // flags: perf_flags = 0x0 (8 bytes)
  558. // ]
  559. // returns fd_perf
  560. NONFAILING(*(uint32_t*)0x20000001d000 = 3);
  561. NONFAILING(*(uint32_t*)0x20000001d004 = 0x80);
  562. NONFAILING(*(uint8_t*)0x20000001d008 = 0);
  563. NONFAILING(*(uint8_t*)0x20000001d009 = 0);
  564. NONFAILING(*(uint8_t*)0x20000001d00a = 0);
  565. NONFAILING(*(uint8_t*)0x20000001d00b = 0);
  566. NONFAILING(*(uint32_t*)0x20000001d00c = 0);
  567. NONFAILING(*(uint64_t*)0x20000001d010 = 0x588);
  568. NONFAILING(*(uint64_t*)0x20000001d018 = 0);
  569. NONFAILING(*(uint64_t*)0x20000001d020 = 0);
  570. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 0, 1));
  571. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 1, 1));
  572. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 2, 1));
  573. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 3, 1));
  574. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 4, 1));
  575. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 5, 1));
  576. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 6, 1));
  577. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 7, 1));
  578. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 8, 1));
  579. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 9, 1));
  580. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 10, 1));
  581. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 11, 1));
  582. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 12, 1));
  583. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 13, 1));
  584. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 14, 1));
  585. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 15, 2));
  586. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 17, 1));
  587. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 18, 1));
  588. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 19, 1));
  589. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 20, 1));
  590. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 21, 1));
  591. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 22, 1));
  592. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 23, 1));
  593. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 24, 1));
  594. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 25, 1));
  595. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 26, 1));
  596. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 27, 1));
  597. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 28, 1));
  598. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 29, 1));
  599. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 30, 1));
  600. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 31, 1));
  601. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 32, 1));
  602. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 33, 1));
  603. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 34, 1));
  604. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 35, 1));
  605. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 36, 1));
  606. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 37, 1));
  607. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 38, 26));
  608. NONFAILING(*(uint32_t*)0x20000001d030 = 0);
  609. NONFAILING(*(uint32_t*)0x20000001d034 = 0);
  610. NONFAILING(*(uint64_t*)0x20000001d038 = 0);
  611. NONFAILING(*(uint64_t*)0x20000001d040 = 0);
  612. NONFAILING(*(uint64_t*)0x20000001d048 = 0);
  613. NONFAILING(*(uint64_t*)0x20000001d050 = 0);
  614. NONFAILING(*(uint32_t*)0x20000001d058 = 0x80bd5);
  615. NONFAILING(*(uint32_t*)0x20000001d05c = 0);
  616. NONFAILING(*(uint64_t*)0x20000001d060 = 0);
  617. NONFAILING(*(uint32_t*)0x20000001d068 = 5);
  618. NONFAILING(*(uint16_t*)0x20000001d06c = 8);
  619. NONFAILING(*(uint16_t*)0x20000001d06e = 0);
  620. NONFAILING(*(uint32_t*)0x20000001d070 = 0);
  621. NONFAILING(*(uint32_t*)0x20000001d074 = 0);
  622. NONFAILING(*(uint64_t*)0x20000001d078 = 0);
  623. res = syscall(__NR_perf_event_open, /*attr=*/0x20000001d000ul, /*pid=*/0,
  624. /*cpu=*/(intptr_t)-1, /*group=*/r[0], /*flags=*/0ul);
  625. if (res != -1)
  626. r[1] = res;
  627. // ioctl$int_in arguments: [
  628. // fd: fd (resource)
  629. // cmd: ioctl_int_in = 0x5452 (4 bytes)
  630. // v: nil
  631. // ]
  632. syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=FIOASYNC*/ 0x5452, /*v=*/0ul);
  633. // socket$nl_generic arguments: [
  634. // domain: const = 0x10 (8 bytes)
  635. // type: const = 0x3 (8 bytes)
  636. // proto: const = 0x10 (4 bytes)
  637. // ]
  638. // returns sock_nl_generic
  639. res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0x10);
  640. if (res != -1)
  641. r[2] = res;
  642. // syz_genetlink_get_family_id$nl80211 arguments: [
  643. // name: nil
  644. // fd: sock_nl_generic (resource)
  645. // ]
  646. // returns nl80211_family_id
  647. NONFAILING(syz_genetlink_get_family_id(/*name=*/0, /*fd=*/-1));
  648. // perf_event_open arguments: [
  649. // attr: nil
  650. // pid: pid (resource)
  651. // cpu: intptr = 0xffffffffffffffff (8 bytes)
  652. // group: fd_perf (resource)
  653. // flags: perf_flags = 0x0 (8 bytes)
  654. // ]
  655. // returns fd_perf
  656. syscall(__NR_perf_event_open, /*attr=*/0ul, /*pid=*/0, /*cpu=*/(intptr_t)-1,
  657. /*group=*/(intptr_t)-1, /*flags=*/0ul);
  658. // perf_event_open arguments: [
  659. // attr: ptr[in, perf_event_attr] {
  660. // perf_event_attr {
  661. // type: perf_event_type = 0x3 (4 bytes)
  662. // size: len = 0x80 (4 bytes)
  663. // config0: int8 = 0x0 (1 bytes)
  664. // config1: int8 = 0x0 (1 bytes)
  665. // config2: int8 = 0x0 (1 bytes)
  666. // config3: int8 = 0x0 (1 bytes)
  667. // config4: const = 0x0 (4 bytes)
  668. // sample_freq: int64 = 0x18a (8 bytes)
  669. // sample_type: perf_sample_type = 0x0 (8 bytes)
  670. // read_format: perf_read_format = 0x0 (8 bytes)
  671. // disabled: int64 = 0x0 (0 bytes)
  672. // inherit: int64 = 0x0 (0 bytes)
  673. // pinned: int64 = 0x0 (0 bytes)
  674. // exclusive: int64 = 0x0 (0 bytes)
  675. // exclude_user: int64 = 0x0 (0 bytes)
  676. // exclude_kernel: int64 = 0x0 (0 bytes)
  677. // exclude_hv: int64 = 0x0 (0 bytes)
  678. // exclude_idle: int64 = 0x0 (0 bytes)
  679. // mmap: int64 = 0x0 (0 bytes)
  680. // comm: int64 = 0x0 (0 bytes)
  681. // freq: int64 = 0x0 (0 bytes)
  682. // inherit_stat: int64 = 0x0 (0 bytes)
  683. // enable_on_exec: int64 = 0x0 (0 bytes)
  684. // task: int64 = 0x0 (0 bytes)
  685. // watermark: int64 = 0x0 (0 bytes)
  686. // precise_ip: int64 = 0x0 (0 bytes)
  687. // mmap_data: int64 = 0x0 (0 bytes)
  688. // sample_id_all: int64 = 0x0 (0 bytes)
  689. // exclude_host: int64 = 0x0 (0 bytes)
  690. // exclude_guest: int64 = 0x0 (0 bytes)
  691. // exclude_callchain_kernel: int64 = 0x0 (0 bytes)
  692. // exclude_callchain_user: int64 = 0x0 (0 bytes)
  693. // mmap2: int64 = 0x0 (0 bytes)
  694. // comm_exec: int64 = 0x0 (0 bytes)
  695. // use_clockid: int64 = 0x0 (0 bytes)
  696. // context_switch: int64 = 0x0 (0 bytes)
  697. // write_backward: int64 = 0x0 (0 bytes)
  698. // namespaces: int64 = 0x0 (0 bytes)
  699. // ksymbol: int64 = 0x0 (0 bytes)
  700. // bpf_event: int64 = 0x0 (0 bytes)
  701. // aux_output: int64 = 0x0 (0 bytes)
  702. // cgroup: int64 = 0x0 (0 bytes)
  703. // text_poke: int64 = 0x0 (0 bytes)
  704. // build_id: int64 = 0x0 (0 bytes)
  705. // inherit_thread: int64 = 0x0 (0 bytes)
  706. // remove_on_exec: int64 = 0x0 (0 bytes)
  707. // sigtrap: int64 = 0x0 (0 bytes)
  708. // __reserved_1: const = 0x0 (8 bytes)
  709. // wakeup_events: int32 = 0x0 (4 bytes)
  710. // bp_type: perf_bp_type = 0x0 (4 bytes)
  711. // bp_config: union perf_bp_config {
  712. // perf_bp: perf_bp {
  713. // bp_addr: nil
  714. // bp_len: perf_bp_lens = 0x0 (8 bytes)
  715. // }
  716. // }
  717. // branch_sample_type: perf_branch_sample_type = 0x0 (8 bytes)
  718. // sample_regs_user: int64 = 0x0 (8 bytes)
  719. // sample_stack_user: int32 = 0x0 (4 bytes)
  720. // clockid: clock_type = 0x0 (4 bytes)
  721. // sample_regs_intr: int64 = 0x0 (8 bytes)
  722. // aux_watermark: int32 = 0x0 (4 bytes)
  723. // sample_max_stack: int16 = 0x0 (2 bytes)
  724. // __reserved_2: const = 0x0 (2 bytes)
  725. // aux_sample_size: int32 = 0x0 (4 bytes)
  726. // __reserved_3: const = 0x0 (4 bytes)
  727. // sig_data: int64 = 0x0 (8 bytes)
  728. // }
  729. // }
  730. // pid: pid (resource)
  731. // cpu: intptr = 0xffffffffffffffff (8 bytes)
  732. // group: fd_perf (resource)
  733. // flags: perf_flags = 0x0 (8 bytes)
  734. // ]
  735. // returns fd_perf
  736. NONFAILING(*(uint32_t*)0x20000001d000 = 3);
  737. NONFAILING(*(uint32_t*)0x20000001d004 = 0x80);
  738. NONFAILING(*(uint8_t*)0x20000001d008 = 0);
  739. NONFAILING(*(uint8_t*)0x20000001d009 = 0);
  740. NONFAILING(*(uint8_t*)0x20000001d00a = 0);
  741. NONFAILING(*(uint8_t*)0x20000001d00b = 0);
  742. NONFAILING(*(uint32_t*)0x20000001d00c = 0);
  743. NONFAILING(*(uint64_t*)0x20000001d010 = 0x18a);
  744. NONFAILING(*(uint64_t*)0x20000001d018 = 0);
  745. NONFAILING(*(uint64_t*)0x20000001d020 = 0);
  746. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 0, 1));
  747. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 1, 1));
  748. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 2, 1));
  749. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 3, 1));
  750. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 4, 1));
  751. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 5, 1));
  752. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 6, 1));
  753. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 7, 1));
  754. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 8, 1));
  755. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 9, 1));
  756. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 10, 1));
  757. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 11, 1));
  758. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 12, 1));
  759. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 13, 1));
  760. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 14, 1));
  761. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 15, 2));
  762. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 17, 1));
  763. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 18, 1));
  764. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 19, 1));
  765. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 20, 1));
  766. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 21, 1));
  767. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 22, 1));
  768. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 23, 1));
  769. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 24, 1));
  770. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 25, 1));
  771. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 26, 1));
  772. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 27, 1));
  773. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 28, 1));
  774. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 29, 1));
  775. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 30, 1));
  776. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 31, 1));
  777. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 32, 1));
  778. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 33, 1));
  779. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 34, 1));
  780. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 35, 1));
  781. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 36, 1));
  782. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 37, 1));
  783. NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x20000001d028, 0, 38, 26));
  784. NONFAILING(*(uint32_t*)0x20000001d030 = 0);
  785. NONFAILING(*(uint32_t*)0x20000001d034 = 0);
  786. NONFAILING(*(uint64_t*)0x20000001d038 = 0);
  787. NONFAILING(*(uint64_t*)0x20000001d040 = 0);
  788. NONFAILING(*(uint64_t*)0x20000001d048 = 0);
  789. NONFAILING(*(uint64_t*)0x20000001d050 = 0);
  790. NONFAILING(*(uint32_t*)0x20000001d058 = 0);
  791. NONFAILING(*(uint32_t*)0x20000001d05c = 0);
  792. NONFAILING(*(uint64_t*)0x20000001d060 = 0);
  793. NONFAILING(*(uint32_t*)0x20000001d068 = 0);
  794. NONFAILING(*(uint16_t*)0x20000001d06c = 0);
  795. NONFAILING(*(uint16_t*)0x20000001d06e = 0);
  796. NONFAILING(*(uint32_t*)0x20000001d070 = 0);
  797. NONFAILING(*(uint32_t*)0x20000001d074 = 0);
  798. NONFAILING(*(uint64_t*)0x20000001d078 = 0);
  799. syscall(__NR_perf_event_open, /*attr=*/0x20000001d000ul, /*pid=*/0,
  800. /*cpu=*/(intptr_t)-1, /*group=*/(intptr_t)-1, /*flags=*/0ul);
  801. // getsockopt$EBT_SO_GET_INFO arguments: [
  802. // fd: sock_in (resource)
  803. // level: const = 0x0 (4 bytes)
  804. // opt: const = 0x80 (4 bytes)
  805. // val: nil
  806. // len: nil
  807. // ]
  808. syscall(__NR_getsockopt, /*fd=*/(intptr_t)-1, /*level=*/0, /*opt=*/0x80,
  809. /*val=*/0ul, /*len=*/0ul);
  810. // perf_event_open$cgroup arguments: [
  811. // attr: nil
  812. // fd: fd_cgroup (resource)
  813. // cpu: intptr = 0x0 (8 bytes)
  814. // group: fd_perf (resource)
  815. // flags: perf_flags_cgroup = 0x0 (8 bytes)
  816. // ]
  817. // returns fd_perf
  818. syscall(__NR_perf_event_open, /*attr=*/0ul, /*fd=*/(intptr_t)-1, /*cpu=*/0ul,
  819. /*group=*/(intptr_t)-1, /*flags=*/0ul);
  820. // sendmsg$NL80211_CMD_DEL_KEY arguments: [
  821. // fd: sock_nl_generic (resource)
  822. // msg: nil
  823. // f: send_flags = 0x2000c000 (8 bytes)
  824. // ]
  825. syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0ul,
  826. /*f=MSG_FASTOPEN|MSG_NOSIGNAL|MSG_MORE*/ 0x2000c000ul);
  827. // sendmsg$NL80211_CMD_RELOAD_REGDB arguments: [
  828. // fd: sock_nl_generic (resource)
  829. // msg: nil
  830. // f: send_flags = 0x88 (8 bytes)
  831. // ]
  832. syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0ul, /*f=MSG_EOR|0x8*/ 0x88ul);
  833. }
  834. int main(void)
  835. {
  836. syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul,
  837. /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul,
  838. /*fd=*/(intptr_t)-1, /*offset=*/0ul);
  839. syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul,
  840. /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul,
  841. /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul,
  842. /*fd=*/(intptr_t)-1, /*offset=*/0ul);
  843. syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul,
  844. /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul,
  845. /*fd=*/(intptr_t)-1, /*offset=*/0ul);
  846. const char* reason;
  847. (void)reason;
  848. install_segv_handler();
  849. loop();
  850. return 0;
  851. }
  852.  
Advertisement
Add Comment
Please, Sign In to add comment