qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sh4: r2d fix no ide/net case


From: Shin-ichiro KAWASAKI
Subject: Re: [Qemu-devel] [PATCH] sh4: r2d fix no ide/net case
Date: Sat, 14 Feb 2009 16:52:04 +0900
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

address@hidden 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 <address@hidden>

Signed-off-by: Takashi YOSHII <address@hidden>
---
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]