]> git.pld-linux.org Git - packages/kernel.git/blame - kernel-aufs2-no-const-grsec.patch
- rel 3
[packages/kernel.git] / kernel-aufs2-no-const-grsec.patch
CommitLineData
52daa4ad
AM
1--- linux-3.0/fs/aufs/dynop.c 2011-08-24 12:17:44.788277908 +0200
2+++ linux-3.0/fs/aufs/dynop.c 2011-08-24 12:11:22.375748361 +0200
3@@ -149,9 +149,11 @@
4 #define DySet(func, dst, src, h_op, h_sb) do { \
5 DyDbgInc(cnt); \
6 if (h_op->func) { \
7- if (src.func) \
8- dst.func = src.func; \
9- else \
10+ if (src.func) { \
11+ pax_open_kernel(); \
12+ *(void **)&dst.func = src.func; \
13+ pax_close_kernel(); \
14+ } else \
15 AuDbg("%s %s\n", au_sbtype(h_sb), #func); \
16 } \
17 } while (0)
18@@ -159,7 +161,9 @@
19 #define DySetForce(func, dst, src) do { \
20 AuDebugOn(!src.func); \
21 DyDbgInc(cnt); \
22- dst.func = src.func; \
23+ pax_open_kernel(); \
24+ *(void **)&dst.func = src.func; \
25+ pax_close_kernel(); \
26 } while (0)
27
28 #define DySetAop(func) \
29@@ -266,15 +270,17 @@
30 */
31 static void dy_adx(struct au_dyaop *dyaop, int do_dx)
32 {
33+ pax_open_kernel();
34 if (!do_dx) {
35- dyaop->da_op.direct_IO = NULL;
36- dyaop->da_op.get_xip_mem = NULL;
37+ *(void **)&dyaop->da_op.direct_IO = NULL;
38+ *(void **)&dyaop->da_op.get_xip_mem = NULL;
39 } else {
40- dyaop->da_op.direct_IO = aufs_aop.direct_IO;
41- dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
42+ *(void **)&dyaop->da_op.direct_IO = aufs_aop.direct_IO;
43+ *(void **)&dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
44 if (!dyaop->da_get_xip_mem)
45- dyaop->da_op.get_xip_mem = NULL;
46+ *(void **)&dyaop->da_op.get_xip_mem = NULL;
47 }
48+ pax_close_kernel();
49 }
50
51 static struct au_dyaop *dy_aget(struct au_branch *br,
63fa0b7e
AM
52--- linux-3.0/include/linux/fsnotify_backend.h~ 2011-07-22 04:17:23.000000000 +0200
53+++ linux-3.0/include/linux/fsnotify_backend.h 2011-08-24 13:39:25.587741912 +0200
54@@ -105,6 +105,7 @@ struct fsnotify_ops {
55 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group);
56 void (*free_event_priv)(struct fsnotify_event_private_data *priv);
57 };
58+typedef struct fsnotify_ops __no_const fsnotify_ops_no_const;
59
60 /*
61 * A group is a "thing" that wants to receive notification about filesystem
62--- linux-3.0/fs/aufs/branch.h.org 2011-08-24 13:39:47.194932184 +0200
63+++ linux-3.0/fs/aufs/branch.h 2011-08-24 13:39:53.691756219 +0200
64@@ -83,7 +83,7 @@ struct au_branch {
65
66 #ifdef CONFIG_AUFS_HFSNOTIFY
67 struct fsnotify_group *br_hfsn_group;
68- struct fsnotify_ops br_hfsn_ops;
69+ fsnotify_ops_no_const br_hfsn_ops;
70 #endif
71
72 #ifdef CONFIG_SYSFS
5d26c04f
AM
73--- linux-3.0/fs/aufs/f_op_sp.c~ 2011-08-24 14:41:55.000000000 +0200
74+++ linux-3.0/fs/aufs/f_op_sp.c 2011-08-24 14:54:22.072544774 +0200
75@@ -108,7 +108,7 @@
76 static int aufs_open_sp(struct inode *inode, struct file *file);
77 static struct au_sp_fop {
78 int done;
79- struct file_operations fop; /* not 'const' */
80+ file_operations_no_const fop; /* not 'const' */
81 spinlock_t spin;
82 } au_sp_fop[AuSp_Last] = {
83 [AuSp_FIFO] = {
84@@ -161,7 +161,9 @@ static void au_init_fop_sp(struct file *
85 h_file = au_hf_top(file);
86 spin_lock(&p->spin);
87 if (!p->done) {
88- p->fop = *h_file->f_op;
89+ pax_open_kernel();
90+ memcpy((void *)&p->fop, h_file->f_op, sizeof(p->fop));
91 p->fop.owner = THIS_MODULE;
92+ pax_close_kernel();
93 if (p->fop.aio_read)
94 p->fop.aio_read = aufs_aio_read_sp;
This page took 0.300645 seconds and 4 git commands to generate.