Re: [PATCH] vhost-net: fix range checking in mrg bufs case

2010-09-15 Thread Jason Wang
Tested-by: Jason Wang - "Michael S. Tsirkin" wrote: > In mergeable buffer case, we use headcount, log_num > and seg as indexes in same-size arrays, and > we know that headcount <= seg and > log_num equals either 0 or seg. > > Therefore, the right thing to do is range-check seg, > not headc

[PATCH] vhost-net: fix range checking in mrg bufs case

2010-09-14 Thread Michael S. Tsirkin
In mergeable buffer case, we use headcount, log_num and seg as indexes in same-size arrays, and we know that headcount <= seg and log_num equals either 0 or seg. Therefore, the right thing to do is range-check seg, not headcount as we do now: these will be different if guest chains s/g descriptors