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]
Message-ID: <YNbixBy+s4ca6PU+@hirez.programming.kicks-ass.net>
Date:   Sat, 26 Jun 2021 10:18:12 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     jpoimboe@...hat.com, tglx@...utronix.de,
        linux-kernel@...r.kernel.org, joro@...tes.org,
        boris.ostrovsky@...cle.com, jgross@...e.com, x86@...nel.org,
        mbenes@...e.com, dvyukov@...gle.com, elver@...gle.com
Subject: Re: [PATCH v2 03/24] objtool: Handle __sanitize_cov*() tail calls

On Fri, Jun 25, 2021 at 09:38:24AM -0400, Steven Rostedt wrote:
> On Thu, 24 Jun 2021 11:41:02 +0200
> Peter Zijlstra <peterz@...radead.org> wrote:
> 
> > +static void add_call_dest(struct objtool_file *file, struct instruction *insn,
> > +			  struct symbol *dest, bool sibling)
> > +{
> > +	struct reloc *reloc = insn_reloc(file, insn);
> > +
> > +	insn->call_dest = dest;
> > +	if (!dest)
> > +		return;
> > +
> > +	if (insn->call_dest->static_call_tramp) {
> > +		list_add_tail(&insn->call_node,
> > +			      &file->static_call_list);
> > +	}
> > +
> > +	if (insn->sec->noinstr &&
> > +	    !strncmp(insn->call_dest->name, "__sanitizer_cov_", 16)) {
> > +		if (reloc) {
> > +			reloc->type = R_NONE;
> > +			elf_write_reloc(file->elf, reloc);
> > +		}
> > +
> > +		elf_write_insn(file->elf, insn->sec,
> > +			       insn->offset, insn->len,
> > +			       sibling ? arch_ret_insn(insn->len)
> > +			               : arch_nop_insn(insn->len));
> > +
> > +		insn->type = sibling ? INSN_RETURN : INSN_NOP;
> > +	}
> > +
> > +	if (mcount && !strcmp(insn->call_dest->name, "__fentry__")) {
> > +		if (sibling)
> > +			WARN_FUNC("Tail call to __fentry__ !?!?", insn->sec, insn->offset);
> 
> Have you ever triggered the above?

No, that would be really daft. But since this function is to be called
for both regular and tail calls, I figured I'd at least pretend to
handle the case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ