Commit 51e4faad authored by Steve French's avatar Steve French

Merge bk://linux.bkbits.net/linux-2.5

into bkbits.net:/repos/c/cifs/linux-2.5cifs
parents b1c5bf7c f9286bcf
...@@ -768,6 +768,8 @@ inline int resize_screen(int currcons, int width, int height) ...@@ -768,6 +768,8 @@ inline int resize_screen(int currcons, int width, int height)
* [this is to be used together with some user program * [this is to be used together with some user program
* like resize that changes the hardware videomode] * like resize that changes the hardware videomode]
*/ */
#define VC_RESIZE_MAXCOL (32767)
#define VC_RESIZE_MAXROW (32767)
int vc_resize(int currcons, unsigned int cols, unsigned int lines) int vc_resize(int currcons, unsigned int cols, unsigned int lines)
{ {
unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0; unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
...@@ -780,6 +782,9 @@ int vc_resize(int currcons, unsigned int cols, unsigned int lines) ...@@ -780,6 +782,9 @@ int vc_resize(int currcons, unsigned int cols, unsigned int lines)
if (!vc_cons_allocated(currcons)) if (!vc_cons_allocated(currcons))
return -ENXIO; return -ENXIO;
if (cols > VC_RESIZE_MAXCOL || lines > VC_RESIZE_MAXROW)
return -EINVAL;
new_cols = (cols ? cols : video_num_columns); new_cols = (cols ? cols : video_num_columns);
new_rows = (lines ? lines : video_num_lines); new_rows = (lines ? lines : video_num_lines);
new_row_size = new_cols << 1; new_row_size = new_cols << 1;
......
...@@ -1387,25 +1387,25 @@ int compat_do_execve(char * filename, ...@@ -1387,25 +1387,25 @@ int compat_do_execve(char * filename,
int retval; int retval;
int i; int i;
file = open_exec(filename);
retval = PTR_ERR(file);
if (IS_ERR(file))
return retval;
sched_exec();
retval = -ENOMEM; retval = -ENOMEM;
bprm = kmalloc(sizeof(*bprm), GFP_KERNEL); bprm = kmalloc(sizeof(*bprm), GFP_KERNEL);
if (!bprm) if (!bprm)
goto out_ret; goto out_ret;
memset(bprm, 0, sizeof(*bprm)); memset(bprm, 0, sizeof(*bprm));
file = open_exec(filename);
retval = PTR_ERR(file);
if (IS_ERR(file))
goto out_kfree;
sched_exec();
bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
bprm->file = file; bprm->file = file;
bprm->filename = filename; bprm->filename = filename;
bprm->interp = filename; bprm->interp = filename;
bprm->mm = mm_alloc(); bprm->mm = mm_alloc();
retval = -ENOMEM;
if (!bprm->mm) if (!bprm->mm)
goto out_file; goto out_file;
...@@ -1472,6 +1472,8 @@ int compat_do_execve(char * filename, ...@@ -1472,6 +1472,8 @@ int compat_do_execve(char * filename,
allow_write_access(bprm->file); allow_write_access(bprm->file);
fput(bprm->file); fput(bprm->file);
} }
out_kfree:
kfree(bprm); kfree(bprm);
out_ret: out_ret:
......
...@@ -1094,26 +1094,26 @@ int do_execve(char * filename, ...@@ -1094,26 +1094,26 @@ int do_execve(char * filename,
int retval; int retval;
int i; int i;
file = open_exec(filename);
retval = PTR_ERR(file);
if (IS_ERR(file))
return retval;
sched_exec();
retval = -ENOMEM; retval = -ENOMEM;
bprm = kmalloc(sizeof(*bprm), GFP_KERNEL); bprm = kmalloc(sizeof(*bprm), GFP_KERNEL);
if (!bprm) if (!bprm)
goto out_ret; goto out_ret;
memset(bprm, 0, sizeof(*bprm)); memset(bprm, 0, sizeof(*bprm));
file = open_exec(filename);
retval = PTR_ERR(file);
if (IS_ERR(file))
goto out_kfree;
sched_exec();
bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
bprm->file = file; bprm->file = file;
bprm->filename = filename; bprm->filename = filename;
bprm->interp = filename; bprm->interp = filename;
bprm->mm = mm_alloc(); bprm->mm = mm_alloc();
retval = -ENOMEM;
if (!bprm->mm) if (!bprm->mm)
goto out_file; goto out_file;
...@@ -1180,6 +1180,8 @@ int do_execve(char * filename, ...@@ -1180,6 +1180,8 @@ int do_execve(char * filename,
allow_write_access(bprm->file); allow_write_access(bprm->file);
fput(bprm->file); fput(bprm->file);
} }
out_kfree:
kfree(bprm); kfree(bprm);
out_ret: out_ret:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment