diff options
author | Michal Zidek <mzidek@redhat.com> | 2013-08-05 20:59:33 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-11 22:21:17 +0200 |
commit | b5d6a9dc1ad63e8567de4c2805fc5baad54dc456 (patch) | |
tree | 4ee3d0db415ba34b1817570d9a9008e3e3e0e8fc /src/util/mmap_cache.h | |
parent | 29b9dbc96370b85e460156e528cb2542c160cfd3 (diff) | |
download | sssd-b5d6a9dc1ad63e8567de4c2805fc5baad54dc456.tar.gz sssd-b5d6a9dc1ad63e8567de4c2805fc5baad54dc456.tar.xz sssd-b5d6a9dc1ad63e8567de4c2805fc5baad54dc456.zip |
mmap_cache: Check if slot and name_ptr are not invalid.sssd-1.9.2-118.el6
This patch prevents jumping outside of allocated memory in
case of corrupted slot or name_ptr values. It is not proper
solution, just hotfix until we find out what is the root cause
of ticket https://fedorahosted.org/sssd/ticket/2018
Diffstat (limited to 'src/util/mmap_cache.h')
-rw-r--r-- | src/util/mmap_cache.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/mmap_cache.h b/src/util/mmap_cache.h index 407eeea69..5350a0eb3 100644 --- a/src/util/mmap_cache.h +++ b/src/util/mmap_cache.h @@ -73,6 +73,7 @@ typedef uint32_t rel_ptr_t; #define SSS_MC_MAJOR_VNO 0 #define SSS_MC_MINOR_VNO 4 +#define SSS_MC_HEADER_UNINIT 0 /* after ftruncate or before reset */ #define SSS_MC_HEADER_ALIVE 1 /* current and in use */ #define SSS_MC_HEADER_RECYCLED 2 /* file was recycled, reopen asap */ @@ -104,6 +105,8 @@ struct sss_mc_rec { char data[0]; }; +/* FIXME: Function sss_mc_find_record currently relies on fact that + * offset of strs is the same in both sss_mc_pwd_data and sss_mc_grp_data. */ struct sss_mc_pwd_data { rel_ptr_t name; /* ptr to name string, rel. to struct base addr */ uint32_t uid; |