オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Contents of /trunk/akari/test.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 688 - (show annotations) (download) (as text)
Fri Sep 9 15:24:05 2022 UTC (20 months, 1 week ago) by kumaneko
File MIME type: text/x-csrc
File size: 2187 byte(s)


1 /*
2 * test.c
3 *
4 * Copyright (C) 2010-2013 Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
5 */
6 #include "probe.h"
7
8 /**
9 * ccs_init - Initialize this module.
10 *
11 * Returns 0 on success, -EINVAL otherwise.
12 */
13 static int __init ccs_init(void)
14 {
15 void *ptr;
16
17 #if defined(LSM_HOOK_INIT)
18 ptr = probe_security_hook_heads();
19 if (!ptr)
20 goto out;
21 printk(KERN_INFO "security_hook_heads=%lx\n", (unsigned long) ptr);
22 #else
23 ptr = probe_security_ops();
24 if (!ptr)
25 goto out;
26 printk(KERN_INFO "security_ops=%lx\n", (unsigned long) ptr);
27 #endif
28 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
29 ptr = probe_find_task_by_vpid();
30 if (!ptr)
31 goto out;
32 printk(KERN_INFO "find_task_by_vpid=%lx\n", (unsigned long) ptr);
33 ptr = probe_find_task_by_pid_ns();
34 if (!ptr)
35 goto out;
36 printk(KERN_INFO "find_task_by_pid_ns=%lx\n", (unsigned long) ptr);
37 #endif
38 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
39 ptr = probe_vfsmount_lock();
40 if (!ptr)
41 goto out;
42 printk(KERN_INFO "vfsmount_lock=%lx\n", (unsigned long) ptr);
43 #elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
44 ptr = probe___d_path();
45 if (!ptr)
46 goto out;
47 printk(KERN_INFO "__d_path=%lx\n", (unsigned long) ptr);
48 #else
49 ptr = probe_d_absolute_path();
50 if (!ptr)
51 goto out;
52 printk(KERN_INFO "d_absolute_path=%lx\n", (unsigned long) ptr);
53 #endif
54 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
55 ptr = probe_copy_to_kernel_nofault();
56 if (!ptr)
57 goto out;
58 printk(KERN_INFO "copy_to_kernel_nofault=%lx\n", (unsigned long) ptr);
59 #endif
60 printk(KERN_INFO "All dependent symbols have been guessed.\n");
61 printk(KERN_INFO "Please verify these addresses using System.map for this kernel (e.g. /boot/System.map-`uname -r` ).\n");
62 printk(KERN_INFO "If these addresses are correct, you can try loading AKARI module on this kernel.\n");
63 return 0;
64 out:
65 printk(KERN_INFO "Sorry, I couldn't guess dependent symbols.\n");
66 printk(KERN_INFO "I need some changes for supporting your environment.\n");
67 printk(KERN_INFO "Please contact the author.\n");
68 return -EINVAL;
69 }
70
71 /**
72 * ccs_exit - Exit this module.
73 *
74 * Returns nothing.
75 */
76 static void ccs_exit(void)
77 {
78 }
79
80 module_init(ccs_init);
81 module_exit(ccs_exit);
82 MODULE_LICENSE("GPL");

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26