From ab9b928873024bbc44c941d2ded1b7371f443dd6 Mon Sep 17 00:00:00 2001 From: David Spisla Date: Wed, 6 Mar 2019 12:21:18 +0100 Subject: WORM-Xlator: Maybe integer overflow when computing new atime The structs worm_reten_state_t and read_only_priv_t from read-only.h are using uint64_t values to store periods of retention and autocommmit. This seems to be dangerous since in worm-helper.c the function worm_set_state computes in line 97: stbuf->ia_atime = time(NULL) + retention_state->ret_period; stbuf->ia_atime is using int64_t because of the settings of struct iattr. So if there is a very very high retention period stored, there is maybe an integer overflow. What can be the solution? Using int64_t instead if uint64_t may reduce the probability of the occurance. Change-Id: Id1e86c6b20edd53f171c4cfcb528804ba7881f65 fixes: bz#1685944 Signed-off-by: David Spisla --- libglusterfs/src/libglusterfs.sym | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym index 4466a5eee9a..0d1142dea76 100644 --- a/libglusterfs/src/libglusterfs.sym +++ b/libglusterfs/src/libglusterfs.sym @@ -1107,10 +1107,12 @@ xlator_option_init_percent xlator_option_init_percent_or_size xlator_option_init_size xlator_option_init_size_uint64 +xlator_option_init_size_int64 xlator_option_init_str xlator_option_init_time xlator_option_init_uint32 xlator_option_init_uint64 +xlator_option_init_int64 xlator_option_init_xlator xlator_option_reconf_bool xlator_option_reconf_int32 @@ -1119,10 +1121,12 @@ xlator_option_reconf_percent xlator_option_reconf_percent_or_size xlator_option_reconf_size xlator_option_reconf_size_uint64 +xlator_option_reconf_size_int64 xlator_option_reconf_str xlator_option_reconf_time xlator_option_reconf_uint32 xlator_option_reconf_uint64 +xlator_option_reconf_int64 xlator_option_reconf_xlator xlator_options_validate xlator_options_validate_list -- cgit