]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ksmbd: allow write with FILE_APPEND_DATA
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 3 Sep 2024 11:26:33 +0000 (20:26 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:30 +0000 (16:33 +0200)
commit 2fb9b5dc80cabcee636a6ccd020740dd925b4580 upstream.

Windows client write with FILE_APPEND_DATA when using git.
ksmbd should allow write it with this flags.

Z:\test>git commit -m "test"
fatal: cannot update the ref 'HEAD': unable to append to
 '.git/logs/HEAD': Bad file descriptor

Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/server/vfs.c

index 62de668cd1e110bc16a9f8b252952f8f9ec83822..13dad48d950c969696760d8ab2b703f7af6c5c26 100644 (file)
@@ -496,7 +496,7 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
        int err = 0;
 
        if (work->conn->connection_type) {
-               if (!(fp->daccess & FILE_WRITE_DATA_LE)) {
+               if (!(fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE))) {
                        pr_err("no right to write(%pD)\n", fp->filp);
                        err = -EACCES;
                        goto out;