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");
Updated by Alex Elder about 11 years ago
- Status changed from In Progress to Fix Under Review
The following patch has been posted for review:
[PATCH] libceph: skip message if too big to receive
Updated by Alex Elder about 11 years ago
- Status changed from Fix Under Review to In Progress
This patch has a bug. See this for more info:
http://tracker.ceph.com/issues/4674
(I'm going to reject that bug and just post an
update to this patch since it's still open.)
Updated by Alex Elder about 11 years ago
- Status changed from In Progress to Resolved
The following has been committed to the "testing" branch
of the ceph-client git repository:
5a0084a libceph: skip message if too big to receive