]> git.baikalelectronics.ru Git - kernel.git/commit
libceph: validate timespec conversions
authorAlex Elder <elder@inktank.com>
Fri, 19 Apr 2013 20:34:50 +0000 (15:34 -0500)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:19:17 +0000 (21:19 -0700)
commit3d44efa1b722ca5a4c5a65c5d5d067b8c5aee357
tree7c96c0c4818fa655c6ba4fe61e7de2f1b6915a6a
parent375ebea89bb758357dcd9dbcb673333360631a2e
libceph: validate timespec conversions

A ceph timespec contains 32-bit unsigned values for its seconds and
nanoseconds components.  For a standard timespec, both fields are
signed, and the seconds field is almost surely 64 bits.

Add some explicit casts so the fact that this conversion is taking
place is obvious.  Also trip a bug if we ever try to put out of
range (negative or too big) values into a ceph timespec.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
include/linux/ceph/decode.h