lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.8 067/633] smb3: fix stat when special device file and mounted with modefromsid
    Date
    From: Steve French <stfrench@microsoft.com>

    commit 3c3317daef0afa0cd541fc9c1bfd6ce8bbf1129a upstream.

    When mounting with modefromsid mount option, it was possible to
    get the error on stat of a fifo or char or block device:
    "cannot stat <filename>: Operation not supported"

    Special devices can be stored as reparse points by some servers
    (e.g. Windows NFS server and when using the SMB3.1.1 POSIX
    Extensions) but when the modefromsid mount option is used
    the client attempts to get the ACL for the file which requires
    opening with OPEN_REPARSE_POINT create option.

    Signed-off-by: Steve French <stfrench@microsoft.com>
    CC: Stable <stable@vger.kernel.org>
    Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
    Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/cifs/smb2ops.c | 7 ++++++-
    1 file changed, 6 insertions(+), 1 deletion(-)

    --- a/fs/cifs/smb2ops.c
    +++ b/fs/cifs/smb2ops.c
    @@ -3072,7 +3072,12 @@ get_smb2_acl_by_path(struct cifs_sb_info
    oparms.tcon = tcon;
    oparms.desired_access = READ_CONTROL;
    oparms.disposition = FILE_OPEN;
    - oparms.create_options = cifs_create_options(cifs_sb, 0);
    + /*
    + * When querying an ACL, even if the file is a symlink we want to open
    + * the source not the target, and so the protocol requires that the
    + * client specify this flag when opening a reparse point
    + */
    + oparms.create_options = cifs_create_options(cifs_sb, 0) | OPEN_REPARSE_POINT;
    oparms.fid = &fid;
    oparms.reconnect = false;


    \
     
     \ /
      Last update: 2020-10-27 18:40    [W:4.019 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site