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] [day] [month] [year] [list]
Date:	Wed, 30 Apr 2008 08:43:41 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Robin Getz <rgetz@...ckfin.uclinux.org>
Cc:	"Bryan Wu" <cooloney@...nel.org>, pmarques@...popie.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] kallsyms: Allow kernel symbols in L1 to be found in
 Blackfin architecture

On Wed, 30 Apr 2008 09:51:43 -0400 Robin Getz <rgetz@...ckfin.uclinux.org> wrote:

> On Tue 29 Apr 2008 18:00, Andrew Morton pondered: 
> > That's a bit grubby.  I suppose we could pretend not to have noticed,
> > but this really isn't the preferred way of putting arch-specific hooks into
> > arch-neutral code.
> > 
> > Nicer might be to add
> > 
> > void __weak arch_is_kernel_text(unsigned long addr)
> > {
> > 	return 0;
> > }
> > 
> > with a declaration in linux/kallsyms.h and then override
> > arch_is_kernel_text() in arch/blackfin/ code.
> 
> I will refactor, and send again.
> 

Thanks.

There are of course lots of other ways of doing it, apart from __weak. 
Many involve unpleasing ARCH_HAVE_FOO things.

Possibly cleaner would be, in kallsyms.c:

#ifndef arch_is_kernel_text
static inline int arch_is_kernel_text(unsigned long addr)
{
	return 0;
}
#define arch_is_kernel_text(addr) arch_is_kernel_text(addr)	// not really needed
#endif



and then, in a blackfin header file do

extern int arch_is_kernel_text(unsigned long addr);
#define arch_is_kernel_text(addr) arch_is_kernel_text(addr)


But personally I find all these party tricks a bit unpleasant.  The
definitive approach to implementing a per-arch kernel->arch interface is to
just implement it, dammit.  That means adding

static inline int arch_is_kernel_text(unsigned long addr)
{
	return 0;
}

to every architecture's include/asm/kallsyms.h, then doing blackfin's one
differently.

Verbose, but complete.
--
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