* [Qemu-devel] [PATCH] net: rtl8139: limit processing of ring descriptors
@ 2016-10-21 12:09 P J P
2016-10-24 6:43 ` Jason Wang
0 siblings, 1 reply; 3+ messages in thread
From: P J P @ 2016-10-21 12:09 UTC (permalink / raw)
To: Qemu Developers; +Cc: Jason Wang, Andrew Henderson, Prasad J Pandit
From: Prasad J Pandit <pjp@fedoraproject.org>
RTL8139 ethernet controller in C+ mode supports multiple
descriptor rings, each with maximum of 64 descriptors. While
processing transmit descriptor ring in 'rtl8139_cplus_transmit',
it does not limit the descriptor count and runs forever. Add
check to avoid it.
Reported-by: Andrew Henderson <hendersa@icculus.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/net/rtl8139.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 3345bc6..f05e59c 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -2350,7 +2350,7 @@ static void rtl8139_cplus_transmit(RTL8139State *s)
{
int txcount = 0;
- while (rtl8139_cplus_transmit_one(s))
+ while (txcount < 64 && rtl8139_cplus_transmit_one(s))
{
++txcount;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] net: rtl8139: limit processing of ring descriptors
2016-10-21 12:09 [Qemu-devel] [PATCH] net: rtl8139: limit processing of ring descriptors P J P
@ 2016-10-24 6:43 ` Jason Wang
2016-10-24 9:30 ` P J P
0 siblings, 1 reply; 3+ messages in thread
From: Jason Wang @ 2016-10-24 6:43 UTC (permalink / raw)
To: P J P, Qemu Developers; +Cc: Andrew Henderson, Prasad J Pandit
On 2016年10月21日 20:09, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> RTL8139 ethernet controller in C+ mode supports multiple
> descriptor rings, each with maximum of 64 descriptors. While
> processing transmit descriptor ring in 'rtl8139_cplus_transmit',
> it does not limit the descriptor count and runs forever. Add
> check to avoid it.
>
> Reported-by: Andrew Henderson <hendersa@icculus.org>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
> hw/net/rtl8139.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> index 3345bc6..f05e59c 100644
> --- a/hw/net/rtl8139.c
> +++ b/hw/net/rtl8139.c
> @@ -2350,7 +2350,7 @@ static void rtl8139_cplus_transmit(RTL8139State *s)
> {
> int txcount = 0;
>
> - while (rtl8139_cplus_transmit_one(s))
> + while (txcount < 64 && rtl8139_cplus_transmit_one(s))
> {
> ++txcount;
> }
Applied to -net, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] net: rtl8139: limit processing of ring descriptors
2016-10-24 6:43 ` Jason Wang
@ 2016-10-24 9:30 ` P J P
0 siblings, 0 replies; 3+ messages in thread
From: P J P @ 2016-10-24 9:30 UTC (permalink / raw)
To: Jason Wang; +Cc: Qemu Developers, Andrew Henderson, qemu-stable
Hello Jason,
+-- On Mon, 24 Oct 2016, Jason Wang wrote --+
| > RTL8139 ethernet controller in C+ mode supports multiple
| > descriptor rings, each with maximum of 64 descriptors. While
| > processing transmit descriptor ring in 'rtl8139_cplus_transmit',
| > it does not limit the descriptor count and runs forever.
| >
| > diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
| > index 3345bc6..f05e59c 100644
| > --- a/hw/net/rtl8139.c
| > +++ b/hw/net/rtl8139.c
| > @@ -2350,7 +2350,7 @@ static void rtl8139_cplus_transmit(RTL8139State *s)
| > {
| > int txcount = 0;
| > - while (rtl8139_cplus_transmit_one(s))
| > + while (txcount < 64 && rtl8139_cplus_transmit_one(s))
| > {
| > ++txcount;
| > }
|
| Applied to -net, thanks.
Thank you. CC'ing '-stable' as it affects older versions too; Was introduced
in commit
-> git.qemu.org/?p=qemu.git;a=commit;h=49ab747f668f421138d5b40d83fa279c4
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-24 9:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21 12:09 [Qemu-devel] [PATCH] net: rtl8139: limit processing of ring descriptors P J P
2016-10-24 6:43 ` Jason Wang
2016-10-24 9:30 ` P J P
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.