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]
Date:	Thu, 06 Feb 2014 15:58:20 +0100
From:	Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
To:	"H. Peter Anvin" <hpa@...or.com>, Meelis Roos <mroos@...ux.ee>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: 3.13: BUG: unable to handle kernel paging request at 00000000b4343e88

On 05.02.2014 18:36, H. Peter Anvin wrote:
> On 02/05/2014 09:00 AM, Peter Oberparleiter wrote:
>>
>> Could you give this patch a try? It is a variation of the approach
>> proposed in the discussion mentioned earlier and fixes the problem
>> on my system.
>>
> 
> I would rather suggest that we explicitly disable gcov etc. from these
> kinds of small, magic primitives.  Honestly, you're just trying to put a
> bandaid on a gaping wound.
> 
> The real thing here is that hweight.c is not a normal C file, and we
> shouldn't treat is as such.  It is a constrained environment, and trying
> to tack crap like gcov to it is bound to lose, simply because gcov
> doesn't know the rules it has to play by.
> 
> Even with the below change, if gcov clobbers, say, %rdx we're still screwed.

I'm fine with the proposed alternative of disabling gcov profiling for
lib/hweight.c. The patch below fixes the problem on my test system.

---
x86/hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y

Commit d61931d89b, "x86: Add optimized popcnt variants" introduced
compile flag -fcall-saved-rdi for lib/hweight.c. When combined with
options -fprofile-arcs and -O2, this flag causes gcc to generate broken
constructor code. As a result, a 64 bit x86 kernel compiled with
CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create file"
and runs into sproadic BUGs during boot.

This patch avoids the bug by excluding lib/hweight.o from coverage
profiling.

Reported-by: Meelis Roos <mroos@...ux.ee>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
---
 lib/Makefile |    1 +
 1 file changed, 1 insertion(+)
diff -Naurp a/lib/Makefile b/lib/Makefile
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o
 obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
 obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o

+GCOV_PROFILE_hweight.o := n
 CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS))
 obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o

--
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