Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88e9d34c authored by James Morris's avatar James Morris Committed by Linus Torvalds
Browse files

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: default avatarJames Morris <jmorris@namei.org>
Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
Acked-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b7ed698c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ static void c_stop(struct seq_file *m, void *v)
{
}

struct seq_operations cpuinfo_op = {
const struct seq_operations cpuinfo_op = {
	.start	= c_start,
	.next	= c_next,
	.stop	= c_stop,
+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ static void c_stop(struct seq_file *m, void *v)
{
}

struct seq_operations cpuinfo_op = {
const struct seq_operations cpuinfo_op = {
	.start =c_start,
	.next =	c_next,
	.stop =	c_stop,
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static int hc_show(struct seq_file *m, void *p)
	return 0;
}

static struct seq_operations hcall_inst_seq_ops = {
static const struct seq_operations hcall_inst_seq_ops = {
        .start = hc_start,
        .next  = hc_next,
        .stop  = hc_stop,
+1 −1
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ static void cciss_seq_stop(struct seq_file *seq, void *v)
	h->busy_configuring = 0;
}

static struct seq_operations cciss_seq_ops = {
static const struct seq_operations cciss_seq_ops = {
	.start = cciss_seq_start,
	.show  = cciss_seq_show,
	.next  = cciss_seq_next,
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ static int misc_seq_show(struct seq_file *seq, void *v)
}


static struct seq_operations misc_seq_ops = {
static const struct seq_operations misc_seq_ops = {
	.start = misc_seq_start,
	.next  = misc_seq_next,
	.stop  = misc_seq_stop,
Loading