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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140828143243.GH18016@ZenIV.linux.org.uk>
Date:	Thu, 28 Aug 2014 15:32:43 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	rtg.canonical@...il.com
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Tim Gardner <tim.gardner@...onical.com>
Subject: Re: [PATCH v2] fs: namespace: suppress 'may be used uninitialized'
 warnings

On Thu, Aug 28, 2014 at 07:55:49AM -0600, rtg.canonical@...il.com wrote:
> From: Tim Gardner <tim.gardner@...onical.com>
> 
> The gcc version 4.9.1 compiler complains even though it isn't possible for
> these variables to not get initialized before they are used.

Sigh...  The root cause of that shite is that copy_mount_string() is too
convoluted for gcc (piss-poor) detection of uninitialized variables.  And
yes, it is somewhat overcomplicated - it returns 0 or -E... *and* in former
case it returns NULL or a string as well, via a char ** argument.

The usual convention for such suckers is "return a pointer, using
ERR_PTR(-E...) to indicate an error".  We have all of 4 (four) callers,
all in fs/*.c (and nobody else could see that function, unless they manually
included fs/internal.h).

So let's turn that into
char *copy_mount_string(const void __user *data)
{
	return data ? strndup_user(data, PAGE_SIZE) : NULL;
}

and uses of that thing into
        kernel_type = copy_mount_string(type);
	ret = PTR_ERR(kernel_type);
        if (IS_ERR(kernel_type))
                goto out_type;
etc.
--
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