From e11296f8e52b7e3b13d21b41d4fa34baea878edf Mon Sep 17 00:00:00 2001 From: Poornima G Date: Thu, 3 Aug 2017 17:43:22 +0530 Subject: gfapi: Duplicate the buffer sent in setxattr calls Issue: The caller of glfs_setxattr sends a buffer to set as the value. We create a dict in which the pointer to the value is set. Underlying layers like md-cache take a ref on this dict to store the value for a longer time. But the moment setxattr is complete, the caller of glfs_setxattr can free the value memory. Solution: memcpy the setxattr value to the gluster buffer. Change-Id: I58753fe702e8b7d0f6c4f058714c65d0ad5d7a0a BUG: 1477488 Signed-off-by: Poornima G Reviewed-on: https://review.gluster.org/17967 Reviewed-by: soumya k Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- api/src/glfs-internal.h | 1 - 1 file changed, 1 deletion(-) (limited to 'api/src/glfs-internal.h') diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h index 838b5c748b2..180981830d7 100644 --- a/api/src/glfs-internal.h +++ b/api/src/glfs-internal.h @@ -373,7 +373,6 @@ int glfs_loc_touchup (loc_t *loc) void glfs_iatt_to_stat (struct glfs *fs, struct iatt *iatt, struct stat *stat); int glfs_loc_link (loc_t *loc, struct iatt *iatt); int glfs_loc_unlink (loc_t *loc); -dict_t *dict_for_key_value (const char *name, const char *value, size_t size); int glfs_getxattr_process (void *value, size_t size, dict_t *xattr, const char *name); -- cgit