Heh. We apparently have _another_ iovec overflow in networking. This time rds.
Reported by Thomas Pollet<thomas.pollet@xxxxxxxxx>: look at
net/rds/rdma.c around line 490. It doesn't use the regular iovec code,
instead it cooks its own, and has a few problems with overflow.
It gathers the number of pages into an "unsigned int", and for each
entry in its own rds_iovec it will check that the size is< UINT_MAX,
and then generate the number of pages for that entry. With the whole
"unaligned address adds one" logic, it means that each entry can get
(UINT_MAX>> PAGE_SHIFT)+1 pages.
And how many entries can we have? Apparently that is capped to
UINT_MAX too. So add all those up, and they can easily overflow the
unsigned int page counter.
So this time fixing verify_iovec() doesn't help, because rds just
cooks its own, and this is using a totally different interface: it
seems to hook into sendmsg, but it looks like it uses the ancillary
data objects and passes in its own magical iovec rather than use any
"normal" iovec thing. I don't know the code, I may be totally off.