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:	Wed, 16 Jun 2010 15:22:57 -0400
From:	Kyle McMartin <kyle@...artin.ca>
To:	Vladislav Bolkhovitin <vst@...b.net>
Cc:	sparclinux@...r.kernel.org, Simone Ricci <simone.ricci@...il.com>,
	scst-devel@...ts.sourceforge.net,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Nick Couchman <Nick.Couchman@...kr.com>, davem@...emloft.net
Subject: Re: Error "Unknown relocation: 36" on module load on Sparc

On Wed, Jun 16, 2010 at 11:05:41PM +0400, Vladislav Bolkhovitin wrote:
> FATAL: Error inserting scst  
> (/lib/modules/2.6.26-2-sparc64/extra/scst.ko): Invalid module format
>
> The following message is immediately spit out by the kernel:
> [ 1686.676534] module scst: Unknown relocation: 36
>

The error is caused because gcc is generating a relocation type that the
kernel's module loader cannot handle.

This appears to be:
libelf/elf.h:#define R_SPARC_LM22               36      /* Low middle 22
bits of ... */

It doesn't occur when patched into the kernel build, since the
relocations are handled at link time as opposed to load time.

arch/sparc/kernel/module.c needs to be patched to support the new
relocation type... Based on binutils/gas/config/tc-sparc.c and gold's
sparc config this looks to be the same as the hi22 reloc...

Can you test the following patch?

regards, Kyle

---
diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h
index e678803..8bf59f1 100644
--- a/arch/sparc/include/asm/elf_64.h
+++ b/arch/sparc/include/asm/elf_64.h
@@ -52,6 +52,7 @@
 #define R_SPARC_11		31
 #define R_SPARC_64		32
 #define R_SPARC_OLO10		33
+#define R_SPARC_LM22		36
 #define R_SPARC_WDISP16		40
 #define R_SPARC_WDISP19		41
 #define R_SPARC_7		43
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index f848aad..49b1b21 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -207,6 +207,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
 			*loc32 = (*loc32 & ~0x3ff) | (v & 0x3ff);
 			break;
 
+		case R_SPARC_LM22:
 		case R_SPARC_HI22:
 			*loc32 = (*loc32 & ~0x3fffff) |
 				((v >> 10) & 0x3fffff);
--
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