From 489407096b106b0ff8ebe070a461eaa05c530274 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 8 Nov 2022 13:21:50 +0100 Subject: [PATCH] 6.0-stable patches added patches: cifs-fix-regression-in-very-old-smb1-mounts.patch ext4-f2fs-fix-readahead-of-verity-data.patch --- ...x-regression-in-very-old-smb1-mounts.patch | 40 ++++++++++++ ...t4-f2fs-fix-readahead-of-verity-data.patch | 62 +++++++++++++++++++ queue-6.0/series | 2 + 3 files changed, 104 insertions(+) create mode 100644 queue-6.0/cifs-fix-regression-in-very-old-smb1-mounts.patch create mode 100644 queue-6.0/ext4-f2fs-fix-readahead-of-verity-data.patch diff --git a/queue-6.0/cifs-fix-regression-in-very-old-smb1-mounts.patch b/queue-6.0/cifs-fix-regression-in-very-old-smb1-mounts.patch new file mode 100644 index 00000000000..be4697e6850 --- /dev/null +++ b/queue-6.0/cifs-fix-regression-in-very-old-smb1-mounts.patch @@ -0,0 +1,40 @@ +From 2f6f19c7aaad5005dc75298a413eb0243c5d312d Mon Sep 17 00:00:00 2001 +From: Ronnie Sahlberg +Date: Wed, 12 Oct 2022 09:12:07 +1000 +Subject: cifs: fix regression in very old smb1 mounts + +From: Ronnie Sahlberg + +commit 2f6f19c7aaad5005dc75298a413eb0243c5d312d upstream. + +BZ: 215375 + +Fixes: 76a3c92ec9e0 ("cifs: remove support for NTLM and weaker authentication algorithms") +Reviewed-by: Paulo Alcantara (SUSE) +Signed-off-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/connect.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -3921,12 +3921,11 @@ CIFSTCon(const unsigned int xid, struct + pSMB->AndXCommand = 0xFF; + pSMB->Flags = cpu_to_le16(TCON_EXTENDED_SECINFO); + bcc_ptr = &pSMB->Password[0]; +- if (tcon->pipe || (ses->server->sec_mode & SECMODE_USER)) { +- pSMB->PasswordLength = cpu_to_le16(1); /* minimum */ +- *bcc_ptr = 0; /* password is null byte */ +- bcc_ptr++; /* skip password */ +- /* already aligned so no need to do it below */ +- } ++ ++ pSMB->PasswordLength = cpu_to_le16(1); /* minimum */ ++ *bcc_ptr = 0; /* password is null byte */ ++ bcc_ptr++; /* skip password */ ++ /* already aligned so no need to do it below */ + + if (ses->server->sign) + smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; diff --git a/queue-6.0/ext4-f2fs-fix-readahead-of-verity-data.patch b/queue-6.0/ext4-f2fs-fix-readahead-of-verity-data.patch new file mode 100644 index 00000000000..140d749d951 --- /dev/null +++ b/queue-6.0/ext4-f2fs-fix-readahead-of-verity-data.patch @@ -0,0 +1,62 @@ +From 4fa0e3ff217f775cb58d2d6d51820ec519243fb9 Mon Sep 17 00:00:00 2001 +From: "Matthew Wilcox (Oracle)" +Date: Wed, 12 Oct 2022 20:34:19 +0100 +Subject: ext4,f2fs: fix readahead of verity data + +From: Matthew Wilcox (Oracle) + +commit 4fa0e3ff217f775cb58d2d6d51820ec519243fb9 upstream. + +The recent change of page_cache_ra_unbounded() arguments was buggy in the +two callers, causing us to readahead the wrong pages. Move the definition +of ractl down to after the index is set correctly. This affected +performance on configurations that use fs-verity. + +Link: https://lkml.kernel.org/r/20221012193419.1453558-1-willy@infradead.org +Fixes: 73bb49da50cd ("mm/readahead: make page_cache_ra_unbounded take a readahead_control") +Signed-off-by: Matthew Wilcox (Oracle) +Reported-by: Jintao Yin +Signed-off-by: Andrew Morton +Cc: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + fs/ext4/verity.c | 3 ++- + fs/f2fs/verity.c | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +--- a/fs/ext4/verity.c ++++ b/fs/ext4/verity.c +@@ -365,13 +365,14 @@ static struct page *ext4_read_merkle_tre + pgoff_t index, + unsigned long num_ra_pages) + { +- DEFINE_READAHEAD(ractl, NULL, NULL, inode->i_mapping, index); + struct page *page; + + index += ext4_verity_metadata_pos(inode) >> PAGE_SHIFT; + + page = find_get_page_flags(inode->i_mapping, index, FGP_ACCESSED); + if (!page || !PageUptodate(page)) { ++ DEFINE_READAHEAD(ractl, NULL, NULL, inode->i_mapping, index); ++ + if (page) + put_page(page); + else if (num_ra_pages > 1) +--- a/fs/f2fs/verity.c ++++ b/fs/f2fs/verity.c +@@ -262,13 +262,14 @@ static struct page *f2fs_read_merkle_tre + pgoff_t index, + unsigned long num_ra_pages) + { +- DEFINE_READAHEAD(ractl, NULL, NULL, inode->i_mapping, index); + struct page *page; + + index += f2fs_verity_metadata_pos(inode) >> PAGE_SHIFT; + + page = find_get_page_flags(inode->i_mapping, index, FGP_ACCESSED); + if (!page || !PageUptodate(page)) { ++ DEFINE_READAHEAD(ractl, NULL, NULL, inode->i_mapping, index); ++ + if (page) + put_page(page); + else if (num_ra_pages > 1) diff --git a/queue-6.0/series b/queue-6.0/series index ef58b4d7a39..c876c8295f4 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -187,3 +187,5 @@ kvm-x86-emulator-em_sysexit-should-update-ctxt-mode.patch kvm-x86-emulator-introduce-emulator_recalc_and_set_mode.patch kvm-x86-emulator-update-the-emulation-mode-after-rsm.patch kvm-x86-emulator-update-the-emulation-mode-after-cr0-write.patch +ext4-f2fs-fix-readahead-of-verity-data.patch +cifs-fix-regression-in-very-old-smb1-mounts.patch -- 2.47.3