aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
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 /kernel
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 'kernel')
-rw-r--r--kernel/cgroup.c2
-rw-r--r--kernel/kprobes.c2
-rw-r--r--kernel/lockdep_proc.c2
-rw-r--r--kernel/trace/ftrace.c4
-rw-r--r--kernel/trace/trace.c4
5 files changed, 7 insertions, 7 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 213b7f92fcdd..cd83d9933b6b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2314,7 +2314,7 @@ static int cgroup_tasks_show(struct seq_file *s, void *v)
2314 return seq_printf(s, "%d\n", *(int *)v); 2314 return seq_printf(s, "%d\n", *(int *)v);
2315} 2315}
2316 2316
2317static struct seq_operations cgroup_tasks_seq_operations = { 2317static const struct seq_operations cgroup_tasks_seq_operations = {
2318 .start = cgroup_tasks_start, 2318 .start = cgroup_tasks_start,
2319 .stop = cgroup_tasks_stop, 2319 .stop = cgroup_tasks_stop,
2320 .next = cgroup_tasks_next, 2320 .next = cgroup_tasks_next,
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index ef177d653b2c..cfadc1291d0b 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1321,7 +1321,7 @@ static int __kprobes show_kprobe_addr(struct seq_file *pi, void *v)
1321 return 0; 1321 return 0;
1322} 1322}
1323 1323
1324static struct seq_operations kprobes_seq_ops = { 1324static const struct seq_operations kprobes_seq_ops = {
1325 .start = kprobe_seq_start, 1325 .start = kprobe_seq_start,
1326 .next = kprobe_seq_next, 1326 .next = kprobe_seq_next,
1327 .stop = kprobe_seq_stop, 1327 .stop = kprobe_seq_stop,
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
index d4b3dbc79fdb..d4aba4f3584c 100644
--- a/kernel/lockdep_proc.c
+++ b/kernel/lockdep_proc.c
@@ -594,7 +594,7 @@ static int ls_show(struct seq_file *m, void *v)
594 return 0; 594 return 0;
595} 595}
596 596
597static struct seq_operations lockstat_ops = { 597static const struct seq_operations lockstat_ops = {
598 .start = ls_start, 598 .start = ls_start,
599 .next = ls_next, 599 .next = ls_next,
600 .stop = ls_stop, 600 .stop = ls_stop,
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c71e91bf7372..23df7771c937 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1520,7 +1520,7 @@ static int t_show(struct seq_file *m, void *v)
1520 return 0; 1520 return 0;
1521} 1521}
1522 1522
1523static struct seq_operations show_ftrace_seq_ops = { 1523static const struct seq_operations show_ftrace_seq_ops = {
1524 .start = t_start, 1524 .start = t_start,
1525 .next = t_next, 1525 .next = t_next,
1526 .stop = t_stop, 1526 .stop = t_stop,
@@ -2459,7 +2459,7 @@ static int g_show(struct seq_file *m, void *v)
2459 return 0; 2459 return 0;
2460} 2460}
2461 2461
2462static struct seq_operations ftrace_graph_seq_ops = { 2462static const struct seq_operations ftrace_graph_seq_ops = {
2463 .start = g_start, 2463 .start = g_start,
2464 .next = g_next, 2464 .next = g_next,
2465 .stop = g_stop, 2465 .stop = g_stop,
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a35925d222ba..6c0f6a8a22eb 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1949,7 +1949,7 @@ static int s_show(struct seq_file *m, void *v)
1949 return 0; 1949 return 0;
1950} 1950}
1951 1951
1952static struct seq_operations tracer_seq_ops = { 1952static const struct seq_operations tracer_seq_ops = {
1953 .start = s_start, 1953 .start = s_start,
1954 .next = s_next, 1954 .next = s_next,
1955 .stop = s_stop, 1955 .stop = s_stop,
@@ -2163,7 +2163,7 @@ static int t_show(struct seq_file *m, void *v)
2163 return 0; 2163 return 0;
2164} 2164}
2165 2165
2166static struct seq_operations show_traces_seq_ops = { 2166static const struct seq_operations show_traces_seq_ops = {
2167 .start = t_start, 2167 .start = t_start,
2168 .next = t_next, 2168 .next = t_next,
2169 .stop = t_stop, 2169 .stop = t_stop,