Skip to contentSkip to conversation

Possible overflow in netbk_get_requests()

DISCUSSION Simon Horman 2 participants 3 messages Aug 4, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

I'm wondering if the call to netbk_get_requests() in net_tx_action() might cause an overflow in the case where there are more fragments than available slots in tx_map_ops (aka mop).

Signature · 1 line
Horms
#1 lore raw

netbk_count_frags() should check we have no more than MAX_SKB_FRAGS for this packet, and the loop header in net_tx_action() checks we do no more than MAX_PENDING_REQS fragments of work (this is subtle: NR_PENDING_REQS cannot decrease while we execute the loop!).

It's all a bit too subtle for its own good. ;-)

-- Keir

Quoted 5 lines · Simon Horman

Hi,

I'm wondering if the call to netbk_get_requests() in net_tx_action() might cause an overflow in the case where there are more fragments than available slots in tx_map_ops (aka mop).

#2 lore raw

Thanks, I wasn't keeping my eye on pending_prod.

Quoted 17 lines · Keir Fraser

netbk_count_frags() should check we have no more than MAX_SKB_FRAGS for this packet, and the loop header in net_tx_action() checks we do no more than MAX_PENDING_REQS fragments of work (this is subtle: NR_PENDING_REQS cannot decrease while we execute the loop!).

It's all a bit too subtle for its own good. ;-)

-- Keir

Quoted 5 lines · Simon Horman

Hi,

I'm wondering if the call to netbk_get_requests() in net_tx_action() might cause an overflow in the case where there are more fragments than available slots in tx_map_ops (aka mop).