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>] [day] [month] [year] [list]
Message-ID: <4CDAC4FB.8040905@linux.intel.com>
Date:	Wed, 10 Nov 2010 08:14:51 -0800
From:	Darren Hart <dvhart@...ux.intel.com>
To:	mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
	eric.dumazet@...il.com, jkacur@...hat.com, dvhart@...ux.intel.com,
	peterz@...radead.org, matt@...sole-pimps.org,
	u.kleine-koenig@...gutronix.de, tglx@...utronix.de, mingo@...e.hu
CC:	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:core/urgent] futex: Address compiler warnings in exit_robust_list

On 11/10/2010 04:30 AM, tip-bot for Darren Hart wrote:
> Commit-ID:  4c115e951d80aff126468adaec7a6c7854f61ab8
> Gitweb:     http://git.kernel.org/tip/4c115e951d80aff126468adaec7a6c7854f61ab8
> Author:     Darren Hart<dvhart@...ux.intel.com>
> AuthorDate: Thu, 4 Nov 2010 15:00:00 -0400
> Committer:  Thomas Gleixner<tglx@...utronix.de>
> CommitDate: Wed, 10 Nov 2010 13:27:50 +0100
>
> futex: Address compiler warnings in exit_robust_list
>
> Since commit 1dcc41bb (futex: Change 3rd arg of fetch_robust_entry()
> to unsigned int*) some gcc versions decided to emit the following
> warning:
>
> kernel/futex.c: In function ‘exit_robust_list’:
> kernel/futex.c:2492: warning: ‘next_pi’ may be used uninitialized in this function
>
> The commit did not introduce the warning as gcc should have warned
> before that commit as well. It's just gcc being silly.


I agree that it should not have - but I did the bisect and this is the 
patch where the warning was first observed. I agree that it is still gcc 
being silly, and I don't know why it treats uninitialized ints different 
than uninitialized unsigned ints (or why it thinks this value is every 
used uninitialized for that matter).

Thanks for catching the compat-futex.c

--
Darren

>
> The code path really can't result in next_pi being unitialized (or
> should not), but let's keep the build clean. Annotate next_pi as an
> uninitialized_var.
>
> [ tglx: Addressed the same issue in futex_compat.c and massaged the
>    	changelog ]
>
> Signed-off-by: Darren Hart<dvhart@...ux.intel.com>
> Tested-by: Matt Fleming<matt@...sole-pimps.org>
> Tested-by: Uwe Kleine-König<u.kleine-koenig@...gutronix.de>
> Cc: Peter Zijlstra<peterz@...radead.org>
> Cc: Eric Dumazet<eric.dumazet@...il.com>
> Cc: John Kacur<jkacur@...hat.com>
> Cc: Ingo Molnar<mingo@...e.hu>
> LKML-Reference:<1288897200-13008-1-git-send-email-dvhart@...ux.intel.com>
> Signed-off-by: Thomas Gleixner<tglx@...utronix.de>
> ---
>   kernel/futex.c        |    3 ++-
>   kernel/futex_compat.c |    3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/futex.c b/kernel/futex.c
> index 6c683b3..40a8777 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -2489,7 +2489,8 @@ void exit_robust_list(struct task_struct *curr)
>   {
>   	struct robust_list_head __user *head = curr->robust_list;
>   	struct robust_list __user *entry, *next_entry, *pending;
> -	unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip;
> +	unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
> +	unsigned int uninitialized_var(next_pi);
>   	unsigned long futex_offset;
>   	int rc;
>
> diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
> index 06da4df..a7934ac 100644
> --- a/kernel/futex_compat.c
> +++ b/kernel/futex_compat.c
> @@ -49,7 +49,8 @@ void compat_exit_robust_list(struct task_struct *curr)
>   {
>   	struct compat_robust_list_head __user *head = curr->compat_robust_list;
>   	struct robust_list __user *entry, *next_entry, *pending;
> -	unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip;
> +	unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
> +	unsigned int uninitialized_var(next_pi);
>   	compat_uptr_t uentry, next_uentry, upending;
>   	compat_long_t futex_offset;
>   	int rc;


-- 
Darren Hart
Embedded Linux Kernel
--
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