aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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 'drivers')
-rw-r--r--drivers/block/cciss.c2
-rw-r--r--drivers/char/misc.c2
-rw-r--r--drivers/char/tpm/tpm_bios.c4
-rw-r--r--drivers/isdn/capi/kcapi_proc.c10
-rw-r--r--drivers/scsi/sg.c6
5 files changed, 12 insertions, 12 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 4f19105f755c..24c3e21ab263 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -363,7 +363,7 @@ static void cciss_seq_stop(struct seq_file *seq, void *v)
363 h->busy_configuring = 0; 363 h->busy_configuring = 0;
364} 364}
365 365
366static struct seq_operations cciss_seq_ops = { 366static const struct seq_operations cciss_seq_ops = {
367 .start = cciss_seq_start, 367 .start = cciss_seq_start,
368 .show = cciss_seq_show, 368 .show = cciss_seq_show,
369 .next = cciss_seq_next, 369 .next = cciss_seq_next,
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 1ee27cc23426..07fa612a58d5 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -91,7 +91,7 @@ static int misc_seq_show(struct seq_file *seq, void *v)
91} 91}
92 92
93 93
94static struct seq_operations misc_seq_ops = { 94static const struct seq_operations misc_seq_ops = {
95 .start = misc_seq_start, 95 .start = misc_seq_start,
96 .next = misc_seq_next, 96 .next = misc_seq_next,
97 .stop = misc_seq_stop, 97 .stop = misc_seq_stop,
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
index 0c2f55a38b95..bf2170fb1cdd 100644
--- a/drivers/char/tpm/tpm_bios.c
+++ b/drivers/char/tpm/tpm_bios.c
@@ -343,14 +343,14 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
343 return 0; 343 return 0;
344} 344}
345 345
346static struct seq_operations tpm_ascii_b_measurments_seqops = { 346static const struct seq_operations tpm_ascii_b_measurments_seqops = {
347 .start = tpm_bios_measurements_start, 347 .start = tpm_bios_measurements_start,
348 .next = tpm_bios_measurements_next, 348 .next = tpm_bios_measurements_next,
349 .stop = tpm_bios_measurements_stop, 349 .stop = tpm_bios_measurements_stop,
350 .show = tpm_ascii_bios_measurements_show, 350 .show = tpm_ascii_bios_measurements_show,
351}; 351};
352 352
353static struct seq_operations tpm_binary_b_measurments_seqops = { 353static const struct seq_operations tpm_binary_b_measurments_seqops = {
354 .start = tpm_bios_measurements_start, 354 .start = tpm_bios_measurements_start,
355 .next = tpm_bios_measurements_next, 355 .next = tpm_bios_measurements_next,
356 .stop = tpm_bios_measurements_stop, 356 .stop = tpm_bios_measurements_stop,
diff --git a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c
index 50ed778f63fc..09d4db764d22 100644
--- a/drivers/isdn/capi/kcapi_proc.c
+++ b/drivers/isdn/capi/kcapi_proc.c
@@ -89,14 +89,14 @@ static int contrstats_show(struct seq_file *seq, void *v)
89 return 0; 89 return 0;
90} 90}
91 91
92static struct seq_operations seq_controller_ops = { 92static const struct seq_operations seq_controller_ops = {
93 .start = controller_start, 93 .start = controller_start,
94 .next = controller_next, 94 .next = controller_next,
95 .stop = controller_stop, 95 .stop = controller_stop,
96 .show = controller_show, 96 .show = controller_show,
97}; 97};
98 98
99static struct seq_operations seq_contrstats_ops = { 99static const struct seq_operations seq_contrstats_ops = {
100 .start = controller_start, 100 .start = controller_start,
101 .next = controller_next, 101 .next = controller_next,
102 .stop = controller_stop, 102 .stop = controller_stop,
@@ -194,14 +194,14 @@ applstats_show(struct seq_file *seq, void *v)
194 return 0; 194 return 0;
195} 195}
196 196
197static struct seq_operations seq_applications_ops = { 197static const struct seq_operations seq_applications_ops = {
198 .start = applications_start, 198 .start = applications_start,
199 .next = applications_next, 199 .next = applications_next,
200 .stop = applications_stop, 200 .stop = applications_stop,
201 .show = applications_show, 201 .show = applications_show,
202}; 202};
203 203
204static struct seq_operations seq_applstats_ops = { 204static const struct seq_operations seq_applstats_ops = {
205 .start = applications_start, 205 .start = applications_start,
206 .next = applications_next, 206 .next = applications_next,
207 .stop = applications_stop, 207 .stop = applications_stop,
@@ -264,7 +264,7 @@ static int capi_driver_show(struct seq_file *seq, void *v)
264 return 0; 264 return 0;
265} 265}
266 266
267static struct seq_operations seq_capi_driver_ops = { 267static const struct seq_operations seq_capi_driver_ops = {
268 .start = capi_driver_start, 268 .start = capi_driver_start,
269 .next = capi_driver_next, 269 .next = capi_driver_next,
270 .stop = capi_driver_stop, 270 .stop = capi_driver_stop,
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 4968c4ced385..848b59466850 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -2233,7 +2233,7 @@ static struct file_operations dev_fops = {
2233 .open = sg_proc_open_dev, 2233 .open = sg_proc_open_dev,
2234 .release = seq_release, 2234 .release = seq_release,
2235}; 2235};
2236static struct seq_operations dev_seq_ops = { 2236static const struct seq_operations dev_seq_ops = {
2237 .start = dev_seq_start, 2237 .start = dev_seq_start,
2238 .next = dev_seq_next, 2238 .next = dev_seq_next,
2239 .stop = dev_seq_stop, 2239 .stop = dev_seq_stop,
@@ -2246,7 +2246,7 @@ static struct file_operations devstrs_fops = {
2246 .open = sg_proc_open_devstrs, 2246 .open = sg_proc_open_devstrs,
2247 .release = seq_release, 2247 .release = seq_release,
2248}; 2248};
2249static struct seq_operations devstrs_seq_ops = { 2249static const struct seq_operations devstrs_seq_ops = {
2250 .start = dev_seq_start, 2250 .start = dev_seq_start,
2251 .next = dev_seq_next, 2251 .next = dev_seq_next,
2252 .stop = dev_seq_stop, 2252 .stop = dev_seq_stop,
@@ -2259,7 +2259,7 @@ static struct file_operations debug_fops = {
2259 .open = sg_proc_open_debug, 2259 .open = sg_proc_open_debug,
2260 .release = seq_release, 2260 .release = seq_release,
2261}; 2261};
2262static struct seq_operations debug_seq_ops = { 2262static const struct seq_operations debug_seq_ops = {
2263 .start = dev_seq_start, 2263 .start = dev_seq_start,
2264 .next = dev_seq_next, 2264 .next = dev_seq_next,
2265 .stop = dev_seq_stop, 2265 .stop = dev_seq_stop,