From: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] sh4: r2d fix no ide/net case
Date: Sat, 14 Feb 2009 16:52:04 +0900 [thread overview]
Message-ID: <49967824.10807@juno.dti.ne.jp> (raw)
In-Reply-To: <200902111545.n1BFjbSp027013@smtp09.dti.ne.jp>
takasi-y@ops.dti.ne.jp wrote:
> Fix invalid access/crash when there is no IDE device or NET device.
I tested this patch and got sure about these two points.
- Access to drives_table[-1] avoided.
- SEGV on '-net none' avoided.
It's worth to apply.
Tested-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
> Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
> ---
> Current code doesn't check if IDE and NIC is present.
> When no IDE is enabled, it accesses invalid adddress (drives_table[-1]).
> When no NIC is enabled, it accesses NULL pointer and is killed by SEGV.
>
> SEGV case is easily be seen like below (by -net none)
> $ sh4-softmmu/qemu-system-sh4 -M r2d -kernel kernel.kawa -net none
> Segmentation fault
>
> This changes default model of 2nd NIC from ne2k-pci to rtl8139.
> 2nd NIC on-board really was rtl8139.
>
> If you depends on old behavior use -net option, for example
> -net nic -net nic,model=ne2k_pci
> makes 2nd NIC to be ne2k_pci.
> /yoshii
>
> ---
> hw/r2d.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/hw/r2d.c b/hw/r2d.c
> index 7dcb723..5360b4b 100644
> --- a/hw/r2d.c
> +++ b/hw/r2d.c
> @@ -224,13 +224,13 @@ static void r2d_init(ram_addr_t ram_size, int vga_ram_size,
> serial_hds[2]);
>
(snip)
Regards,
Shin-ichiro KAWASAKI
next prev parent reply other threads:[~2009-02-14 7:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-11 15:45 [Qemu-devel] [PATCH] sh4: r2d fix no ide/net case takasi-y
2009-02-14 7:52 ` Shin-ichiro KAWASAKI [this message]
2009-03-03 6:23 ` Aurelien Jarno
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=49967824.10807@juno.dti.ne.jp \
--to=kawasaki@juno.dti.ne.jp \
--cc=qemu-devel@nongnu.org \
/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).