Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1567843pxb; Sun, 17 Jan 2021 14:01:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkOTFxB3u4bwxpBA9GLRTJyGvUJymAc/mCrOuJWsKi3J+D+Sa66be9Rg1W2nkCa2sXbD+x X-Received: by 2002:a05:6402:34c5:: with SMTP id w5mr17191942edc.65.1610920875330; Sun, 17 Jan 2021 14:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610920875; cv=none; d=google.com; s=arc-20160816; b=Ian1PI+b+lk4DLrRMJNQX5KSiXHn90k+ZvUH0KY3PXNIoJP2CKN2m3Nh5kL6hARRqc m2Pbk/aFs8YTYh15riUUgRNze4lExU01Aoo9J2FsFYQ+XNoZoUUZ6RklV4+HBy4bJRwy 3sO6UNpc+ecVUTKloahMQrVJyrq4Jg0cLiZxBHk4clsyQwCtkSwv7sXsJ8ps3Hkb1HGK TW5dLJYbPh6ZNciV/0df8XRkQxt8gHsAYMAPY6x8fyoirdK9k47DBi7rEFoKKI7wyFBC wUQy2d95sII5GOAd8i+DXFW0dAMpS4GYm8KWnBHs+TnNA2rFtZPEExfUXFytgvAKtdqe kGSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Z4HhEek/Tw4oVixmxh9pmK2rVtkzaVm9nEVNhWaLiyw=; b=vpk/3VroWk7sdHdQvvjxapE2FwDubIh295lKmS24c45+Mw1cDzV65IGefwRNTv4Xfh B7zCPhyrr3Do8D5Ngoj9fz5gjwbCLtO5K4CUurjfJJH5GfBGTkXAfI+lXNItpbMUhPWN WWvBksOplRD5IirZNM8rANxanEWYsRJWvXRQ0fBeQ5hmAU11oC9S6zebqWj5WRCuhyf3 9oX9ji1t57pIz2mcdsGepTUey1hOfNmj/v9cVOZ/rq+jsn9ry1cZ5hKYLpiZV7+1z26h z2cRMyaP9JSxvRkHXQfepBrXELzIZpetA6aHydNLc7X6mxPlBK57aSqpuPmeAuw2ygZI v2Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jDmj8Lh2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si6925197edk.411.2021.01.17.14.00.51; Sun, 17 Jan 2021 14:01:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jDmj8Lh2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730146AbhAQV7V (ORCPT + 99 others); Sun, 17 Jan 2021 16:59:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728918AbhAQV7R (ORCPT ); Sun, 17 Jan 2021 16:59:17 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 869DEC061573; Sun, 17 Jan 2021 13:58:36 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id m10so16267023lji.1; Sun, 17 Jan 2021 13:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Z4HhEek/Tw4oVixmxh9pmK2rVtkzaVm9nEVNhWaLiyw=; b=jDmj8Lh2X7IY7EvLIy/ippLSvG+u36PR8Mf4KjMpj6sEGJkVJWqrIV/dJgdtpHChPt x5dfS7+Gf3Clr0jy4FS6yY2j27zVS6+WI0JFwy9B8QXwfS6Kq1R4X7QuGbGfQWwyez2t 7k6k7gt0cn2wPjkg5wMKMKZqie8lQL7auL2I5u09vbokUqRB/FOSU3a7lDKC9Z/U3YY6 u51JXUm6vBmOOaAdzNbHiBwREMPhDErI1geeDdtyg6LERBhlG/w0vZwDtW4426RcAv4/ eJXUKn0oOlOyug7Xg7ir1mYhcr+MxAfJCvf+qBfYXQ7QzfMqIIyIIc5HhAt2k2WOlyE7 7RHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Z4HhEek/Tw4oVixmxh9pmK2rVtkzaVm9nEVNhWaLiyw=; b=ZVL/jK/CW8p2hHsYw+8cL2iMD40QQ8Jf30+ns0IHbBmZMRrks8hREfqQwQVGvwbUgm 6oqm1c4ZZvpESqER7LgDCG+aSv2VqNRHeo4bUbxb7jRp46uCCoQfDoakuF7PwvCqyRhB CNCxAohRkzYJzd+tjWgTuf+Wy0i6WZfOO1MldVBylI3u65sgd83UqHyWAzqqaI1sA7Hq ISZ3mMoncRpPSrbS8zOHm4mR3Si4rEXhiTuLxCh9NYl2gFz6e3DZmNxnHIni5apEBuGg ZnwNgX6j9Q6UBEFaoaRWe2NhftEt9omuHo1c3hX58FeeNM+UKpAaLVVbzdX6PzFPeWiQ zYAQ== X-Gm-Message-State: AOAM533OKpSmbvpsS7tqrS0ZfgrMZLRyooyqMYho7YmsI1LAEH2WCFS7 EyGIY9eDjsry9fqCIuwYTpiKYeh8L6r3xzhwZOEW3fjDV6zFpw== X-Received: by 2002:a2e:9250:: with SMTP id v16mr9459481ljg.256.1610920714945; Sun, 17 Jan 2021 13:58:34 -0800 (PST) MIME-Version: 1.0 References: <1610615171-68296-1-git-send-email-abaci-bugfix@linux.alibaba.com> <87czy7lvjy.fsf@suse.com> In-Reply-To: <87czy7lvjy.fsf@suse.com> From: Steve French Date: Sun, 17 Jan 2021 15:58:23 -0600 Message-ID: Subject: Re: [PATCH] fs/cifs: Replace one-element array with flexible-array member. To: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Cc: Jiapeng Zhong , Steve French , CIFS , samba-technical , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jiapeng, Aurelien is correct, you should respin this patch and correct for where it breaks the sizeof calculation. For example your change: struct smb2_lock_rsp { @@ -1434,7 +1434,7 @@ struct smb2_query_directory_req { __le16 FileNameOffset; __le16 FileNameLength; __le32 OutputBufferLength; - __u8 Buffer[1]; + __u8 Buffer[]; } __packed; would have the side effect of making the file name off by one: smb2pdu.c-4654- req->FileNameOffset =3D smb2pdu.c:4655: cpu_to_le16(sizeof(struct smb2_query_directory_req) - 1); On Thu, Jan 14, 2021 at 3:26 AM Aur=C3=A9lien Aptel via samba-technical wrote: > > Hi Jiapeng, > > This will change the size returned by sizeof(). Have you checked that > this doesn't introduce off-by-one errors in all the sizeof() usage? > > Cheers, > -- > Aur=C3=A9lien Aptel / SUSE Labs Samba Team > GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3 > SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg,= DE > GF: Felix Imend=C3=B6rffer, Mary Higgins, Sri Rasiah HRB 247165 (AG M=C3= =BCnchen) > > --=20 Thanks, Steve