summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5dafeea)
Don't try to keep interacting with sessiond when a protocol error is
detected at the UST application side: this means we cannot trust the
protocol anymore, so there is no reason for keeping the socket open.
For instance, if the application is exiting and we receive a new stream,
we're effectively not reading the stream data, and we return an error.
Unfortunately, the session daemon may try to send us another command,
but we will try interpreting the stream data as a command, which is
invalid.
Also, use MSG_NOSIGNAL flag in the fds recvmsg, so the session daemon
don't get killed with SIGPIPE when it cannot send to the socket due to
connection closed.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- ret = sendmsg(sock, &msg, 0);
+ ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
/*
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
/*
if (ust_lock()) {
ret = -LTTNG_UST_ERR_EXITING;
if (ust_lock()) {
ret = -LTTNG_UST_ERR_EXITING;
}
ops = objd_ops(lum->handle);
if (!ops) {
ret = -ENOENT;
}
ops = objd_ops(lum->handle);
if (!ops) {
ret = -ENOENT;
}
ret = len;
free(bytecode);
}
ret = len;
free(bytecode);
} 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);
}
}
bytecode->bc.len = lum->u.filter.data_size;
}
}
bytecode->bc.len = lum->u.filter.data_size;
} 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);
} else {
DBG("incorrect channel data message size: %zd", len);
ret = -EINVAL;
} else {
DBG("incorrect channel data message size: %zd", len);
ret = -EINVAL;
}
}
args.channel.chan_data = chan_data;
}
}
args.channel.chan_data = chan_data;
&args.stream.shm_fd,
&args.stream.wakeup_fd);
if (ret) {
&args.stream.shm_fd,
&args.stream.wakeup_fd);
if (ret) {
}
if (ops->cmd)
ret = ops->cmd(lum->handle, lum->cmd,
}
if (ops->cmd)
ret = ops->cmd(lum->handle, lum->cmd,
lur.handle = lum->handle;
lur.cmd = lum->cmd;
lur.ret_val = ret;
lur.handle = lum->handle;
lur.cmd = lum->cmd;
lur.ret_val = ret;
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;