diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-09-08 05:43:20 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-10-20 00:47:41 -0700 |
commit | a0a2e8ebd0b243dbf4d5dceb24b82e8632373040 (patch) | |
tree | 912cb2f46b6157ef1b90ad9c5743eb19692f2500 /xlators | |
parent | ff2f2d83f798486ef748513417700aff63e6d8fa (diff) |
system/posix-acl: Unwind with NULL xdata on error
In posix-acl when there are errors xdata that comes as part of input is used to
unwind which can be used as response xdata which may lead to problems as the
keys in the input will match with keys in the output but the values the
response xdata may expect can be completely different.
For example, we see that dht sends DHT_IATT_IN_XDATA_KEY in setxattr
which will be unwound with the same key in the xdata-response which
dht thinks is valid response and fills stbuf with invalid values
leading to EIO
> BUG: 1374093
> Change-Id: I6b77a1fa1ee99cb62e181e1db2e6fea73f6eaaa3
> Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
> Reviewed-on: http://review.gluster.org/15421
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
(cherry picked from commit c9271ff14d3efa8279cf67907548b3f43970d4fb)
Change-Id: I6b77a1fa1ee99cb62e181e1db2e6fea73f6eaaa3
BUG: 1374641
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/15475
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/system/posix-acl/src/posix-acl.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index cd799fc741a..4841c7cb939 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -1126,7 +1126,7 @@ green: loc, flags, fd, xdata); return 0; red: - STACK_UNWIND_STRICT (open, frame, -1, EACCES, NULL, xdata); + STACK_UNWIND_STRICT (open, frame, -1, EACCES, NULL, NULL); return 0; } @@ -1161,7 +1161,8 @@ green: fd, size, offset, flags, xdata); return 0; red: - STACK_UNWIND_STRICT (readv, frame, -1, EACCES, NULL, 0, NULL, NULL, xdata); + STACK_UNWIND_STRICT (readv, frame, -1, EACCES, NULL, 0, NULL, NULL, + NULL); return 0; } @@ -1196,7 +1197,7 @@ green: fd, vector, count, offset, flags, iobref, xdata); return 0; red: - STACK_UNWIND_STRICT (writev, frame, -1, EACCES, NULL, NULL, xdata); + STACK_UNWIND_STRICT (writev, frame, -1, EACCES, NULL, NULL, NULL); return 0; } @@ -1231,7 +1232,7 @@ green: fd, offset, xdata); return 0; red: - STACK_UNWIND_STRICT (ftruncate, frame, -1, EACCES, NULL, NULL, xdata); + STACK_UNWIND_STRICT (ftruncate, frame, -1, EACCES, NULL, NULL, NULL); return 0; } @@ -1259,7 +1260,7 @@ green: loc, fd, xdata); return 0; red: - STACK_UNWIND_STRICT (opendir, frame, -1, EACCES, NULL, xdata); + STACK_UNWIND_STRICT (opendir, frame, -1, EACCES, NULL, NULL); return 0; } @@ -1426,7 +1427,7 @@ green: return 0; red: STACK_UNWIND_STRICT (symlink, frame, -1, EACCES, NULL, NULL, NULL, - NULL, xdata); + NULL, NULL); return 0; } @@ -1462,7 +1463,7 @@ green: loc, xflag, xdata); return 0; red: - STACK_UNWIND_STRICT (unlink, frame, -1, EACCES, NULL, NULL, xdata); + STACK_UNWIND_STRICT (unlink, frame, -1, EACCES, NULL, NULL, NULL); return 0; } @@ -1497,7 +1498,7 @@ green: loc, flags, xdata); return 0; red: - STACK_UNWIND_STRICT (rmdir, frame, -1, EACCES, NULL, NULL, xdata); + STACK_UNWIND_STRICT (rmdir, frame, -1, EACCES, NULL, NULL, NULL); return 0; } @@ -1588,7 +1589,8 @@ posix_acl_link (call_frame_t *frame, xlator_t *this, loc_t *old, loc_t *new, dic old, new, xdata); return 0; red: - STACK_UNWIND_STRICT (link, frame, -1, op_errno, NULL, NULL, NULL, NULL, xdata); + STACK_UNWIND_STRICT (link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + NULL); return 0; } @@ -1621,7 +1623,7 @@ green: fd, size, offset, xdata); return 0; red: - STACK_UNWIND_STRICT (readdir, frame, -1, EACCES, NULL, xdata); + STACK_UNWIND_STRICT (readdir, frame, -1, EACCES, NULL, NULL); return 0; } @@ -1853,7 +1855,7 @@ posix_acl_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, loc, buf, valid, xdata); return 0; red: - STACK_UNWIND_STRICT (setattr, frame, -1, op_errno, NULL, NULL, xdata); + STACK_UNWIND_STRICT (setattr, frame, -1, op_errno, NULL, NULL, NULL); return 0; } @@ -1899,7 +1901,7 @@ posix_acl_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, fd, buf, valid, xdata); return 0; red: - STACK_UNWIND_STRICT (fsetattr, frame, -1, EACCES, NULL, NULL, xdata); + STACK_UNWIND_STRICT (fsetattr, frame, -1, EACCES, NULL, NULL, NULL); return 0; } @@ -2095,7 +2097,7 @@ posix_acl_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, loc, xattr, flags, xdata); return 0; red: - STACK_UNWIND_STRICT (setxattr, frame, -1, op_errno, xdata); + STACK_UNWIND_STRICT (setxattr, frame, -1, op_errno, NULL); return 0; } @@ -2129,7 +2131,7 @@ posix_acl_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, fd, xattr, flags, xdata); return 0; red: - STACK_UNWIND_STRICT (fsetxattr, frame, -1, op_errno, xdata); + STACK_UNWIND_STRICT (fsetxattr, frame, -1, op_errno, NULL); return 0; } @@ -2164,7 +2166,7 @@ green: return 0; red: - STACK_UNWIND_STRICT (getxattr, frame, -1, EACCES, NULL, xdata); + STACK_UNWIND_STRICT (getxattr, frame, -1, EACCES, NULL, NULL); return 0; } @@ -2197,7 +2199,7 @@ green: fd, name, xdata); return 0; red: - STACK_UNWIND_STRICT (fgetxattr, frame, -1, EACCES, NULL, xdata); + STACK_UNWIND_STRICT (fgetxattr, frame, -1, EACCES, NULL, NULL); return 0; } @@ -2246,7 +2248,7 @@ green: loc, name, xdata); return 0; red: - STACK_UNWIND_STRICT (removexattr, frame, -1, op_errno, xdata); + STACK_UNWIND_STRICT (removexattr, frame, -1, op_errno, NULL); return 0; } |