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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220422151710.kxf2iywniedb4trk@treble>
Date:   Fri, 22 Apr 2022 08:17:10 -0700
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Miroslav Benes <mbenes@...e.cz>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 15/25] objtool: Rework ibt and extricate from stack
 validation

On Fri, Apr 22, 2022 at 12:50:37PM +0200, Peter Zijlstra wrote:
> On Wed, Apr 20, 2022 at 07:25:16PM +0200, Miroslav Benes wrote:
> > A nit and it was there even before this patch...
> > 
> > > -static struct instruction *
> > > -validate_ibt_reloc(struct objtool_file *file, struct reloc *reloc)
> > > -{
> > > -	struct instruction *dest;
> > > -	struct section *sec;
> > > -	unsigned long off;
> > > -
> > > -	sec = reloc->sym->sec;
> > > -	off = reloc->sym->offset;
> > > -
> > > -	if ((reloc->sec->base->sh.sh_flags & SHF_EXECINSTR) &&
> > > -	    (reloc->type == R_X86_64_PC32 || reloc->type == R_X86_64_PLT32))
> > > -		off += arch_dest_reloc_offset(reloc->addend);
> > 
> > here...
> > 
> > > +static int validate_ibt_insn(struct objtool_file *file, struct instruction *insn)
> > > +{
> > 
> > ...
> > > +		off = reloc->sym->offset;
> > > +		if (reloc->type == R_X86_64_PC32 || reloc->type == R_X86_64_PLT32)
> > > +			off += arch_dest_reloc_offset(reloc->addend);
> > > +		else
> > > +			off += reloc->addend;
> > 
> > it looks kind of strange to have arch_dest_reloc_offset() and still 
> > reference arch-specific relocation types here. On the other hand it seems 
> > difficult to achieve complete arch-agnostic code, so take it just as a 
> > note and maybe someone porting objtool to a different architecture will 
> > split the code, make it all arch-independent and all will be nice and 
> > shiny.
> 
> Something like so perhaps? Seems to build and boot x86_64-defconfig.

Looks good...

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ