summarylogtreecommitdiffstats
path: root/grsec_arch.patch
blob: 323e44fd02fad72260433b95bd0183f004a225eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff -uNr 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c
--- 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c	2015-12-19 21:14:13.251002548 +0100
+++ 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c	2015-12-19 21:36:27.703783498 +0100
@@ -6465,11 +6465,21 @@
 
    if(static_cpu_has(X86_FEATURE_XSAVE)) {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
+#ifdef CONFIG_GRKERNSEC
+        copy_xregs_to_kernel(&fpu->state->xsave);
+        if (!(fpu->state->xsave.header.xfeatures & XFEATURE_MASK_FP))
+#else
 	  copy_xregs_to_kernel(&fpu->state.xsave);
       if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
+#endif
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
+#ifdef CONFIG_GRKERNSEC
+        copy_xregs_to_kernel(&fpu->state->xsave);
+        if (!(fpu->state->xsave.header.xfeatures & XSTATE_FP))
+#else
 	  copy_xregs_to_kernel(&fpu->state.xsave);
       if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
+#endif
 #else
       fpu_xsave(fpu);
       if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
@@ -6486,8 +6496,12 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
                   : [fx] "=m" (fpu->state->fsave));
 #else
+#ifdef CONFIG_GRKERNSEC
+                  : [fx] "=m" (fpu->state->fsave));
+#else
                   : [fx] "=m" (fpu->state.fsave));
 #endif
+#endif
         return 0;
    }
 
diff -uNr 15.12/common/lib/modules/fglrx//build_mod/kcl_acpi.c 15.12b/common/lib/modules/fglrx//build_mod/kcl_acpi.c
--- 15.12/common/lib/modules/fglrx//build_mod/kcl_acpi.c	2015-12-19 21:14:13.247669219 +0100
+++ 15.12b/common/lib/modules/fglrx//build_mod/kcl_acpi.c	2015-12-19 21:10:27.224899708 +0100
@@ -145,7 +145,11 @@
     return NOTIFY_OK;
 }
 
+#ifdef CONFIG_GRKERNSEC
+static notifier_block_no_const firegl_acpi_lid_notifier = {
+#else
 static struct notifier_block firegl_acpi_lid_notifier = {
+#endif
         .notifier_call = firegl_acpi_lid_event,
 };
 #endif
@@ -400,7 +404,11 @@
             KCL_DEBUG_ERROR ("Could not allocate enough memory for video notifier_block\n");
             return -ENOMEM;
         }
+#ifdef CONFIG_GRKERNSEC
+        ((notifier_block_no_const*)(*nb))->notifier_call = firegl_acpi_video_event;
+#else
         ((struct notifier_block*)(*nb))->notifier_call = firegl_acpi_video_event;
+#endif
         return register_acpi_notifier((struct notifier_block*)(*nb));
     }
 
@@ -413,7 +421,11 @@
             KCL_DEBUG_ERROR ("Could not allocate enough memory for ac notifier_block\n");
             return -ENOMEM;
         }
+#ifdef CONFIG_GRKERNSEC
+        ((notifier_block_no_const*)(*nb))->notifier_call = firegl_acpi_ac_event;
+#else
         ((struct notifier_block*)(*nb))->notifier_call = firegl_acpi_ac_event;
+#endif
         return register_acpi_notifier((struct notifier_block*)(*nb));
     }