Messages in this thread | | | Date | Thu, 8 Apr 2010 08:42:38 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [GIT PULL] scheduler fix |
| |
On Thu, 8 Apr 2010, Ingo Molnar wrote: > > - if (len < nr_cpu_ids) > + if ((len * BITS_PER_BYTE) < nr_cpu_ids) > return -EINVAL;
Not that it really matters, but this will now fail for no good reason if you pass it a half-gigabyte area due to overflow.
Of course, if you pass it a half gig memory array, you're a f*cking moron to begin with, so I don't think anybody really _cares_. But in general, when checking system call arguments, I'd like people to think about overflow issues more.
In this case it doesn't matter, and overflow just makes the test more conservative than they need to be, but when it _does_ matter it often ends up being a security issue.
Linus
| |