aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2009-09-22 19:43:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:29 -0400
commit88e9d34c727883d7d6f02cf1475b3ec98b8480c7 (patch)
tree475f544536d52739e0929e7727cab5124e855a06 /fs
parentb7ed698cc9d556306a4088c238e2ea9311ea2cb3 (diff)
seq_file: constify seq_operations
Make all seq_operations structs const, to help mitigate against revectoring user-triggerable function pointers. This is derived from the grsecurity patch, although generated from scratch because it's simpler than extracting the changes from there. Signed-off-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Acked-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/afs/proc.c8
-rw-r--r--fs/dlm/debug_fs.c12
-rw-r--r--fs/jbd2/journal.c4
-rw-r--r--fs/nfs/client.c4
-rw-r--r--fs/nfsd/export.c2
-rw-r--r--fs/ocfs2/cluster/netdebug.c4
-rw-r--r--fs/ocfs2/dlm/dlmdebug.c2
-rw-r--r--fs/proc/nommu.c2
8 files changed, 19 insertions, 19 deletions
diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 8630615e57fe..852739d262a9 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -28,7 +28,7 @@ static int afs_proc_cells_show(struct seq_file *m, void *v);
28static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf, 28static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf,
29 size_t size, loff_t *_pos); 29 size_t size, loff_t *_pos);
30 30
31static struct seq_operations afs_proc_cells_ops = { 31static const struct seq_operations afs_proc_cells_ops = {
32 .start = afs_proc_cells_start, 32 .start = afs_proc_cells_start,
33 .next = afs_proc_cells_next, 33 .next = afs_proc_cells_next,
34 .stop = afs_proc_cells_stop, 34 .stop = afs_proc_cells_stop,
@@ -70,7 +70,7 @@ static void *afs_proc_cell_volumes_next(struct seq_file *p, void *v,
70static void afs_proc_cell_volumes_stop(struct seq_file *p, void *v); 70static void afs_proc_cell_volumes_stop(struct seq_file *p, void *v);
71static int afs_proc_cell_volumes_show(struct seq_file *m, void *v); 71static int afs_proc_cell_volumes_show(struct seq_file *m, void *v);
72 72
73static struct seq_operations afs_proc_cell_volumes_ops = { 73static const struct seq_operations afs_proc_cell_volumes_ops = {
74 .start = afs_proc_cell_volumes_start, 74 .start = afs_proc_cell_volumes_start,
75 .next = afs_proc_cell_volumes_next, 75 .next = afs_proc_cell_volumes_next,
76 .stop = afs_proc_cell_volumes_stop, 76 .stop = afs_proc_cell_volumes_stop,
@@ -95,7 +95,7 @@ static void *afs_proc_cell_vlservers_next(struct seq_file *p, void *v,
95static void afs_proc_cell_vlservers_stop(struct seq_file *p, void *v); 95static void afs_proc_cell_vlservers_stop(struct seq_file *p, void *v);
96static int afs_proc_cell_vlservers_show(struct seq_file *m, void *v); 96static int afs_proc_cell_vlservers_show(struct seq_file *m, void *v);
97 97
98static struct seq_operations afs_proc_cell_vlservers_ops = { 98static const struct seq_operations afs_proc_cell_vlservers_ops = {
99 .start = afs_proc_cell_vlservers_start, 99 .start = afs_proc_cell_vlservers_start,
100 .next = afs_proc_cell_vlservers_next, 100 .next = afs_proc_cell_vlservers_next,
101 .stop = afs_proc_cell_vlservers_stop, 101 .stop = afs_proc_cell_vlservers_stop,
@@ -119,7 +119,7 @@ static void *afs_proc_cell_servers_next(struct seq_file *p, void *v,
119static void afs_proc_cell_servers_stop(struct seq_file *p, void *v); 119static void afs_proc_cell_servers_stop(struct seq_file *p, void *v);
120static int afs_proc_cell_servers_show(struct seq_file *m, void *v); 120static int afs_proc_cell_servers_show(struct seq_file *m, void *v);
121 121
122static struct seq_operations afs_proc_cell_servers_ops = { 122static const struct seq_operations afs_proc_cell_servers_ops = {
123 .start = afs_proc_cell_servers_start, 123 .start = afs_proc_cell_servers_start,
124 .next = afs_proc_cell_servers_next, 124 .next = afs_proc_cell_servers_next,
125 .stop = afs_proc_cell_servers_stop, 125 .stop = afs_proc_cell_servers_stop,
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c
index 1d1d27442235..1c8bb8c3a82e 100644
--- a/fs/dlm/debug_fs.c
+++ b/fs/dlm/debug_fs.c
@@ -386,9 +386,9 @@ static int table_seq_show(struct seq_file *seq, void *iter_ptr)
386 return rv; 386 return rv;
387} 387}
388 388
389static struct seq_operations format1_seq_ops; 389static const struct seq_operations format1_seq_ops;
390static struct seq_operations format2_seq_ops; 390static const struct seq_operations format2_seq_ops;
391static struct seq_operations format3_seq_ops; 391static const struct seq_operations format3_seq_ops;
392 392
393static void *table_seq_start(struct seq_file *seq, loff_t *pos) 393static void *table_seq_start(struct seq_file *seq, loff_t *pos)
394{ 394{
@@ -534,21 +534,21 @@ static void table_seq_stop(struct seq_file *seq, void *iter_ptr)
534 } 534 }
535} 535}
536 536
537static struct seq_operations format1_seq_ops = { 537static const struct seq_operations format1_seq_ops = {
538 .start = table_seq_start, 538 .start = table_seq_start,
539 .next = table_seq_next, 539 .next = table_seq_next,
540 .stop = table_seq_stop, 540 .stop = table_seq_stop,
541 .show = table_seq_show, 541 .show = table_seq_show,
542}; 542};
543 543
544static struct seq_operations format2_seq_ops = { 544static const struct seq_operations format2_seq_ops = {
545 .start = table_seq_start, 545 .start = table_seq_start,
546 .next = table_seq_next, 546 .next = table_seq_next,
547 .stop = table_seq_stop, 547 .stop = table_seq_stop,
548 .show = table_seq_show, 548 .show = table_seq_show,
549}; 549};
550 550
551static struct seq_operations format3_seq_ops = { 551static const struct seq_operations format3_seq_ops = {
552 .start = table_seq_start, 552 .start = table_seq_start,
553 .next = table_seq_next, 553 .next = table_seq_next,
554 .stop = table_seq_stop, 554 .stop = table_seq_stop,
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index a8a358bc0f21..53b86e16e5fe 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -768,7 +768,7 @@ static void jbd2_seq_history_stop(struct seq_file *seq, void *v)
768{ 768{
769} 769}
770 770
771static struct seq_operations jbd2_seq_history_ops = { 771static const struct seq_operations jbd2_seq_history_ops = {
772 .start = jbd2_seq_history_start, 772 .start = jbd2_seq_history_start,
773 .next = jbd2_seq_history_next, 773 .next = jbd2_seq_history_next,
774 .stop = jbd2_seq_history_stop, 774 .stop = jbd2_seq_history_stop,
@@ -872,7 +872,7 @@ static void jbd2_seq_info_stop(struct seq_file *seq, void *v)
872{ 872{
873} 873}
874 874
875static struct seq_operations jbd2_seq_info_ops = { 875static const struct seq_operations jbd2_seq_info_ops = {
876 .start = jbd2_seq_info_start, 876 .start = jbd2_seq_info_start,
877 .next = jbd2_seq_info_next, 877 .next = jbd2_seq_info_next,
878 .stop = jbd2_seq_info_stop, 878 .stop = jbd2_seq_info_stop,
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index a7ce15d3c248..152025358dad 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1531,7 +1531,7 @@ static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);
1531static void nfs_server_list_stop(struct seq_file *p, void *v); 1531static void nfs_server_list_stop(struct seq_file *p, void *v);
1532static int nfs_server_list_show(struct seq_file *m, void *v); 1532static int nfs_server_list_show(struct seq_file *m, void *v);
1533 1533
1534static struct seq_operations nfs_server_list_ops = { 1534static const struct seq_operations nfs_server_list_ops = {
1535 .start = nfs_server_list_start, 1535 .start = nfs_server_list_start,
1536 .next = nfs_server_list_next, 1536 .next = nfs_server_list_next,
1537 .stop = nfs_server_list_stop, 1537 .stop = nfs_server_list_stop,
@@ -1552,7 +1552,7 @@ static void *nfs_volume_list_next(struct seq_file *p, void *v, loff_t *pos);
1552static void nfs_volume_list_stop(struct seq_file *p, void *v); 1552static void nfs_volume_list_stop(struct seq_file *p, void *v);
1553static int nfs_volume_list_show(struct seq_file *m, void *v); 1553static int nfs_volume_list_show(struct seq_file *m, void *v);
1554 1554
1555static struct seq_operations nfs_volume_list_ops = { 1555static const struct seq_operations nfs_volume_list_ops = {
1556 .start = nfs_volume_list_start, 1556 .start = nfs_volume_list_start,
1557 .next = nfs_volume_list_next, 1557 .next = nfs_volume_list_next,
1558 .stop = nfs_volume_list_stop, 1558 .stop = nfs_volume_list_stop,
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 984a5ebcc1d6..c1c9e035d4a4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1517,7 +1517,7 @@ static int e_show(struct seq_file *m, void *p)
1517 return svc_export_show(m, &svc_export_cache, cp); 1517 return svc_export_show(m, &svc_export_cache, cp);
1518} 1518}
1519 1519
1520struct seq_operations nfs_exports_op = { 1520const struct seq_operations nfs_exports_op = {
1521 .start = e_start, 1521 .start = e_start,
1522 .next = e_next, 1522 .next = e_next,
1523 .stop = e_stop, 1523 .stop = e_stop,
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c
index f8424874fa07..cfb2be708abe 100644
--- a/fs/ocfs2/cluster/netdebug.c
+++ b/fs/ocfs2/cluster/netdebug.c
@@ -163,7 +163,7 @@ static void nst_seq_stop(struct seq_file *seq, void *v)
163{ 163{
164} 164}
165 165
166static struct seq_operations nst_seq_ops = { 166static const struct seq_operations nst_seq_ops = {
167 .start = nst_seq_start, 167 .start = nst_seq_start,
168 .next = nst_seq_next, 168 .next = nst_seq_next,
169 .stop = nst_seq_stop, 169 .stop = nst_seq_stop,
@@ -344,7 +344,7 @@ static void sc_seq_stop(struct seq_file *seq, void *v)
344{ 344{
345} 345}
346 346
347static struct seq_operations sc_seq_ops = { 347static const struct seq_operations sc_seq_ops = {
348 .start = sc_seq_start, 348 .start = sc_seq_start,
349 .next = sc_seq_next, 349 .next = sc_seq_next,
350 .stop = sc_seq_stop, 350 .stop = sc_seq_stop,
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index df52f706f669..c5c88124096d 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -683,7 +683,7 @@ static int lockres_seq_show(struct seq_file *s, void *v)
683 return 0; 683 return 0;
684} 684}
685 685
686static struct seq_operations debug_lockres_ops = { 686static const struct seq_operations debug_lockres_ops = {
687 .start = lockres_seq_start, 687 .start = lockres_seq_start,
688 .stop = lockres_seq_stop, 688 .stop = lockres_seq_stop,
689 .next = lockres_seq_next, 689 .next = lockres_seq_next,
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
index 7e14d1a04001..9fe7d7ebe115 100644
--- a/fs/proc/nommu.c
+++ b/fs/proc/nommu.c
@@ -109,7 +109,7 @@ static void *nommu_region_list_next(struct seq_file *m, void *v, loff_t *pos)
109 return rb_next((struct rb_node *) v); 109 return rb_next((struct rb_node *) v);
110} 110}
111 111
112static struct seq_operations proc_nommu_region_list_seqop = { 112static const struct seq_operations proc_nommu_region_list_seqop = {
113 .start = nommu_region_list_start, 113 .start = nommu_region_list_start,
114 .next = nommu_region_list_next, 114 .next = nommu_region_list_next,
115 .stop = nommu_region_list_stop, 115 .stop = nommu_region_list_stop,