From: "H.J. Lu" <hjl.tools@gmail.com>
To: Hongtao Liu <crazylht@gmail.com>
Cc: Jan Beulich <jbeulich@suse.com>, Binutils <binutils@sourceware.org>
Subject: Re: [PATCH 1/2] i386: Generate lfence with load/indirect branch/ret [CVE-2020-0551]
Date: Fri, 24 Apr 2020 06:00:04 -0700 [thread overview]
Message-ID: <CAMe9rOria07BBsriGHm4+=fGX6KSMSCL0VF1SaUxJ-gX_NkScQ@mail.gmail.com> (raw)
In-Reply-To: <CAMZc-bwJkbAQdPY5f2NXJROcDq+q_6gN=HV+vDm6Lh7cmfYnHw@mail.gmail.com>
On Fri, Apr 24, 2020 at 12:24 AM Hongtao Liu <crazylht@gmail.com> wrote:
>
> On Fri, Apr 24, 2020 at 2:01 PM Jan Beulich <jbeulich@suse.com> wrote:
> >
> > On 24.04.2020 07:30, Hongtao Liu wrote:
> > > Change to
> > >
> > > + /* lret or iret. */
> > > + bfd_boolean lret = (i.tm.base_opcode | 0x5) == 0xcf;
> > > + bfd_boolean has_rexw = i.prefix[REX_PREFIX] & REX_W;
> > > + char prefix = 0x0;
> > > + /* Default operand size for far return is 32 bits,
> > > + 64 bits for near return. */
> > > + /* Near ret ingore operand size override under CPU64. */
> > > + if ((!lret && flag_code == CODE_64BIT) || has_rexw)
> > > + prefix = 0x48;
> > > else
> > > + prefix = i.prefix[DATA_PREFIX] ? 0x66 : 0x0;
> >
> > One minor remark on this one - I'd suggest to either omit the
> > initializer for prefix, or make the last two lines
> >
> > else if (i.prefix[DATA_PREFIX])
> > prefix = 0x66;
> >
> > as there's no point assigning 0 twice.
> >
>
> I'll do this change.
>
> > > Update total patch:
> >
> > Looks okay to me now, thanks.
> >
> > Jan
>
> Thanks for you review and patience, I'll wait for H.J's approval and
> submit my patch.
>
Please post your final patch.
Thanks.
--
H.J.
next prev parent reply other threads:[~2020-04-24 13:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 16:05 [PATCH 0/2] x86: Add assembler mitigation for CVE-2020-0551 H.J. Lu
2020-03-10 16:05 ` [PATCH 1/2] i386: Generate lfence with load/indirect branch/ret [CVE-2020-0551] H.J. Lu
2020-03-11 10:55 ` Jan Beulich
2020-03-11 16:17 ` H.J. Lu
2020-03-25 9:27 ` Hongtao Liu
2020-03-25 10:03 ` Jan Beulich
2020-03-26 2:23 ` Hongtao Liu
2020-03-26 9:12 ` Jan Beulich
2020-04-16 5:34 ` Hongtao Liu
2020-04-16 8:33 ` Jan Beulich
2020-04-20 7:20 ` Hongtao Liu
2020-04-20 7:34 ` Jan Beulich
2020-04-21 2:24 ` Hongtao Liu
2020-04-21 6:30 ` Jan Beulich
2020-04-22 3:33 ` Hongtao Liu
2020-04-22 8:47 ` Jan Beulich
2020-04-23 2:53 ` Hongtao Liu
2020-04-23 6:59 ` Jan Beulich
2020-04-23 8:53 ` Hongtao Liu
2020-04-23 9:15 ` Jan Beulich
2020-04-24 5:30 ` Hongtao Liu
2020-04-24 6:00 ` Jan Beulich
2020-04-24 7:29 ` Hongtao Liu
2020-04-24 13:00 ` H.J. Lu [this message]
2020-04-26 2:03 ` Hongtao Liu
2020-04-26 3:26 ` H.J. Lu
2020-03-10 16:05 ` [PATCH 2/2] i386: Add tests for lfence with load/indirect branch/ret H.J. Lu
2020-03-10 16:33 ` [PATCH 0/2] x86: Add assembler mitigation for CVE-2020-0551 Jan Beulich
2020-03-10 16:36 ` H.J. Lu
2020-03-12 0:32 ` Fangrui Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMe9rOria07BBsriGHm4+=fGX6KSMSCL0VF1SaUxJ-gX_NkScQ@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=binutils@sourceware.org \
--cc=crazylht@gmail.com \
--cc=jbeulich@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).