From: Gerd Hoffmann <kraxel@redhat.com>
To: linzhecheng <linzhecheng@huawei.com>
Cc: ppandit@redhat.com, qemu-devel@nongnu.org, fabrice@bellard.org,
wangxinxin.wang@huawei.com, arei.gonglei@huawei.com
Subject: Re: [Qemu-devel] [PATCH v3] vga: check the validation of memory addr when draw text
Date: Fri, 12 Jan 2018 14:13:35 +0100 [thread overview]
Message-ID: <20180112131335.cea7zr4f4lu43z2s@sirius.home.kraxel.org> (raw)
In-Reply-To: <20180111132724.13744-1-linzhecheng@huawei.com>
On Thu, Jan 11, 2018 at 09:27:24PM +0800, linzhecheng wrote:
> Start a vm with qemu-kvm -enable-kvm -vnc :66 -smp 1 -m 1024 -hda
> redhat_5.11.qcow2 -device pcnet -vga cirrus,
> then use VNC client to connect to VM, and excute the code below in guest
> OS will lead to qemu crash:
>
> int main()
> {
> iopl(3);
> srand(time(NULL));
> int a,b;
> while(1){
> a = rand()%0x100;
> b = 0x3c0 + (rand()%0x20);
> outb(a,b);
> }
> return 0;
> }
>
> The above code is writing the registers of VGA randomly.
> We can write VGA CRT controller registers index 0x0C or 0x0D
> (which is the start address register) to modify the
> the display memory address of the upper left pixel
> or character of the screen. The address may be out of the
> range of vga ram. So we should check the validation of memory address
> when reading or writing it to avoid segfault.
Patch queued up.
thanks,
Gerd
prev parent reply other threads:[~2018-01-12 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 13:27 [Qemu-devel] [PATCH v3] vga: check the validation of memory addr when draw text linzhecheng
2018-01-12 13:13 ` Gerd Hoffmann [this message]
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=20180112131335.cea7zr4f4lu43z2s@sirius.home.kraxel.org \
--to=kraxel@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=fabrice@bellard.org \
--cc=linzhecheng@huawei.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wangxinxin.wang@huawei.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).