From patchwork Wed Sep 30 13:04:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7297901 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D57699F1D5 for ; Wed, 30 Sep 2015 13:05:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F18E120328 for ; Wed, 30 Sep 2015 13:05:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C88D0202E6 for ; Wed, 30 Sep 2015 13:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933231AbbI3NFN (ORCPT ); Wed, 30 Sep 2015 09:05:13 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:59001 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932795AbbI3NE6 (ORCPT ); Wed, 30 Sep 2015 09:04:58 -0400 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0MgaRP-1a3SU046p5-00NwCD; Wed, 30 Sep 2015 15:04:44 +0200 From: Arnd Bergmann To: ceph-devel@vger.kernel.org Cc: y2038@lists.linaro.org, Ilya Dryomov , "Yan, Zheng" , Sage Weil , linux-kernel@vger.kernel.org Subject: [PATCH] ceph: fix message length computation Date: Wed, 30 Sep 2015 15:04:42 +0200 Message-ID: <9959810.KasB66Ks40@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:ClapqkKkE01l1Fv0QTjR3ysOx3kmDQhsHRtpGBnYIAsMqzG7lux 5CWQwiaTmHN6JJl1AG5QEn96HerNMr6+UaN9e3WKTHoMgelNIAaO2dSBteXOW+kCuERvQfZ 4RYPFb/IFAC5YHOe4wsKrMWdPHe8VUmtbvMQlotv8e+za/9hXEIX7Ze3GzoodG1AEqKQNoD HVcT9aGZVRDpx+PYOWIqw== X-UI-Out-Filterresults: notjunk:1; V01:K0:fnQ9tza+/VU=:OGSHzfmihf+J2D6bzI36h2 r4kxQIO4hUXlprdqk3cQP0pHIeLdQBQ4ZPXMvSVAyhgct31j3wpPdX2zvnqy+ue3TdnA2oM2V Zv3/hV0dG8A26JVriOILQLGl/WIs2uajex8Hheoyhy44F9CDaN5LX7BmnfPWsj1fuFUA4Lp91 FJfIxYQDUXted2LSD/Y2UIXg2BJ8ndGhL7TWNHPEXCIEKXI9P0bUad7HCwrxZz4LawUlY0e// p8/d09dq1EIFB/ONtW/ZNJyZTV9+pcCUyfAxt6PCbtDWVkwclJGpT6Vjs9TbQnlFztI7iC/RP N/a1qPBuui87J1Nei9cqDEviVGtkDCiMXtwl/pKyST78J/be8qtpN42TiQ5f1pp9TcBw3knMl 2CMSJui6fU8ZpKSp9kYrwfv45ggt35PTxg+I+h0mJ3iDWwiRMvAwRyiTp91+bsojjz/2YA0Y7 B2tWDEw0Ia/VdVWeV9q5tOGXQTjNVAH5zhPckfxZKUikwTXXuAc43l6B5wQ07xgOWwE2d/Akn dFjRrioDxosW5rsd3NU/kv7Vr9k3jU29plGP+YWlPOI+8lpjhQmpxgeaZeL8ROAdTBWZEgpPM eK4C700Xzcbng3Pv6mhy93eT4KPM1n0MjVhvCwi471WA06eHWHYj5VZ2D1G0bPxGotMqY+Dhc fTvuJHv38PheAMb1zGGliJCL+qMvTvc5X369j7oWPO2i7nY8UbXo0PpkCLtU9yW1ZHp5d+uc6 Q4rqzeg1iWggB8fk Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP create_request_message() computes the maximum length of a message, but uses the wrong type for the time stamp: sizeof(struct timespec) may be 8 or 16 depending on the architecture, while sizeof(struct ceph_timespec) is always 8, and that is what gets put into the message. Found while auditing the uses of timespec for y2038 problems. Signed-off-by: Arnd Bergmann Fixes: b8e69066d8af ("ceph: include time stamp in every MDS request") --- -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 51cb02da75d9..fe2c982764e7 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1935,7 +1935,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc, len = sizeof(*head) + pathlen1 + pathlen2 + 2*(1 + sizeof(u32) + sizeof(u64)) + - sizeof(struct timespec); + sizeof(struct ceph_timespec); /* calculate (max) length for cap releases */ len += sizeof(struct ceph_mds_request_release) *