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:	Sat, 21 Nov 2009 00:02:57 +0000
From:	Alan Jenkins <alan-jenkins@...fmail.co.uk>
To:	Tony Luck <tony.luck@...il.com>
CC:	Rusty Russell <rusty@...tcorp.com.au>,
	Sam Ravnborg <sam@...nborg.org>,
	Mike Frysinger <vapier.adi@...il.com>, greg@...ah.com,
	linux-kbuild@...r.kernel.org, carmelo73@...il.com,
	linux-kernel@...r.kernel.org, achiang@...com, kyle@...artin.ca,
	deller@....de, jejb@...isc-linux.org,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	paulus@...ba.org
Subject: Re: [PATCH 05/10] kbuild: sort the list of symbols exported by the
 kernel (__ksymtab)

Tony Luck wrote:
> The sorted ksymtab breaks ia64 (and possibly ppc64 and
> parisc too).
>
> Alex Chiang did the bisect to find this change as
> the cause of the breakage.  The problem is that ia64
> expects that the first item in each ksymtab entry to be
> a function pointer.  The code in modpost that creates
> .tmp_exports-asm.S doesn't know about types of exported
> objects, so it uses __EXPORT_SYMBOL from linux/mod_export.h
> for everything. This results in
>
>         PTR SYM(sym);
>         PTR SYM(__kstrtab_##sym);
>
> which the preprocessor expands to entries like:
>
>         .long ____pagevec_lru_add
>         .long __kstrtab____pagevec_lru_add
>
> which puts the address of the first instruction of the
> function into the table, rather than the address of a
> function pointer (which on ia64 is a two element data
> object containing the code address and the global data
> pointer).
>
> The syntax you need for this* is:
>
>         .long @fptr(____pagevec_lru_add)
>         .long __kstrtab____pagevec_lru_add
>
> Note that you must only use the @fptr(name) syntax for
> function exports. Exported data items just need an address.
>
> -Tony
>
> * On ia64 ... powerpc and parisc might need something else.
>   

Thanks!  It doesn't sound too hard to retro-fit your suggestion.

Still, I can't help wondering if I've done this all wrong :-/.  Perhaps 
I should avoid the assembler.  Instead, I could write a tool to sort the 
ksymtab elf sections in-place (and mangle their relocations 
accordingly).  That should preserve any special handling for function 
symbols without arch-specific special cases.  It would also concentrate 
all the magic in one tool - rather than it being scattered between the 
modpost tool, mod_export.h, tmp_exports.S, and vmlinux.lds.h.

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