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

Also available in: Atom PDF