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]
Message-ID: <Yt6DZB7Cmp6xYU/H@quatroqueijos>
Date:   Mon, 25 Jul 2022 08:49:56 -0300
From:   Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
To:     Jiri Slaby <jirislaby@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Borislav Petkov <bpetkov@...e.de>
Subject: Re: [PATCH 5.18 13/70] objtool: skip non-text sections when adding
 return-thunk sites

On Mon, Jul 25, 2022 at 07:44:08AM +0200, Jiri Slaby wrote:
> Hi,
> 
> I wonder, why this is needed in stable and not mainline?
> 
> Isn't this a different (non-upstream) dup of
> 951ddecf4356 objtool: Treat .text.__x86.* as noinstr
> ? (That is included in this release too.)
> 

That's because RESERVE_BRK adds a function to .discard.text before upstream
commit a1e2c031ec3949b8c039b739c0b5bf9c30007b00 ("x86/mm: Simplify
RESERVE_BRK()").

Picking up that commit alone was frowned upon because it caused some
problems that were still under investigation.

Cascardo.

> On 22. 07. 22, 11:07, Greg Kroah-Hartman wrote:
> > From: Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
> > 
> > The .discard.text section is added in order to reserve BRK, with a
> > temporary function just so it can give it a size. This adds a relocation to
> > the return thunk, which objtool will add to the .return_sites section.
> > Linking will then fail as there are references to the .discard.text
> > section.
> > 
> > Do not add instructions from non-text sections to the list of return thunk
> > calls, avoiding the reference to .discard.text.
> > 
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
> > Acked-by: Josh Poimboeuf <jpoimboe@...nel.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> > ---
> >   tools/objtool/check.c |    4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > --- a/tools/objtool/check.c
> > +++ b/tools/objtool/check.c
> > @@ -1308,7 +1308,9 @@ static void add_return_call(struct objto
> >   	insn->type = INSN_RETURN;
> >   	insn->retpoline_safe = true;
> > -	list_add_tail(&insn->call_node, &file->return_thunk_list);
> > +	/* Skip the non-text sections, specially .discard ones */
> > +	if (insn->sec->text)
> > +		list_add_tail(&insn->call_node, &file->return_thunk_list);
> >   }
> >   static bool same_function(struct instruction *insn1, struct instruction *insn2)
> > 
> > 
> 
> thanks,
> -- 
> js
> suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ