lkml.org 
[lkml]   [2013]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATH v4] itimers: Remove bogus NULL pointer check in sys_getitimer()
Hello Maintainers:

Please help check this patch, when you have time.

Thanks.

On 07/05/2013 09:28 AM, Chen Gang wrote:
> Hello Maintainers:
>
> Is this patch under the normal work flow (or I should need a little more
> patience) ?
>
> Thanks.
>
> On 06/25/2013 09:16 AM, Chen Gang wrote:
>> People might be tricked into assuming that the return value for a
>> failed NULL pointer check should be -EINVAL instead of -EFAULT.
>>
>> Remove the misleading NULL pointer check to fix this nuisance.
>>
>> Aside of that this patch fixes the problem of NOMMU kernels, where
>> a NULL pointer dereference is a valid operation. This allows to
>> boot NOMMU kernels without working around the shortcomings of the
>> getitimer() system call, which have been ignored since this NULL
>> pointer check was introduced in Linux 0.96a.
>>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>> kernel/itimer.c | 13 ++++++-------
>> 1 files changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/kernel/itimer.c b/kernel/itimer.c
>> index 8d262b4..3b12271 100644
>> --- a/kernel/itimer.c
>> +++ b/kernel/itimer.c
>> @@ -102,15 +102,14 @@ int do_getitimer(int which, struct itimerval *value)
>>
>> SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value)
>> {
>> - int error = -EFAULT;
>> + int error;
>> struct itimerval get_buffer;
>>
>> - if (value) {
>> - error = do_getitimer(which, &get_buffer);
>> - if (!error &&
>> - copy_to_user(value, &get_buffer, sizeof(get_buffer)))
>> - error = -EFAULT;
>> - }
>> + error = do_getitimer(which, &get_buffer);
>> + if (!error &&
>> + copy_to_user(value, &get_buffer, sizeof(get_buffer)))
>> + error = -EFAULT;
>> +
>> return error;
>> }
>>
>>
>
>


--
Chen Gang


\
 
 \ /
  Last update: 2013-07-22 05:01    [W:0.076 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site