• R/O
  • SSH
  • HTTPS

akari: コミット


コミットメタ情報

リビジョン593 (tree)
日時2018-04-10 20:18:58
作者kumaneko

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- trunk/akari/probe.c (revision 592)
+++ trunk/akari/probe.c (revision 593)
@@ -44,7 +44,7 @@
4444 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) || LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3)
4545
4646 /**
47- * probe_kernel_read - Wrapper for kernel_read().
47+ * my_kernel_read - Wrapper for kernel_read().
4848 *
4949 * @file: Pointer to "struct file".
5050 * @offset: Starting position.
@@ -53,7 +53,7 @@
5353 *
5454 * Returns return value from kernel_read().
5555 */
56-static int __init probe_kernel_read(struct file *file, unsigned long offset,
56+static int __init my_kernel_read(struct file *file, unsigned long offset,
5757 char *addr, unsigned long count)
5858 {
5959 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
@@ -153,8 +153,8 @@
153153 int len;
154154 int offset = 0;
155155
156- while ((len = probe_kernel_read(file, offset, buf,
157- PAGE_SIZE - 1)) > 0) {
156+ while ((len = my_kernel_read(file, offset, buf,
157+ PAGE_SIZE - 1)) > 0) {
158158 char *cp;
159159
160160 buf[len] = '\0';
--- branches/kportreserve/probe.c (revision 592)
+++ branches/kportreserve/probe.c (revision 593)
@@ -44,7 +44,7 @@
4444 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) || LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3)
4545
4646 /**
47- * probe_kernel_read - Wrapper for kernel_read().
47+ * my_kernel_read - Wrapper for kernel_read().
4848 *
4949 * @file: Pointer to "struct file".
5050 * @offset: Starting position.
@@ -53,7 +53,7 @@
5353 *
5454 * Returns return value from kernel_read().
5555 */
56-static int __init probe_kernel_read(struct file *file, unsigned long offset,
56+static int __init my_kernel_read(struct file *file, unsigned long offset,
5757 char *addr, unsigned long count)
5858 {
5959 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
@@ -153,8 +153,8 @@
153153 int len;
154154 int offset = 0;
155155
156- while ((len = probe_kernel_read(file, offset, buf,
157- PAGE_SIZE - 1)) > 0) {
156+ while ((len = my_kernel_read(file, offset, buf,
157+ PAGE_SIZE - 1)) > 0) {
158158 char *cp;
159159
160160 buf[len] = '\0';
--- branches/check.c (revision 0)
+++ branches/check.c (revision 593)
@@ -0,0 +1,34 @@
1+#include "probe.c"
2+
3+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
4+#define LSM_LIST_HEAD_TYPE struct hlist_head
5+#define LSM_LIST_FOR_EACH_ENTRY hlist_for_each_entry
6+#else
7+#define LSM_LIST_HEAD_TYPE struct list_head
8+#define LSM_LIST_FOR_EACH_ENTRY list_for_each_entry
9+#endif
10+
11+static int __init check_init(void)
12+{
13+ static char buf[1024];
14+ int idx;
15+#if defined(LSM_HOOK_INIT)
16+ struct security_hook_heads *hooks = probe_security_hook_heads();
17+ struct security_hook_list *shp;
18+ if (!hooks)
19+ return -EINVAL;
20+ for (idx = 0; idx < sizeof(struct security_hook_heads) / sizeof(LSM_LIST_HEAD_TYPE); idx++) {
21+ LSM_LIST_HEAD_TYPE *head = &((LSM_LIST_HEAD_TYPE *) hooks)[idx];
22+ int pos = 0;
23+ memset(buf, 0, sizeof(buf));
24+ LSM_LIST_FOR_EACH_ENTRY(shp, head, list)
25+ pos += snprintf(buf + pos, sizeof(buf) - pos, " %pf", shp->hook.capable);
26+ if (buf[0])
27+ printk("%s\n", buf);
28+ }
29+#endif
30+ return -EINVAL;
31+}
32+
33+module_init(check_init);
34+MODULE_LICENSE("GPL");
--- branches/tasktracker/probe.c (revision 592)
+++ branches/tasktracker/probe.c (revision 593)
@@ -44,7 +44,7 @@
4444 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) || LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3)
4545
4646 /**
47- * probe_kernel_read - Wrapper for kernel_read().
47+ * my_kernel_read - Wrapper for kernel_read().
4848 *
4949 * @file: Pointer to "struct file".
5050 * @offset: Starting position.
@@ -53,7 +53,7 @@
5353 *
5454 * Returns return value from kernel_read().
5555 */
56-static int __init probe_kernel_read(struct file *file, unsigned long offset,
56+static int __init my_kernel_read(struct file *file, unsigned long offset,
5757 char *addr, unsigned long count)
5858 {
5959 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
@@ -153,8 +153,8 @@
153153 int len;
154154 int offset = 0;
155155
156- while ((len = probe_kernel_read(file, offset, buf,
157- PAGE_SIZE - 1)) > 0) {
156+ while ((len = my_kernel_read(file, offset, buf,
157+ PAGE_SIZE - 1)) > 0) {
158158 char *cp;
159159
160160 buf[len] = '\0';
旧リポジトリブラウザで表示