Commit a68ea0e0 authored by David Mosberger's avatar David Mosberger

ia64: Patch by Arun Sharma: Undo bad sys32_select() fix: The biggest value of n below

is INT_MAX and the value of size for n = INT_MAX is 268435456. So I don't think
there'll be an overflow.
parent f18d92a3
...@@ -836,9 +836,8 @@ sys32_select (int n, fd_set *inp, fd_set *outp, fd_set *exp, struct compat_timev ...@@ -836,9 +836,8 @@ sys32_select (int n, fd_set *inp, fd_set *outp, fd_set *exp, struct compat_timev
} }
} }
size = FDS_BYTES(n);
ret = -EINVAL; ret = -EINVAL;
if (n < 0 || size < n) if (n < 0)
goto out_nofds; goto out_nofds;
if (n > current->files->max_fdset) if (n > current->files->max_fdset)
...@@ -850,6 +849,7 @@ sys32_select (int n, fd_set *inp, fd_set *outp, fd_set *exp, struct compat_timev ...@@ -850,6 +849,7 @@ sys32_select (int n, fd_set *inp, fd_set *outp, fd_set *exp, struct compat_timev
* long-words. * long-words.
*/ */
ret = -ENOMEM; ret = -ENOMEM;
size = FDS_BYTES(n);
bits = kmalloc(6 * size, GFP_KERNEL); bits = kmalloc(6 * size, GFP_KERNEL);
if (!bits) if (!bits)
goto out_nofds; goto out_nofds;
......
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