Skip to content

Commit

Permalink
selinux: use generic_file_llseek
Browse files Browse the repository at this point in the history
The default for llseek will change to no_llseek,
so selinuxfs needs to add explicit .llseek
assignments. Since we're dealing with regular
files from a VFS perspective, use generic_file_llseek.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Eric Paris <eparis@parisplace.org>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Arnd Bergmann authored and James Morris committed Aug 2, 2010
1 parent cdcd90f commit 57a62c2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
static const struct file_operations sel_enforce_ops = {
.read = sel_read_enforce,
.write = sel_write_enforce,
.llseek = generic_file_llseek,
};

static ssize_t sel_read_handle_unknown(struct file *filp, char __user *buf,
Expand All @@ -201,6 +202,7 @@ static ssize_t sel_read_handle_unknown(struct file *filp, char __user *buf,

static const struct file_operations sel_handle_unknown_ops = {
.read = sel_read_handle_unknown,
.llseek = generic_file_llseek,
};

#ifdef CONFIG_SECURITY_SELINUX_DISABLE
Expand Down Expand Up @@ -251,6 +253,7 @@ static ssize_t sel_write_disable(struct file *file, const char __user *buf,

static const struct file_operations sel_disable_ops = {
.write = sel_write_disable,
.llseek = generic_file_llseek,
};

static ssize_t sel_read_policyvers(struct file *filp, char __user *buf,
Expand All @@ -265,6 +268,7 @@ static ssize_t sel_read_policyvers(struct file *filp, char __user *buf,

static const struct file_operations sel_policyvers_ops = {
.read = sel_read_policyvers,
.llseek = generic_file_llseek,
};

/* declaration for sel_write_load */
Expand All @@ -289,6 +293,7 @@ static ssize_t sel_read_mls(struct file *filp, char __user *buf,

static const struct file_operations sel_mls_ops = {
.read = sel_read_mls,
.llseek = generic_file_llseek,
};

static ssize_t sel_write_load(struct file *file, const char __user *buf,
Expand Down Expand Up @@ -356,6 +361,7 @@ static ssize_t sel_write_load(struct file *file, const char __user *buf,

static const struct file_operations sel_load_ops = {
.write = sel_write_load,
.llseek = generic_file_llseek,
};

static ssize_t sel_write_context(struct file *file, char *buf, size_t size)
Expand Down Expand Up @@ -437,6 +443,7 @@ static ssize_t sel_write_checkreqprot(struct file *file, const char __user *buf,
static const struct file_operations sel_checkreqprot_ops = {
.read = sel_read_checkreqprot,
.write = sel_write_checkreqprot,
.llseek = generic_file_llseek,
};

/*
Expand Down Expand Up @@ -482,6 +489,7 @@ static const struct file_operations transaction_ops = {
.write = selinux_transaction_write,
.read = simple_transaction_read,
.release = simple_transaction_release,
.llseek = generic_file_llseek,
};

/*
Expand Down Expand Up @@ -883,6 +891,7 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
static const struct file_operations sel_bool_ops = {
.read = sel_read_bool,
.write = sel_write_bool,
.llseek = generic_file_llseek,
};

static ssize_t sel_commit_bools_write(struct file *filep,
Expand Down Expand Up @@ -935,6 +944,7 @@ static ssize_t sel_commit_bools_write(struct file *filep,

static const struct file_operations sel_commit_bools_ops = {
.write = sel_commit_bools_write,
.llseek = generic_file_llseek,
};

static void sel_remove_entries(struct dentry *de)
Expand Down Expand Up @@ -1127,10 +1137,12 @@ static ssize_t sel_read_avc_hash_stats(struct file *filp, char __user *buf,
static const struct file_operations sel_avc_cache_threshold_ops = {
.read = sel_read_avc_cache_threshold,
.write = sel_write_avc_cache_threshold,
.llseek = generic_file_llseek,
};

static const struct file_operations sel_avc_hash_stats_ops = {
.read = sel_read_avc_hash_stats,
.llseek = generic_file_llseek,
};

#ifdef CONFIG_SECURITY_SELINUX_AVC_STATS
Expand Down Expand Up @@ -1255,6 +1267,7 @@ static ssize_t sel_read_initcon(struct file *file, char __user *buf,

static const struct file_operations sel_initcon_ops = {
.read = sel_read_initcon,
.llseek = generic_file_llseek,
};

static int sel_make_initcon_files(struct dentry *dir)
Expand Down Expand Up @@ -1330,6 +1343,7 @@ static ssize_t sel_read_class(struct file *file, char __user *buf,

static const struct file_operations sel_class_ops = {
.read = sel_read_class,
.llseek = generic_file_llseek,
};

static ssize_t sel_read_perm(struct file *file, char __user *buf,
Expand All @@ -1354,6 +1368,7 @@ static ssize_t sel_read_perm(struct file *file, char __user *buf,

static const struct file_operations sel_perm_ops = {
.read = sel_read_perm,
.llseek = generic_file_llseek,
};

static ssize_t sel_read_policycap(struct file *file, char __user *buf,
Expand All @@ -1372,6 +1387,7 @@ static ssize_t sel_read_policycap(struct file *file, char __user *buf,

static const struct file_operations sel_policycap_ops = {
.read = sel_read_policycap,
.llseek = generic_file_llseek,
};

static int sel_make_perm_files(char *objclass, int classvalue,
Expand Down

0 comments on commit 57a62c2

Please sign in to comment.