Project

General

Profile

Actions

Bug #4664

closed

libceph: skip message if too big to receive

Added by Alex Elder about 11 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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 <>
---
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");

Actions #1

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

Actions #2

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.)

Actions #3

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

Actions

Also available in: Atom PDF