From patchwork Fri Apr 5 22:18:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2400641 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A2191DFE76 for ; Fri, 5 Apr 2013 22:18:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162999Ab3DEWSW (ORCPT ); Fri, 5 Apr 2013 18:18:22 -0400 Received: from mail-ia0-f179.google.com ([209.85.210.179]:59920 "EHLO mail-ia0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162980Ab3DEWSV (ORCPT ); Fri, 5 Apr 2013 18:18:21 -0400 Received: by mail-ia0-f179.google.com with SMTP id x24so3568515iak.38 for ; Fri, 05 Apr 2013 15:18:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=+aAyh18ZVrJSrBF5MgvXkG2+kY4t49SOlVuKU2bXYB0=; b=bveDnwXGL9vFgbJvmQf4e7fYOEgEEIXieH/+vYR43204cteq7JMv3gFs7DsXoVQIEn T9ciCw4Zn6T7g/cSHrfqgLwABGiGzDjdTae7/XxYgn9YgfQnPAxRsxIjeYHr/K/jIEQh hGXNUy0TTWp0RIDCfLnQsldeL7WKp8iJlcCVQ7rVy4F+BfrCcTdFaqs0IN2FbJ2DDeKd Wd20MUh/hdu1AqFdXVnKhAwp/pqAyxNWe19r23LMm29Y3TrounFStYEslkURGRwM69IH N1KZUo4NjtHHn70p/xmhfP0JOLY4CS2GD57KAactibSAcZ4MuEILZNcbkVS/usiS28uE XZtg== X-Received: by 10.42.68.129 with SMTP id x1mr6551879ici.50.1365200300827; Fri, 05 Apr 2013 15:18:20 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id wx2sm4724391igb.4.2013.04.05.15.18.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Apr 2013 15:18:20 -0700 (PDT) Message-ID: <515F4DAB.8090805@inktank.com> Date: Fri, 05 Apr 2013 17:18:19 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH] libceph: skip message if too big to receive X-Gm-Message-State: ALoCoQkvyhORxjj81f/CPFGQJLfdHxbXHrCXVPCbPJWomUSLxMdb2Gv/xTxURzIG5u96fUqQTmPE Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org We know the length of our message buffers. If we get a message that's too long, just dump it and ignore it. This resolves: http://tracker.ceph.com/issues/4664 Signed-off-by: Alex Elder --- net/ceph/messenger.c | 6 ++++++ 1 file changed, 6 insertions(+) dout("alloc_msg said skip message\n"); diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 994192b..ae825e44 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -2207,6 +2207,12 @@ static int read_partial_message(struct ceph_connection *con) 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 */