Bug #4664
closedlibceph: skip message if too big to receive
0%
Description
I've been aware of this for a while but it just occurred
to me I have a solution...
If a message is coming in for which the data buffer to
receive it is too small to hold it, just drop the message.
Right now the messenger seems to blindly assume it's all
going to fit.
---------
We know the length of our message buffers. If we get a message
that's too long, just dump it and ignore it.
Signed-off-by: Alex Elder <elder@inktank.com>
---
net/ceph/messenger.c | 6 ++++
1 file changed, 6 insertions(+)
Index: b/net/ceph/messenger.c
===================================================================
--- a/net/ceph/messenger.c
++ b/net/ceph/messenger.c@ -2210,6 +2210,12
@ static int read_partial_message(struct c
ret = ceph_con_in_msg_alloc(con, &skip);
if (ret < 0)
return ret;
+ if (data_len > con->in_msg->data_length) {
+ pr_warning("%s skipping long message (%u > %zd)\n",
+ func, data_len, con->in_msg->data_length);
+ skip = 1;
+ }
if (skip) {
/* skip this message */
dout("alloc_msg said skip message\n");