From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: thuth@redhat.com, lichun@ruijie.com.cn, qemu-devel@nongnu.org,
armbru@redhat.com
Subject: Re: [PATCH for-5.2 0/3] hmp: Fix arg evaluation crash (regression)
Date: Fri, 13 Nov 2020 12:44:13 +0000 [thread overview]
Message-ID: <20201113124413.GK3251@work-vm> (raw)
In-Reply-To: <20201113124305.GD5834@merkur.fritz.box>
* Kevin Wolf (kwolf@redhat.com) wrote:
> Am 13.11.2020 um 13:13 hat Dr. David Alan Gilbert geschrieben:
> > * Kevin Wolf (kwolf@redhat.com) wrote:
> > > When I restricted the section where the current monitor is set to only
> > > the command handler, I missed that monitor_parse_arguments() can use it
> > > indirectly, too, when evaluating register variables. These cases get
> > > NULL now and crash (easy to reproduce with "x $pc").
> > >
> > > This series passes the right monitor object down instead of using
> > > monitor_cur(), which fixes the crash.
> >
> > Why didn't the test-hmp.c find this? It has a 'p $pc + 8'
>
> Good question, a manual 'p $pc + 8' crashes for me on master.
>
> Aha, it doesn't use a real HMP monitor, but QMP human-monitor-command.
> Then it would just get the wrong monitor (the QMP one instead of the
> temporary HMP monitor) and not NULL. The accessed CPU is even the same
> because neither QMP nor the temporary HMP monitor have a current CPU
> set, so even if the test case did check the result, it wouldn't catch
> this.
>
> Only if the test case were using multiple CPUs and cpu-index had been
> set for human-monitor-command (to something other than the default), we
> would get a wrong result. But of course, it still wouldn't crash.
Ah, fair enough.
Dave
> Kevin
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2020-11-13 12:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 11:43 [PATCH for-5.2 0/3] hmp: Fix arg evaluation crash (regression) Kevin Wolf
2020-11-13 11:43 ` [PATCH for-5.2 1/3] hmp: Pass monitor to mon_get_cpu() Kevin Wolf
2020-11-13 11:43 ` [PATCH for-5.2 2/3] hmp: Pass monitor to MonitorDef.get_value() Kevin Wolf
2020-11-13 11:43 ` [PATCH for-5.2 3/3] hmp: Pass monitor to mon_get_cpu_env() Kevin Wolf
2020-11-13 12:13 ` [PATCH for-5.2 0/3] hmp: Fix arg evaluation crash (regression) Dr. David Alan Gilbert
2020-11-13 12:43 ` Kevin Wolf
2020-11-13 12:44 ` Dr. David Alan Gilbert [this message]
2020-11-13 12:46 ` Dr. David Alan Gilbert
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=20201113124413.GK3251@work-vm \
--to=dgilbert@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lichun@ruijie.com.cn \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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 NNTP newsgroup(s).