lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTi=yEo9fcXW8SqUCtSOag7Mn_+Ni9Q@mail.gmail.com>
Date:	Sun, 12 Jun 2011 11:12:37 +0600
From:	Rakib Mullick <rakib.mullick@...il.com>
To:	Andrew Lutomirski <luto@....edu>
Cc:	mingo@...e.hu, hpa@...or.com, tglx@...utronix.de, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c

On Sat, Jun 11, 2011 at 5:01 PM, Andrew Lutomirski <luto@....edu> wrote:
> On Sat, Jun 11, 2011 at 3:31 AM, Rakib Mullick <rakib.mullick@...il.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?
>
In case of, vsyscall_nr is default it might gets uninitialized. And
current code already treats it as a bug.

>> -       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.)
>
If ret = EINVAL, then it means vsyscall_nr doesn't any of
gettimeofday, time or getcpu. So, I grounds it into fault. In case of
gettimeofday, EINVAL may gets return. But, maybe not in case of time
or getcpu. So, maybe we need to check EINVAL in case of gettimeofday
and maybe should separate EINVAL and EFAULT.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ