drivers: ixgbevf: fix unsigned underflow
Subsystems (3)
PATCH 5/8 drivers: ixgbevf: fix unsigned underflow
'count' is unsigned. It is initialized to zero, then it can be increased multiple times, and finally it is used in such a way:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
count--;
|
| /* clear timestamp and dma mappings for remaining portion of packet */
| while (count >= 0) {
| count--;
| ... ^
If count is zero here (so, it was never increased), we would have a very long loop :)
--- drivers/net/ixgbevf/ixgbevf_main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/ixgbevf/ixgbevf_main.c +2 -1
@@ -2935,7 +2935,8 @@ static int ixgbevf_tx_map(struct ixgbevf_adapter *adapter,struct ixgbevf_tx_buffer *tx_buffer_info;unsigned int len;unsigned int total = skb->len; -unsigned int offset =0 , size, count =0 ; +unsigned int offset =0 , size; +int count =0 ;unsigned int nr_frags =skb_shinfo (skb)->nr_frags;unsigned int f;int i;
Signature · 1 line
1.7.0.4
Quoted 43 lines
-----Original Message-----
From: Kulikov Vasiliy [mailto:[email protected]]
Sent: Thursday, July 15, 2010 11:46 AM
To: [email protected]
Cc: David S. Miller; Kirsher, Jeffrey T; Rose, Gregory V; Eric Dumazet; Joe Perches; [email protected]
Subject: [PATCH 5/8] drivers: ixgbevf: fix unsigned underflow'count' is unsigned. It is initialized to zero, then it can be increased multiple times, and finally it is used in such a way:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
count--;
|
| /* clear timestamp and dma mappings for remaining portion of
packet */| while (count >= 0) { | count--; | ...^
If count is zero here (so, it was never increased), we would have a very long loop :)Signed-off-by Kulikov Vasiliy <[email protected]>---
drivers/net/ixgbevf/ixgbevf_main.c| 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)drivers/net/ixgbevf/ixgbevf_main.c +2
-1@@ -2935,7 +2935,8 @@ static int ixgbevf_tx_map(struct ixgbevf_adapter *adapter, struct ixgbevf_tx_buffer *tx_buffer_info;unsigned int len;unsigned int total = skb->len; -unsigned int offset =0 , size, count =0 ; +unsigned int offset =0 , size; +int count =0 ;unsigned int nr_frags =skb_shinfo (skb)->nr_frags;unsigned int f;int i;
Quoted 2 lines
--
1.7.0.4
Acked By: Greg Rose <[email protected]>
From: "Rose, Gregory V" <[email protected]>
Date: Thu, 15 Jul 2010 11:52:54 -0700
Quoted 23 lines
Quoted 23 lines
-----Original Message-----
From: Kulikov Vasiliy [mailto:[email protected]]
Sent: Thursday, July 15, 2010 11:46 AM
To: [email protected]
Cc: David S. Miller; Kirsher, Jeffrey T; Rose, Gregory V; Eric Dumazet; Joe Perches; [email protected]
Subject: [PATCH 5/8] drivers: ixgbevf: fix unsigned underflow'count' is unsigned. It is initialized to zero, then it can be increased multiple times, and finally it is used in such a way:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
count--;
|
| /* clear timestamp and dma mappings for remaining portion of
packet */| while (count >= 0) { | count--; | ...^
If count is zero here (so, it was never increased), we would have a very long loop :)Signed-off-by Kulikov Vasiliy <[email protected]>
...
Quoted 1 line
Acked By: Greg Rose <[email protected]>
Applied.