kcore.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. /*
  2. * fs/proc/kcore.c kernel ELF core dumper
  3. *
  4. * Modelled on fs/exec.c:aout_core_dump()
  5. * Jeremy Fitzhardinge <jeremy@sw.oz.au>
  6. * ELF version written by David Howells <David.Howells@nexor.co.uk>
  7. * Modified and incorporated into 2.3.x by Tigran Aivazian <tigran@veritas.com>
  8. * Support to dump vmalloc'd areas (ELF only), Tigran Aivazian <tigran@veritas.com>
  9. * Safe accesses to vmalloc/direct-mapped discontiguous areas, Kanoj Sarcar <kanoj@sgi.com>
  10. */
  11. #include <linux/mm.h>
  12. #include <linux/proc_fs.h>
  13. #include <linux/kcore.h>
  14. #include <linux/user.h>
  15. #include <linux/capability.h>
  16. #include <linux/elf.h>
  17. #include <linux/elfcore.h>
  18. #include <linux/notifier.h>
  19. #include <linux/vmalloc.h>
  20. #include <linux/highmem.h>
  21. #include <linux/printk.h>
  22. #include <linux/bootmem.h>
  23. #include <linux/init.h>
  24. #include <linux/slab.h>
  25. #include <asm/uaccess.h>
  26. #include <asm/io.h>
  27. #include <linux/list.h>
  28. #include <linux/ioport.h>
  29. #include <linux/memory.h>
  30. #include <asm/sections.h>
  31. #include "internal.h"
  32. #define CORE_STR "CORE"
  33. #ifndef ELF_CORE_EFLAGS
  34. #define ELF_CORE_EFLAGS 0
  35. #endif
  36. static struct proc_dir_entry *proc_root_kcore;
  37. #ifndef kc_vaddr_to_offset
  38. #define kc_vaddr_to_offset(v) ((v) - PAGE_OFFSET)
  39. #endif
  40. #ifndef kc_offset_to_vaddr
  41. #define kc_offset_to_vaddr(o) ((o) + PAGE_OFFSET)
  42. #endif
  43. /* An ELF note in memory */
  44. struct memelfnote
  45. {
  46. const char *name;
  47. int type;
  48. unsigned int datasz;
  49. void *data;
  50. };
  51. static LIST_HEAD(kclist_head);
  52. static DEFINE_RWLOCK(kclist_lock);
  53. static int kcore_need_update = 1;
  54. void
  55. kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
  56. {
  57. new->addr = (unsigned long)addr;
  58. new->size = size;
  59. new->type = type;
  60. write_lock(&kclist_lock);
  61. list_add_tail(&new->list, &kclist_head);
  62. write_unlock(&kclist_lock);
  63. }
  64. static size_t get_kcore_size(int *nphdr, size_t *elf_buflen)
  65. {
  66. size_t try, size;
  67. struct kcore_list *m;
  68. *nphdr = 1; /* PT_NOTE */
  69. size = 0;
  70. list_for_each_entry(m, &kclist_head, list) {
  71. try = kc_vaddr_to_offset((size_t)m->addr + m->size);
  72. if (try > size)
  73. size = try;
  74. *nphdr = *nphdr + 1;
  75. }
  76. *elf_buflen = sizeof(struct elfhdr) +
  77. (*nphdr + 2)*sizeof(struct elf_phdr) +
  78. 3 * ((sizeof(struct elf_note)) +
  79. roundup(sizeof(CORE_STR), 4)) +
  80. roundup(sizeof(struct elf_prstatus), 4) +
  81. roundup(sizeof(struct elf_prpsinfo), 4) +
  82. roundup(arch_task_struct_size, 4);
  83. *elf_buflen = PAGE_ALIGN(*elf_buflen);
  84. return size + *elf_buflen;
  85. }
  86. static void free_kclist_ents(struct list_head *head)
  87. {
  88. struct kcore_list *tmp, *pos;
  89. list_for_each_entry_safe(pos, tmp, head, list) {
  90. list_del(&pos->list);
  91. kfree(pos);
  92. }
  93. }
  94. /*
  95. * Replace all KCORE_RAM/KCORE_VMEMMAP information with passed list.
  96. */
  97. static void __kcore_update_ram(struct list_head *list)
  98. {
  99. int nphdr;
  100. size_t size;
  101. struct kcore_list *tmp, *pos;
  102. LIST_HEAD(garbage);
  103. write_lock(&kclist_lock);
  104. if (kcore_need_update) {
  105. list_for_each_entry_safe(pos, tmp, &kclist_head, list) {
  106. if (pos->type == KCORE_RAM
  107. || pos->type == KCORE_VMEMMAP)
  108. list_move(&pos->list, &garbage);
  109. }
  110. list_splice_tail(list, &kclist_head);
  111. } else
  112. list_splice(list, &garbage);
  113. kcore_need_update = 0;
  114. proc_root_kcore->size = get_kcore_size(&nphdr, &size);
  115. write_unlock(&kclist_lock);
  116. free_kclist_ents(&garbage);
  117. }
  118. #ifdef CONFIG_HIGHMEM
  119. /*
  120. * If no highmem, we can assume [0...max_low_pfn) continuous range of memory
  121. * because memory hole is not as big as !HIGHMEM case.
  122. * (HIGHMEM is special because part of memory is _invisible_ from the kernel.)
  123. */
  124. static int kcore_update_ram(void)
  125. {
  126. LIST_HEAD(head);
  127. struct kcore_list *ent;
  128. int ret = 0;
  129. ent = kmalloc(sizeof(*ent), GFP_KERNEL);
  130. if (!ent)
  131. return -ENOMEM;
  132. ent->addr = (unsigned long)__va(0);
  133. ent->size = max_low_pfn << PAGE_SHIFT;
  134. ent->type = KCORE_RAM;
  135. list_add(&ent->list, &head);
  136. __kcore_update_ram(&head);
  137. return ret;
  138. }
  139. #else /* !CONFIG_HIGHMEM */
  140. #ifdef CONFIG_SPARSEMEM_VMEMMAP
  141. /* calculate vmemmap's address from given system ram pfn and register it */
  142. static int
  143. get_sparsemem_vmemmap_info(struct kcore_list *ent, struct list_head *head)
  144. {
  145. unsigned long pfn = __pa(ent->addr) >> PAGE_SHIFT;
  146. unsigned long nr_pages = ent->size >> PAGE_SHIFT;
  147. unsigned long start, end;
  148. struct kcore_list *vmm, *tmp;
  149. start = ((unsigned long)pfn_to_page(pfn)) & PAGE_MASK;
  150. end = ((unsigned long)pfn_to_page(pfn + nr_pages)) - 1;
  151. end = PAGE_ALIGN(end);
  152. /* overlap check (because we have to align page */
  153. list_for_each_entry(tmp, head, list) {
  154. if (tmp->type != KCORE_VMEMMAP)
  155. continue;
  156. if (start < tmp->addr + tmp->size)
  157. if (end > tmp->addr)
  158. end = tmp->addr;
  159. }
  160. if (start < end) {
  161. vmm = kmalloc(sizeof(*vmm), GFP_KERNEL);
  162. if (!vmm)
  163. return 0;
  164. vmm->addr = start;
  165. vmm->size = end - start;
  166. vmm->type = KCORE_VMEMMAP;
  167. list_add_tail(&vmm->list, head);
  168. }
  169. return 1;
  170. }
  171. #else
  172. static int
  173. get_sparsemem_vmemmap_info(struct kcore_list *ent, struct list_head *head)
  174. {
  175. return 1;
  176. }
  177. #endif
  178. static int
  179. kclist_add_private(unsigned long pfn, unsigned long nr_pages, void *arg)
  180. {
  181. struct list_head *head = (struct list_head *)arg;
  182. struct kcore_list *ent;
  183. ent = kmalloc(sizeof(*ent), GFP_KERNEL);
  184. if (!ent)
  185. return -ENOMEM;
  186. ent->addr = (unsigned long)__va((pfn << PAGE_SHIFT));
  187. ent->size = nr_pages << PAGE_SHIFT;
  188. /* Sanity check: Can happen in 32bit arch...maybe */
  189. if (ent->addr < (unsigned long) __va(0))
  190. goto free_out;
  191. /* cut not-mapped area. ....from ppc-32 code. */
  192. if (ULONG_MAX - ent->addr < ent->size)
  193. ent->size = ULONG_MAX - ent->addr;
  194. /* cut when vmalloc() area is higher than direct-map area */
  195. if (VMALLOC_START > (unsigned long)__va(0)) {
  196. if (ent->addr > VMALLOC_START)
  197. goto free_out;
  198. if (VMALLOC_START - ent->addr < ent->size)
  199. ent->size = VMALLOC_START - ent->addr;
  200. }
  201. ent->type = KCORE_RAM;
  202. list_add_tail(&ent->list, head);
  203. if (!get_sparsemem_vmemmap_info(ent, head)) {
  204. list_del(&ent->list);
  205. goto free_out;
  206. }
  207. return 0;
  208. free_out:
  209. kfree(ent);
  210. return 1;
  211. }
  212. static int kcore_update_ram(void)
  213. {
  214. int nid, ret;
  215. unsigned long end_pfn;
  216. LIST_HEAD(head);
  217. /* Not inialized....update now */
  218. /* find out "max pfn" */
  219. end_pfn = 0;
  220. for_each_node_state(nid, N_MEMORY) {
  221. unsigned long node_end;
  222. node_end = node_end_pfn(nid);
  223. if (end_pfn < node_end)
  224. end_pfn = node_end;
  225. }
  226. /* scan 0 to max_pfn */
  227. ret = walk_system_ram_range(0, end_pfn, &head, kclist_add_private);
  228. if (ret) {
  229. free_kclist_ents(&head);
  230. return -ENOMEM;
  231. }
  232. __kcore_update_ram(&head);
  233. return ret;
  234. }
  235. #endif /* CONFIG_HIGHMEM */
  236. /*****************************************************************************/
  237. /*
  238. * determine size of ELF note
  239. */
  240. static int notesize(struct memelfnote *en)
  241. {
  242. int sz;
  243. sz = sizeof(struct elf_note);
  244. sz += roundup((strlen(en->name) + 1), 4);
  245. sz += roundup(en->datasz, 4);
  246. return sz;
  247. } /* end notesize() */
  248. /*****************************************************************************/
  249. /*
  250. * store a note in the header buffer
  251. */
  252. static char *storenote(struct memelfnote *men, char *bufp)
  253. {
  254. struct elf_note en;
  255. #define DUMP_WRITE(addr,nr) do { memcpy(bufp,addr,nr); bufp += nr; } while(0)
  256. en.n_namesz = strlen(men->name) + 1;
  257. en.n_descsz = men->datasz;
  258. en.n_type = men->type;
  259. DUMP_WRITE(&en, sizeof(en));
  260. DUMP_WRITE(men->name, en.n_namesz);
  261. /* XXX - cast from long long to long to avoid need for libgcc.a */
  262. bufp = (char*) roundup((unsigned long)bufp,4);
  263. DUMP_WRITE(men->data, men->datasz);
  264. bufp = (char*) roundup((unsigned long)bufp,4);
  265. #undef DUMP_WRITE
  266. return bufp;
  267. } /* end storenote() */
  268. /*
  269. * store an ELF coredump header in the supplied buffer
  270. * nphdr is the number of elf_phdr to insert
  271. */
  272. static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff)
  273. {
  274. struct elf_prstatus prstatus; /* NT_PRSTATUS */
  275. struct elf_prpsinfo prpsinfo; /* NT_PRPSINFO */
  276. struct elf_phdr *nhdr, *phdr;
  277. struct elfhdr *elf;
  278. struct memelfnote notes[3];
  279. off_t offset = 0;
  280. struct kcore_list *m;
  281. /* setup ELF header */
  282. elf = (struct elfhdr *) bufp;
  283. bufp += sizeof(struct elfhdr);
  284. offset += sizeof(struct elfhdr);
  285. memcpy(elf->e_ident, ELFMAG, SELFMAG);
  286. elf->e_ident[EI_CLASS] = ELF_CLASS;
  287. elf->e_ident[EI_DATA] = ELF_DATA;
  288. elf->e_ident[EI_VERSION]= EV_CURRENT;
  289. elf->e_ident[EI_OSABI] = ELF_OSABI;
  290. memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
  291. elf->e_type = ET_CORE;
  292. elf->e_machine = ELF_ARCH;
  293. elf->e_version = EV_CURRENT;
  294. elf->e_entry = 0;
  295. elf->e_phoff = sizeof(struct elfhdr);
  296. elf->e_shoff = 0;
  297. elf->e_flags = ELF_CORE_EFLAGS;
  298. elf->e_ehsize = sizeof(struct elfhdr);
  299. elf->e_phentsize= sizeof(struct elf_phdr);
  300. elf->e_phnum = nphdr;
  301. elf->e_shentsize= 0;
  302. elf->e_shnum = 0;
  303. elf->e_shstrndx = 0;
  304. /* setup ELF PT_NOTE program header */
  305. nhdr = (struct elf_phdr *) bufp;
  306. bufp += sizeof(struct elf_phdr);
  307. offset += sizeof(struct elf_phdr);
  308. nhdr->p_type = PT_NOTE;
  309. nhdr->p_offset = 0;
  310. nhdr->p_vaddr = 0;
  311. nhdr->p_paddr = 0;
  312. nhdr->p_filesz = 0;
  313. nhdr->p_memsz = 0;
  314. nhdr->p_flags = 0;
  315. nhdr->p_align = 0;
  316. /* setup ELF PT_LOAD program header for every area */
  317. list_for_each_entry(m, &kclist_head, list) {
  318. phdr = (struct elf_phdr *) bufp;
  319. bufp += sizeof(struct elf_phdr);
  320. offset += sizeof(struct elf_phdr);
  321. phdr->p_type = PT_LOAD;
  322. phdr->p_flags = PF_R|PF_W|PF_X;
  323. phdr->p_offset = kc_vaddr_to_offset(m->addr) + dataoff;
  324. phdr->p_vaddr = (size_t)m->addr;
  325. phdr->p_paddr = 0;
  326. phdr->p_filesz = phdr->p_memsz = m->size;
  327. phdr->p_align = PAGE_SIZE;
  328. }
  329. /*
  330. * Set up the notes in similar form to SVR4 core dumps made
  331. * with info from their /proc.
  332. */
  333. nhdr->p_offset = offset;
  334. /* set up the process status */
  335. notes[0].name = CORE_STR;
  336. notes[0].type = NT_PRSTATUS;
  337. notes[0].datasz = sizeof(struct elf_prstatus);
  338. notes[0].data = &prstatus;
  339. memset(&prstatus, 0, sizeof(struct elf_prstatus));
  340. nhdr->p_filesz = notesize(&notes[0]);
  341. bufp = storenote(&notes[0], bufp);
  342. /* set up the process info */
  343. notes[1].name = CORE_STR;
  344. notes[1].type = NT_PRPSINFO;
  345. notes[1].datasz = sizeof(struct elf_prpsinfo);
  346. notes[1].data = &prpsinfo;
  347. memset(&prpsinfo, 0, sizeof(struct elf_prpsinfo));
  348. prpsinfo.pr_state = 0;
  349. prpsinfo.pr_sname = 'R';
  350. prpsinfo.pr_zomb = 0;
  351. strcpy(prpsinfo.pr_fname, "vmlinux");
  352. strlcpy(prpsinfo.pr_psargs, saved_command_line, sizeof(prpsinfo.pr_psargs));
  353. nhdr->p_filesz += notesize(&notes[1]);
  354. bufp = storenote(&notes[1], bufp);
  355. /* set up the task structure */
  356. notes[2].name = CORE_STR;
  357. notes[2].type = NT_TASKSTRUCT;
  358. notes[2].datasz = arch_task_struct_size;
  359. notes[2].data = current;
  360. nhdr->p_filesz += notesize(&notes[2]);
  361. bufp = storenote(&notes[2], bufp);
  362. } /* end elf_kcore_store_hdr() */
  363. /*****************************************************************************/
  364. /*
  365. * read from the ELF header and then kernel memory
  366. */
  367. static ssize_t
  368. read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
  369. {
  370. ssize_t acc = 0;
  371. size_t size, tsz;
  372. size_t elf_buflen;
  373. int nphdr;
  374. unsigned long start;
  375. read_lock(&kclist_lock);
  376. size = get_kcore_size(&nphdr, &elf_buflen);
  377. if (buflen == 0 || *fpos >= size) {
  378. read_unlock(&kclist_lock);
  379. return 0;
  380. }
  381. /* trim buflen to not go beyond EOF */
  382. if (buflen > size - *fpos)
  383. buflen = size - *fpos;
  384. /* construct an ELF core header if we'll need some of it */
  385. if (*fpos < elf_buflen) {
  386. char * elf_buf;
  387. tsz = elf_buflen - *fpos;
  388. if (buflen < tsz)
  389. tsz = buflen;
  390. elf_buf = kzalloc(elf_buflen, GFP_ATOMIC);
  391. if (!elf_buf) {
  392. read_unlock(&kclist_lock);
  393. return -ENOMEM;
  394. }
  395. elf_kcore_store_hdr(elf_buf, nphdr, elf_buflen);
  396. read_unlock(&kclist_lock);
  397. if (copy_to_user(buffer, elf_buf + *fpos, tsz)) {
  398. kfree(elf_buf);
  399. return -EFAULT;
  400. }
  401. kfree(elf_buf);
  402. buflen -= tsz;
  403. *fpos += tsz;
  404. buffer += tsz;
  405. acc += tsz;
  406. /* leave now if filled buffer already */
  407. if (buflen == 0)
  408. return acc;
  409. } else
  410. read_unlock(&kclist_lock);
  411. /*
  412. * Check to see if our file offset matches with any of
  413. * the addresses in the elf_phdr on our list.
  414. */
  415. start = kc_offset_to_vaddr(*fpos - elf_buflen);
  416. if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
  417. tsz = buflen;
  418. while (buflen) {
  419. struct kcore_list *m;
  420. read_lock(&kclist_lock);
  421. list_for_each_entry(m, &kclist_head, list) {
  422. if (start >= m->addr && start < (m->addr+m->size))
  423. break;
  424. }
  425. read_unlock(&kclist_lock);
  426. if (&m->list == &kclist_head) {
  427. if (clear_user(buffer, tsz))
  428. return -EFAULT;
  429. } else if (is_vmalloc_or_module_addr((void *)start)) {
  430. char * elf_buf;
  431. elf_buf = kzalloc(tsz, GFP_KERNEL);
  432. if (!elf_buf)
  433. return -ENOMEM;
  434. vread(elf_buf, (char *)start, tsz);
  435. /* we have to zero-fill user buffer even if no read */
  436. if (copy_to_user(buffer, elf_buf, tsz)) {
  437. kfree(elf_buf);
  438. return -EFAULT;
  439. }
  440. kfree(elf_buf);
  441. } else {
  442. if (kern_addr_valid(start)) {
  443. unsigned long n;
  444. n = copy_to_user(buffer, (char *)start, tsz);
  445. /*
  446. * We cannot distinguish between fault on source
  447. * and fault on destination. When this happens
  448. * we clear too and hope it will trigger the
  449. * EFAULT again.
  450. */
  451. if (n) {
  452. if (clear_user(buffer + tsz - n,
  453. n))
  454. return -EFAULT;
  455. }
  456. } else {
  457. if (clear_user(buffer, tsz))
  458. return -EFAULT;
  459. }
  460. }
  461. buflen -= tsz;
  462. *fpos += tsz;
  463. buffer += tsz;
  464. acc += tsz;
  465. start += tsz;
  466. tsz = (buflen > PAGE_SIZE ? PAGE_SIZE : buflen);
  467. }
  468. return acc;
  469. }
  470. static int open_kcore(struct inode *inode, struct file *filp)
  471. {
  472. if (!capable(CAP_SYS_RAWIO))
  473. return -EPERM;
  474. if (kcore_need_update)
  475. kcore_update_ram();
  476. if (i_size_read(inode) != proc_root_kcore->size) {
  477. mutex_lock(&inode->i_mutex);
  478. i_size_write(inode, proc_root_kcore->size);
  479. mutex_unlock(&inode->i_mutex);
  480. }
  481. return 0;
  482. }
  483. static const struct file_operations proc_kcore_operations = {
  484. .read = read_kcore,
  485. .open = open_kcore,
  486. .llseek = default_llseek,
  487. };
  488. /* just remember that we have to update kcore */
  489. static int __meminit kcore_callback(struct notifier_block *self,
  490. unsigned long action, void *arg)
  491. {
  492. switch (action) {
  493. case MEM_ONLINE:
  494. case MEM_OFFLINE:
  495. write_lock(&kclist_lock);
  496. kcore_need_update = 1;
  497. write_unlock(&kclist_lock);
  498. }
  499. return NOTIFY_OK;
  500. }
  501. static struct notifier_block kcore_callback_nb __meminitdata = {
  502. .notifier_call = kcore_callback,
  503. .priority = 0,
  504. };
  505. static struct kcore_list kcore_vmalloc;
  506. #ifdef CONFIG_ARCH_PROC_KCORE_TEXT
  507. static struct kcore_list kcore_text;
  508. /*
  509. * If defined, special segment is used for mapping kernel text instead of
  510. * direct-map area. We need to create special TEXT section.
  511. */
  512. static void __init proc_kcore_text_init(void)
  513. {
  514. kclist_add(&kcore_text, _text, _end - _text, KCORE_TEXT);
  515. }
  516. #else
  517. static void __init proc_kcore_text_init(void)
  518. {
  519. }
  520. #endif
  521. #if defined(CONFIG_MODULES) && defined(MODULES_VADDR)
  522. /*
  523. * MODULES_VADDR has no intersection with VMALLOC_ADDR.
  524. */
  525. struct kcore_list kcore_modules;
  526. static void __init add_modules_range(void)
  527. {
  528. if (MODULES_VADDR != VMALLOC_START && MODULES_END != VMALLOC_END) {
  529. kclist_add(&kcore_modules, (void *)MODULES_VADDR,
  530. MODULES_END - MODULES_VADDR, KCORE_VMALLOC);
  531. }
  532. }
  533. #else
  534. static void __init add_modules_range(void)
  535. {
  536. }
  537. #endif
  538. static int __init proc_kcore_init(void)
  539. {
  540. proc_root_kcore = proc_create("kcore", S_IRUSR, NULL,
  541. &proc_kcore_operations);
  542. if (!proc_root_kcore) {
  543. pr_err("couldn't create /proc/kcore\n");
  544. return 0; /* Always returns 0. */
  545. }
  546. /* Store text area if it's special */
  547. proc_kcore_text_init();
  548. /* Store vmalloc area */
  549. kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
  550. VMALLOC_END - VMALLOC_START, KCORE_VMALLOC);
  551. add_modules_range();
  552. /* Store direct-map area from physical memory map */
  553. kcore_update_ram();
  554. register_hotmemory_notifier(&kcore_callback_nb);
  555. return 0;
  556. }
  557. fs_initcall(proc_kcore_init);