lkml.org 
[lkml]   [2011]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c
On Sat, Jun 11, 2011 at 3:31 AM, Rakib Mullick <rakib.mullick@gmail.com> wrote:
> Due to commit 5cec93c216db77 (x86-64: Emulate legacy vsyscalls), we get the following warning:
>
>   arch/x86/kernel/vsyscall_64.c: In function ‘do_emulate_vsyscall’:
>   arch/x86/kernel/vsyscall_64.c:111:7: warning: ‘ret’ may be used uninitialized in this function

What's the code path that uses ret without initializing it?

> -       if (ret == -EFAULT) {
> +       if (ret == -EFAULT || ret == -EINVAL) {
>                /*
>                 * Bad news -- userspace fed a bad pointer to a vsyscall.
>                 *

EINVAL doesn't seem like grounds to fault. (I'm not sure how to get
EINVAL from time, gettimeofday, or getcpu, but in case there is, we
should return it back to userspace.)

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-06-11 13:05    [W:0.158 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site