From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758214AbcGZU6j (ORCPT ); Tue, 26 Jul 2016 16:58:39 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:60686 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753616AbcGZU6h (ORCPT ); Tue, 26 Jul 2016 16:58:37 -0400 From: Arnd Bergmann To: Kees Cook Cc: Greg Kroah-Hartman , LKML Subject: Re: [PATCH] lkdtm: fix maybe-uninitialized warning Date: Tue, 26 Jul 2016 22:58:32 +0200 Message-ID: <24917262.Z3gWB5hbbY@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-28-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <20160726122820.877422-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:EoZc8Js6RQlt1rRZep+OBoz39fJoiW1jUzBYRefsSYejfiXoKdX owSr+5lFzhMdQwYP8manX9pnoR3KFMfeZOTBBQ7oZyTJgdtiCef649s8QE6GEzHSMxWvNyd M3TtRaeW0hpH1ugQdPBxum8OnrbE6DAssuxYkkTTqDlt7x4AdcL5CkHqCqW7KX/0oaHbFK6 Zs4HU6Z55B5Kl+PcreDAg== X-UI-Out-Filterresults: notjunk:1;V01:K0:8JdkGhvi47Q=:bLEjvnsOENWEeA1iMq+27a 9TsjCCUaWTdDuR+yIZQXM0cKONyrztcosxXpKC/HZ8/EPdJKWbiPk/HUzbMfOH44E1Mp8hF2u ofVsQtbvkjXBValgpktKh1FGvhUP6tVB6RhzkcUqz1wL6gIglDUVv7kqBNen+unWW7ImZ91tb gdVlyMzKV9B53NPNTnmttOw9b57fLWbmLc81xAN6HGpNzOgoK5H6/bDxlhlt8Gv79cHvu8rWJ QeBlFjyacq0QSW+BAMWMGRMDuliudG+YJTwBCRNII91rpy8NIdTxMEEDbFgQCxhr0KOqUzlSl mQDBPslcgmWPcTcwsUJ/5RvLmp71XRyXx39YDYa3Rgl2dtZijKLKVk77XcdG7p6ifMnVmJEmm g/MJI3knSZ2hIKGf34ETU5hd/3CmJ5KrK/VuzjEScxoUVBDB79l5JmfT1Tm3aCOijomWtAqQs 8L4Y5YhNXqsfqkTIe4lLiE/2UYpk3L95kcneusZTzHgeZFRTnoJdlxGep3Tx9g9LtTqZ7AeiT X7q6TYJlk9KjOWS0T9gbF89pX2XirmdnL3wi0h8ZMY4HXfCjnEc7aGKxuFO4PjSDInvG4WD+K E1qNmXYRVpRDLqs/iP3/zs1mCT1+3aRwHPnKOwHnHPBuXBaAgWQj5i9UVJ+rXU1CiegBZpMPN sKsIH/Xn/ZUUOXOfsIGLCaqynbc0atNKR+nMSOStSLmp9zBb+6TOW8CmZibTYEh3DNrTlByBO KJqWncH39mSQgeXg Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, July 26, 2016 8:21:37 AM CEST Kees Cook wrote: > On Tue, Jul 26, 2016 at 5:28 AM, Arnd Bergmann wrote: > > The do_usercopy_stack() function uses uninitialized stack data to initialize > > more of the stack, which causes a warning in some configurations (ARM allmodconfig): > > > > drivers/misc/lkdtm_usercopy.c:52:15: warning: 'bad_stack' may be used uninitialized in this function [-Wmaybe-uninitialized] > > > > The warning gets reports by Mark Brown's build bot and looks correct (we are trying > > to trick the compiler here, and sometimes the compiler notices), and I could reproduce > > it with gcc-4.7 through gcc-5.3 but not gcc-6.1 for some reason. > > > > This changes the code to use the low byte of the address of the stack to initialize > > the stack data, instead of using data from the stack itself, to avoid the warning. > > > > Signed-off-by: Arnd Bergmann > > Fixes: a3dff71c1c88 ("lkdtm: split usercopy tests to separate file") > > Acked-by: Kees Cook > > I thought I already sent this fix to Greg? Possible. I mentioned the problem to you when it first showed up, but noticed today that I didn't have a patch for it in my testing tree (since I test with gcc-6.1, which doesn't show the bug). > Maybe it got lost... More likely that it's still in his backlog then. Arnd