lkml.org 
[lkml]   [2010]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2010-04-08 17:49    [W:0.030 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site