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, 17 Jul 2008 12:39:30 -0500
From:	Nathan Lynch <ntl@...ox.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	benh@...nel.crashing.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org,
	roland@...hat.com
Subject: Re: [PATCH] elf loader support for auxvec base platform string

Andrew Morton wrote:
> > On Tue, 2008-07-15 at 18:58 -0500, Nathan Lynch wrote:
> > > diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
> > > index d48ff5f..834c2c4 100644
> > > --- a/fs/binfmt_elf.c
> > > +++ b/fs/binfmt_elf.c
> > > @@ -131,6 +131,10 @@ static int padzero(unsigned long elf_bss)
> > >  #define STACK_ALLOC(sp, len) ({ sp -= len ; sp; })
> > >  #endif
> > >  
> > > +#ifndef ELF_BASE_PLATFORM
> > > +#define ELF_BASE_PLATFORM NULL
> > > +#endif
> 
> Please add a comment which explains what this is.
> 
> Please also add a comment telling the world in which header file the
> architecture *must* define this macro and then ensure that that header is
> included into this file by reliable means.  asm/elf.h looks OK.

Okay.


> > > @@ -172,6 +178,19 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
> > >  			return -EFAULT;
> > >  	}
> > >  
> > > +	/*
> > > +	 * If this architecture has a "base" platform capability
> > > +	 * string, copy it to userspace.
> > > +	 */
> > > +	u_base_platform = NULL;
> > > +	if (k_base_platform) {
> > > +		size_t len = strlen(k_base_platform) + 1;
> > > +
> > > +		u_base_platform = (elf_addr_t __user *)STACK_ALLOC(p, len);
> > > +		if (__copy_to_user(u_base_platform, k_base_platform, len))
> > > +			return -EFAULT;
> > > +	}
> 
> >From my reading, this change will result in no additional code
> generation on non-powerpc architectures.  This is good.  If poss, could
> you please verify that theory and perhaps drop a note in the changelog
> about that?

That was the intent, yes.  However:

$ scripts/bloat-o-meter vmlinux-x86-{before,after}
add/remove: 0/0 grow/shrink: 2/0 up/down: 18/0 (18)
function                                     old     new   delta
init_mm                                      784     800     +16
load_elf_binary                            11946   11948      +2

(x86_64_defconfig, gcc 4.2.3)

The init_mm/mm_struct bloat is expected (although I'd like to avoid
that), but evidently it has some small effect on load_elf_binary.
--
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