All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Cc: linux-cifs@vger.kernel.org, sfrench@samba.org, pc@cjr.nz,
	lsahlber@redhat.com, sprasad@microsoft.com, tom@talpey.com
Subject: Re: [PATCH 1/3] cifs: Fix wrong return value checking when GETFLAGS
Date: Tue, 15 Nov 2022 13:07:07 -0600	[thread overview]
Message-ID: <CAH2r5mvxC=8Pe5SJ9HHyCbNFo48Xfzdyyji-ZqPnZMD28A1tog@mail.gmail.com> (raw)
In-Reply-To: <20221115103936.3303416-2-zhangxiaoxu5@huawei.com>

good catch - merged into cifs-2.6.git for-next

The other two look reasonable but I wanted to do a little more testing
on them - feedback/reviews on them welcome (especially patch 2)

On Tue, Nov 15, 2022 at 3:35 AM Zhang Xiaoxu <zhangxiaoxu5@huawei.com> wrote:
>
> The return value of CIFSGetExtAttr is negative, should be checked
> with -EOPNOTSUPP rather than EOPNOTSUPP.
>
> Fixes: 64a5cfa6db9 ("Allow setting per-file compression via SMB2/3")
> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
> ---
>  fs/cifs/ioctl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
> index 89d5fa887364..6419ec47c2a8 100644
> --- a/fs/cifs/ioctl.c
> +++ b/fs/cifs/ioctl.c
> @@ -343,7 +343,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
>                                         rc = put_user(ExtAttrBits &
>                                                 FS_FL_USER_VISIBLE,
>                                                 (int __user *)arg);
> -                               if (rc != EOPNOTSUPP)
> +                               if (rc != -EOPNOTSUPP)
>                                         break;
>                         }
>  #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
> @@ -373,7 +373,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
>                          *                     pSMBFile->fid.netfid,
>                          *                     extAttrBits,
>                          *                     &ExtAttrMask);
> -                        * if (rc != EOPNOTSUPP)
> +                        * if (rc != -EOPNOTSUPP)
>                          *      break;
>                          */
>
> --
> 2.31.1
>


-- 
Thanks,

Steve

  reply	other threads:[~2022-11-15 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 10:39 [PATCH 0/3] Fix some bug in cifs Zhang Xiaoxu
2022-11-15 10:39 ` [PATCH 1/3] cifs: Fix wrong return value checking when GETFLAGS Zhang Xiaoxu
2022-11-15 19:07   ` Steve French [this message]
2023-08-18  3:56     ` Shyam Prasad N
2022-11-15 10:39 ` [PATCH 2/3] cifs: Fix UAF in cifs_demultiplex_thread() Zhang Xiaoxu
2022-11-15 10:39 ` [PATCH 3/3] cifs: Move the in_send statistic to __smb_send_rqst() Zhang Xiaoxu

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='CAH2r5mvxC=8Pe5SJ9HHyCbNFo48Xfzdyyji-ZqPnZMD28A1tog@mail.gmail.com' \
    --to=smfrench@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=lsahlber@redhat.com \
    --cc=pc@cjr.nz \
    --cc=sfrench@samba.org \
    --cc=sprasad@microsoft.com \
    --cc=tom@talpey.com \
    --cc=zhangxiaoxu5@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.