NetBSD Problem Report #52933

From  Thu Jan 18 18:02:11 2018
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id B89137A1B5
	for <>; Thu, 18 Jan 2018 18:02:11 +0000 (UTC)
Message-Id: <>
Date: Thu, 18 Jan 2018 18:02:10 +0000 (UTC)
Subject: earmv7hfeb kernel modules are fragile and CTF doesn't help
X-Send-Pr-Version: www-1.0

>Number:         52933
>Category:       port-arm32
>Synopsis:       earmv7hfeb kernel modules are fragile and CTF doesn't help
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    martin
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 18 18:05:00 +0000 2018
>Last-Modified:  Thu Jan 18 18:13:01 +0000 2018
>Originator:     Jonathan Kollasch
>Release:        -current circa 8.99.12
NetBSD  8.99.12 NetBSD 8.99.12 (SUNXI) #336: Thu Jan 18 11:02:40 CST 2018  jakllsch@terminus:/local/jakllsch/netbsd/obj/evbarm-earmv7hfeb/sys/arch/evbarm/compile/SUNXI evbarm earmv7hfeb
Kernel modules for BE8 ARMv[67] are currently built as BE32 objects, the kernel bswaps .text on load.  If ctfconvert is run the kmod, the BE8 symbols ($a, $t, $d) become corrupted, and much of the .text is left with big endian wordcode, which is incorrect and often invalid in a BE8 kernel.

`objdump --special-syms -t modules/examples/hello/hello.o` before ctfconvert:
00000000 l       .text  00000000 $a
00000010 l       .debug_frame   00000000 $d

after ctfconvert:
00000000 l       .text  00000000 $a
00000010 l       .text  00000000 $d

this now-stray $d inhibits the previous $a which was expected to cover the rest of the .text.

It might also be argued that BE8 .kmods should be built for ARMv[67]-EB BE8 kernels.
modload ./hello.kmod;
observe crash due to undefined instructions or failure to load due to opposite-endian relocations.



Responsible-Changed-From-To: port-arm32-maintainer->martin
Responsible-Changed-When: Thu, 18 Jan 2018 18:13:01 +0000


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.