git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[IRDA]: Fix rfcomm use-after-free
[pandora-kernel.git]
/
fs
/
binfmt_misc.c
diff --git
a/fs/binfmt_misc.c
b/fs/binfmt_misc.c
index
e6f5799
..
42e94b3
100644
(file)
--- a/
fs/binfmt_misc.c
+++ b/
fs/binfmt_misc.c
@@
-18,7
+18,7
@@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/init.h>
-
+#include <linux/sched.h>
#include <linux/binfmts.h>
#include <linux/slab.h>
#include <linux/ctype.h>
#include <linux/binfmts.h>
#include <linux/slab.h>
#include <linux/ctype.h>
@@
-126,7
+126,9
@@
static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
goto _ret;
if (!(fmt->flags & MISC_FMT_PRESERVE_ARGV0)) {
goto _ret;
if (!(fmt->flags & MISC_FMT_PRESERVE_ARGV0)) {
- remove_arg_zero(bprm);
+ retval = remove_arg_zero(bprm);
+ if (retval)
+ goto _ret;
}
if (fmt->flags & MISC_FMT_OPEN_BINARY) {
}
if (fmt->flags & MISC_FMT_OPEN_BINARY) {
@@
-675,19
+677,8
@@
static ssize_t
bm_status_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
{
char *s = enabled ? "enabled" : "disabled";
bm_status_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
{
char *s = enabled ? "enabled" : "disabled";
- int len = strlen(s);
- loff_t pos = *ppos;
- if (pos < 0)
- return -EINVAL;
- if (pos >= len)
- return 0;
- if (len < pos + nbytes)
- nbytes = len - pos;
- if (copy_to_user(buf, s + pos, nbytes))
- return -EFAULT;
- *ppos = pos + nbytes;
- return nbytes;
+ return simple_read_from_buffer(buf, nbytes, ppos, s, strlen(s));
}
static ssize_t bm_status_write(struct file * file, const char __user * buffer,
}
static ssize_t bm_status_write(struct file * file, const char __user * buffer,
@@
-727,8
+718,8
@@
static const struct super_operations s_ops = {
static int bm_fill_super(struct super_block * sb, void * data, int silent)
{
static struct tree_descr bm_files[] = {
static int bm_fill_super(struct super_block * sb, void * data, int silent)
{
static struct tree_descr bm_files[] = {
- [
1
] = {"status", &bm_status_operations, S_IWUSR|S_IRUGO},
- [
2
] = {"register", &bm_register_operations, S_IWUSR},
+ [
2
] = {"status", &bm_status_operations, S_IWUSR|S_IRUGO},
+ [
3
] = {"register", &bm_register_operations, S_IWUSR},
/* last one */ {""}
};
int err = simple_fill_super(sb, 0x42494e4d, bm_files);
/* last one */ {""}
};
int err = simple_fill_super(sb, 0x42494e4d, bm_files);