projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: close socket on protocol error, sendmsg MSG_NOSIGNAL
[lttng-ust.git]
/
liblttng-ust
/
lttng-ust-comm.c
diff --git
a/liblttng-ust/lttng-ust-comm.c
b/liblttng-ust/lttng-ust-comm.c
index d48cc33627af5f4057060208e69b58afcdfc0b1f..fbdee7d3af8ea0d8d122ab3e4b3bb8a251ccc9a0 100644
(file)
--- a/
liblttng-ust/lttng-ust-comm.c
+++ b/
liblttng-ust/lttng-ust-comm.c
@@
-573,13
+573,13
@@
int handle_message(struct sock_info *sock_info,
if (ust_lock()) {
ret = -LTTNG_UST_ERR_EXITING;
if (ust_lock()) {
ret = -LTTNG_UST_ERR_EXITING;
- goto e
nd
;
+ goto e
rror
;
}
ops = objd_ops(lum->handle);
if (!ops) {
ret = -ENOENT;
}
ops = objd_ops(lum->handle);
if (!ops) {
ret = -ENOENT;
- goto e
nd
;
+ goto e
rror
;
}
switch (lum->cmd) {
}
switch (lum->cmd) {
@@
-640,12
+640,12
@@
int handle_message(struct sock_info *sock_info,
}
ret = len;
free(bytecode);
}
ret = len;
free(bytecode);
- goto e
nd
;
+ goto e
rror
;
} else {
DBG("incorrect filter data message size: %zd", len);
ret = -EINVAL;
free(bytecode);
} else {
DBG("incorrect filter data message size: %zd", len);
ret = -EINVAL;
free(bytecode);
- goto e
nd
;
+ goto e
rror
;
}
}
bytecode->bc.len = lum->u.filter.data_size;
}
}
bytecode->bc.len = lum->u.filter.data_size;
@@
-705,12
+705,12
@@
int handle_message(struct sock_info *sock_info,
}
ret = len;
free(node);
}
ret = len;
free(node);
- goto e
nd
;
+ goto e
rror
;
} else {
DBG("Incorrect exclusion data message size: %zd", len);
ret = -EINVAL;
free(node);
} else {
DBG("Incorrect exclusion data message size: %zd", len);
ret = -EINVAL;
free(node);
- goto e
nd
;
+ goto e
rror
;
}
}
if (ops->cmd) {
}
}
if (ops->cmd) {
@@
-751,11
+751,11
@@
int handle_message(struct sock_info *sock_info,
goto error;
}
ret = len;
goto error;
}
ret = len;
- goto e
nd
;
+ goto e
rror
;
} else {
DBG("incorrect channel data message size: %zd", len);
ret = -EINVAL;
} else {
DBG("incorrect channel data message size: %zd", len);
ret = -EINVAL;
- goto e
nd
;
+ goto e
rror
;
}
}
args.channel.chan_data = chan_data;
}
}
args.channel.chan_data = chan_data;
@@
-776,7
+776,7
@@
int handle_message(struct sock_info *sock_info,
&args.stream.shm_fd,
&args.stream.wakeup_fd);
if (ret) {
&args.stream.shm_fd,
&args.stream.wakeup_fd);
if (ret) {
- goto e
nd
;
+ goto e
rror
;
}
if (ops->cmd)
ret = ops->cmd(lum->handle, lum->cmd,
}
if (ops->cmd)
ret = ops->cmd(lum->handle, lum->cmd,
@@
-796,7
+796,6
@@
int handle_message(struct sock_info *sock_info,
break;
}
break;
}
-end:
lur.handle = lum->handle;
lur.cmd = lum->cmd;
lur.ret_val = ret;
lur.handle = lum->handle;
lur.cmd = lum->cmd;
lur.ret_val = ret;
@@
-1397,7
+1396,13
@@
restart:
print_cmd(lum.cmd, lum.handle);
ret = handle_message(sock_info, sock, &lum);
if (ret) {
print_cmd(lum.cmd, lum.handle);
ret = handle_message(sock_info, sock, &lum);
if (ret) {
- ERR("Error handling message for %s socket", sock_info->name);
+ ERR("Error handling message for %s socket",
+ sock_info->name);
+ /*
+ * Close socket if protocol error is
+ * detected.
+ */
+ goto end;
}
continue;
default:
}
continue;
default:
This page took
0.024946 seconds
and
4
git commands to generate.