From: Greg Kroah-Hartman Date: Tue, 15 Oct 2019 06:18:38 +0000 (+0200) Subject: fix fuzz on 4.19 patch X-Git-Tag: v4.4.197~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63992e7542bd60516eb75dfa75f9178d738460b7;p=thirdparty%2Fkernel%2Fstable-queue.git fix fuzz on 4.19 patch --- diff --git a/queue-4.19/cifs-use-cifsinodeinfo-open_file_lock-while-iteratin.patch b/queue-4.19/cifs-use-cifsinodeinfo-open_file_lock-while-iteratin.patch index 24573758938..710bd35094f 100644 --- a/queue-4.19/cifs-use-cifsinodeinfo-open_file_lock-while-iteratin.patch +++ b/queue-4.19/cifs-use-cifsinodeinfo-open_file_lock-while-iteratin.patch @@ -49,14 +49,12 @@ Signed-off-by: Dave Wysochanski Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French --- - fs/cifs/file.c | 27 +++++++++++---------------- + fs/cifs/file.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) -diff --git a/fs/cifs/file.c b/fs/cifs/file.c -index 8703b5f26f452..26027d85ffd57 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c -@@ -1835,13 +1835,12 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, +@@ -1841,13 +1841,12 @@ struct cifsFileInfo *find_readable_file( { struct cifsFileInfo *open_file = NULL; struct cifs_sb_info *cifs_sb = CIFS_SB(cifs_inode->vfs_inode.i_sb); @@ -71,7 +69,7 @@ index 8703b5f26f452..26027d85ffd57 100644 /* we could simply get the first_list_entry since write-only entries are always at the end of the list but since the first entry might have a close pending, we go through the whole list */ -@@ -1853,7 +1852,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, +@@ -1859,7 +1858,7 @@ struct cifsFileInfo *find_readable_file( /* found a good file */ /* lock it so it will not be closed on us */ cifsFileInfo_get(open_file); @@ -80,7 +78,7 @@ index 8703b5f26f452..26027d85ffd57 100644 return open_file; } /* else might as well continue, and look for another, or simply have the caller reopen it -@@ -1861,7 +1860,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, +@@ -1867,7 +1866,7 @@ struct cifsFileInfo *find_readable_file( } else /* write only file */ break; /* write only files are last so must be done */ } @@ -89,7 +87,7 @@ index 8703b5f26f452..26027d85ffd57 100644 return NULL; } -@@ -1870,7 +1869,6 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, +@@ -1876,7 +1875,6 @@ struct cifsFileInfo *find_writable_file( { struct cifsFileInfo *open_file, *inv_file = NULL; struct cifs_sb_info *cifs_sb; @@ -97,7 +95,7 @@ index 8703b5f26f452..26027d85ffd57 100644 bool any_available = false; int rc; unsigned int refind = 0; -@@ -1886,16 +1884,15 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, +@@ -1892,16 +1890,15 @@ struct cifsFileInfo *find_writable_file( } cifs_sb = CIFS_SB(cifs_inode->vfs_inode.i_sb); @@ -116,7 +114,7 @@ index 8703b5f26f452..26027d85ffd57 100644 return NULL; } list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { -@@ -1907,7 +1904,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, +@@ -1913,7 +1910,7 @@ refind_writable: if (!open_file->invalidHandle) { /* found a good writable file */ cifsFileInfo_get(open_file); @@ -125,7 +123,7 @@ index 8703b5f26f452..26027d85ffd57 100644 return open_file; } else { if (!inv_file) -@@ -1926,7 +1923,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, +@@ -1932,7 +1929,7 @@ refind_writable: cifsFileInfo_get(inv_file); } @@ -134,7 +132,7 @@ index 8703b5f26f452..26027d85ffd57 100644 if (inv_file) { rc = cifs_reopen_file(inv_file, false); -@@ -1940,7 +1937,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, +@@ -1946,7 +1943,7 @@ refind_writable: cifsFileInfo_put(inv_file); ++refind; inv_file = NULL; @@ -143,7 +141,7 @@ index 8703b5f26f452..26027d85ffd57 100644 goto refind_writable; } } -@@ -4001,17 +3998,15 @@ static int cifs_readpage(struct file *file, struct page *page) +@@ -4007,17 +4004,15 @@ static int cifs_readpage(struct file *fi static int is_inode_writable(struct cifsInodeInfo *cifs_inode) { struct cifsFileInfo *open_file; @@ -164,6 +162,3 @@ index 8703b5f26f452..26027d85ffd57 100644 return 0; } --- -2.20.1 -