rbd: prevent bytes transferred overflow
authorAlex Elder <elder@inktank.com>
Wed, 6 Feb 2013 19:11:38 +0000 (13:11 -0600)
committerAlex Elder <elder@inktank.com>
Wed, 20 Feb 2013 01:14:04 +0000 (19:14 -0600)
commit1ceae7ef0fd00c965a2257c6e9eb497ca91f01c7
tree092a10e88f4503fb41495157d8ea0ad70760bdf8
parentb324814e8436772cb3367b14149ba003a9954525
rbd: prevent bytes transferred overflow

In rbd_obj_read_sync(), verify the number of bytes transferred won't
exceed what can be represented by a size_t before using it to
indicate the number of bytes to copy to the result buffer.

(The real motivation for this is to prepare for the next patch.)

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c