Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: fix rds_iovec page count overflow
commit 1b1f693 upstream. As reported by Thomas Pollet, the rdma page counting can overflow. We get the rdma sizes in 64-bit unsigned entities, but then limit it to UINT_MAX bytes and shift them down to pages (so with a possible "+1" for an unaligned address). So each individual page count fits comfortably in an 'unsigned int' (not even close to overflowing into signed), but as they are added up, they might end up resulting in a signed return value. Which would be wrong. Catch the case of tot_pages turning negative, and return the appropriate error code. Reported-by: Thomas Pollet <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Andy Grover <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Andi Kleen <[email protected]> [v2: nr is unsigned in the old code] Signed-off-by: Stefan Bader <[email protected]> Acked-by: Tim Gardner <[email protected]> Acked-by: Brad Figg <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information