mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Steve French <smfrench@gmail.com>
Cc: "Aurélien Aptel" <aaptel@suse.com>,
	"Jiapeng Zhong" <abaci-bugfix@linux.alibaba.com>,
	"Steve French" <sfrench@samba.org>,
	CIFS <linux-cifs@vger.kernel.org>,
	samba-technical <samba-technical@lists.samba.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs/cifs: Replace one-element array with flexible-array member.
Date: Mon, 18 Jan 2021 00:01:52 +0000	[thread overview]
Message-ID: <20210118000152.GH3579531@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAH2r5mvjDAgB6-kE=AOAwrETVk+R79z6Gd8gMnOTWqG-6Mnybw@mail.gmail.com>

On Sun, Jan 17, 2021 at 03:58:23PM -0600, Steve French wrote:
> 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 =
> smb2pdu.c:4655:         cpu_to_le16(sizeof(struct
> smb2_query_directory_req) - 1);

FWIW, that sizeof() - 1 should've been offsetof()...

  reply	other threads:[~2021-01-18  0:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  9:06 Jiapeng Zhong
2021-01-14  9:25 ` Aurélien Aptel
2021-01-17 21:58   ` Steve French
2021-01-18  0:01     ` Al Viro [this message]
2021-01-18  2:08       ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210118000152.GH3579531@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=aaptel@suse.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome