diff options
author | James Morris <jmorris@namei.org> | 2009-09-22 19:43:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:29 -0400 |
commit | 88e9d34c727883d7d6f02cf1475b3ec98b8480c7 (patch) | |
tree | 475f544536d52739e0929e7727cab5124e855a06 /fs | |
parent | b7ed698cc9d556306a4088c238e2ea9311ea2cb3 (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.c | 8 | ||||
-rw-r--r-- | fs/dlm/debug_fs.c | 12 | ||||
-rw-r--r-- | fs/jbd2/journal.c | 4 | ||||
-rw-r--r-- | fs/nfs/client.c | 4 | ||||
-rw-r--r-- | fs/nfsd/export.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/cluster/netdebug.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmdebug.c | 2 | ||||
-rw-r--r-- | fs/proc/nommu.c | 2 |
8 files changed, 19 insertions, 19 deletions
diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 8630615e57f..852739d262a 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); | |||
28 | static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf, | 28 | static 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 | ||
31 | static struct seq_operations afs_proc_cells_ops = { | 31 | static 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, | |||
70 | static void afs_proc_cell_volumes_stop(struct seq_file *p, void *v); | 70 | static void afs_proc_cell_volumes_stop(struct seq_file *p, void *v); |
71 | static int afs_proc_cell_volumes_show(struct seq_file *m, void *v); | 71 | static int afs_proc_cell_volumes_show(struct seq_file *m, void *v); |
72 | 72 | ||
73 | static struct seq_operations afs_proc_cell_volumes_ops = { | 73 | static 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, | |||
95 | static void afs_proc_cell_vlservers_stop(struct seq_file *p, void *v); | 95 | static void afs_proc_cell_vlservers_stop(struct seq_file *p, void *v); |
96 | static int afs_proc_cell_vlservers_show(struct seq_file *m, void *v); | 96 | static int afs_proc_cell_vlservers_show(struct seq_file *m, void *v); |
97 | 97 | ||
98 | static struct seq_operations afs_proc_cell_vlservers_ops = { | 98 | static 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, | |||
119 | static void afs_proc_cell_servers_stop(struct seq_file *p, void *v); | 119 | static void afs_proc_cell_servers_stop(struct seq_file *p, void *v); |
120 | static int afs_proc_cell_servers_show(struct seq_file *m, void *v); | 120 | static int afs_proc_cell_servers_show(struct seq_file *m, void *v); |
121 | 121 | ||
122 | static struct seq_operations afs_proc_cell_servers_ops = { | 122 | static 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 1d1d2744223..1c8bb8c3a82 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 | ||
389 | static struct seq_operations format1_seq_ops; | 389 | static const struct seq_operations format1_seq_ops; |
390 | static struct seq_operations format2_seq_ops; | 390 | static const struct seq_operations format2_seq_ops; |
391 | static struct seq_operations format3_seq_ops; | 391 | static const struct seq_operations format3_seq_ops; |
392 | 392 | ||
393 | static void *table_seq_start(struct seq_file *seq, loff_t *pos) | 393 | static 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 | ||
537 | static struct seq_operations format1_seq_ops = { | 537 | static 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 | ||
544 | static struct seq_operations format2_seq_ops = { | 544 | static 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 | ||
551 | static struct seq_operations format3_seq_ops = { | 551 | static 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 a8a358bc0f2..53b86e16e5f 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 | ||
771 | static struct seq_operations jbd2_seq_history_ops = { | 771 | static 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 | ||
875 | static struct seq_operations jbd2_seq_info_ops = { | 875 | static 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 a7ce15d3c24..152025358da 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); | |||
1531 | static void nfs_server_list_stop(struct seq_file *p, void *v); | 1531 | static void nfs_server_list_stop(struct seq_file *p, void *v); |
1532 | static int nfs_server_list_show(struct seq_file *m, void *v); | 1532 | static int nfs_server_list_show(struct seq_file *m, void *v); |
1533 | 1533 | ||
1534 | static struct seq_operations nfs_server_list_ops = { | 1534 | static 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); | |||
1552 | static void nfs_volume_list_stop(struct seq_file *p, void *v); | 1552 | static void nfs_volume_list_stop(struct seq_file *p, void *v); |
1553 | static int nfs_volume_list_show(struct seq_file *m, void *v); | 1553 | static int nfs_volume_list_show(struct seq_file *m, void *v); |
1554 | 1554 | ||
1555 | static struct seq_operations nfs_volume_list_ops = { | 1555 | static 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 984a5ebcc1d..c1c9e035d4a 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 | ||
1520 | struct seq_operations nfs_exports_op = { | 1520 | const 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 f8424874fa0..cfb2be708ab 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 | ||
166 | static struct seq_operations nst_seq_ops = { | 166 | static 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 | ||
347 | static struct seq_operations sc_seq_ops = { | 347 | static 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 df52f706f66..c5c88124096 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 | ||
686 | static struct seq_operations debug_lockres_ops = { | 686 | static 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 7e14d1a0400..9fe7d7ebe11 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 | ||
112 | static struct seq_operations proc_nommu_region_list_seqop = { | 112 | static 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, |