From: Greg Kroah-Hartman Date: Mon, 6 Jun 2022 08:39:35 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.10.121~160 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8cff7dba2fd12fb1ef9317936adac0b3b119016;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: cifs-fix-potential-double-free-during-failed-mount.patch cifs-when-extending-a-file-with-falloc-we-should-make-files-not-sparse.patch xhci-allow-host-runtime-pm-as-default-for-intel-alder-lake-n-xhci.patch --- diff --git a/queue-5.15/cifs-fix-potential-double-free-during-failed-mount.patch b/queue-5.15/cifs-fix-potential-double-free-during-failed-mount.patch new file mode 100644 index 00000000000..e7941ee44bf --- /dev/null +++ b/queue-5.15/cifs-fix-potential-double-free-during-failed-mount.patch @@ -0,0 +1,46 @@ +From 8378a51e3f8140f60901fb27208cc7a6e47047b5 Mon Sep 17 00:00:00 2001 +From: Ronnie Sahlberg +Date: Tue, 31 May 2022 13:01:17 +1000 +Subject: cifs: fix potential double free during failed mount + +From: Ronnie Sahlberg + +commit 8378a51e3f8140f60901fb27208cc7a6e47047b5 upstream. + +RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2088799 + +Cc: stable@vger.kernel.org +Signed-off-by: Roberto Bergantinos +Signed-off-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/cifsfs.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/fs/cifs/cifsfs.c ++++ b/fs/cifs/cifsfs.c +@@ -826,7 +826,7 @@ cifs_smb3_do_mount(struct file_system_ty + int flags, struct smb3_fs_context *old_ctx) + { + int rc; +- struct super_block *sb; ++ struct super_block *sb = NULL; + struct cifs_sb_info *cifs_sb = NULL; + struct cifs_mnt_data mnt_data; + struct dentry *root; +@@ -922,9 +922,11 @@ out_super: + return root; + out: + if (cifs_sb) { +- kfree(cifs_sb->prepath); +- smb3_cleanup_fs_context(cifs_sb->ctx); +- kfree(cifs_sb); ++ if (!sb || IS_ERR(sb)) { /* otherwise kill_sb will handle */ ++ kfree(cifs_sb->prepath); ++ smb3_cleanup_fs_context(cifs_sb->ctx); ++ kfree(cifs_sb); ++ } + } + return root; + } diff --git a/queue-5.15/cifs-when-extending-a-file-with-falloc-we-should-make-files-not-sparse.patch b/queue-5.15/cifs-when-extending-a-file-with-falloc-we-should-make-files-not-sparse.patch new file mode 100644 index 00000000000..cb711437dd6 --- /dev/null +++ b/queue-5.15/cifs-when-extending-a-file-with-falloc-we-should-make-files-not-sparse.patch @@ -0,0 +1,32 @@ +From f66f8b94e7f2f4ac9fffe710be231ca8f25c5057 Mon Sep 17 00:00:00 2001 +From: Ronnie Sahlberg +Date: Wed, 1 Jun 2022 08:48:38 +1000 +Subject: cifs: when extending a file with falloc we should make files not-sparse + +From: Ronnie Sahlberg + +commit f66f8b94e7f2f4ac9fffe710be231ca8f25c5057 upstream. + +as this is the only way to make sure the region is allocated. +Fix the conditional that was wrong and only tried to make already +non-sparse files non-sparse. + +Cc: stable@vger.kernel.org +Signed-off-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/smb2ops.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/cifs/smb2ops.c ++++ b/fs/cifs/smb2ops.c +@@ -3791,7 +3791,7 @@ static long smb3_simple_falloc(struct fi + if (rc) + goto out; + +- if ((cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) == 0) ++ if (cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) + smb2_set_sparse(xid, tcon, cfile, inode, false); + + eof = cpu_to_le64(off + len); diff --git a/queue-5.15/series b/queue-5.15/series index bba00a762b8..6db80270b2a 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -25,3 +25,6 @@ fs-ntfs3-in-function-ntfs_set_acl_ex-do-not-change-inode-i_mode-if-called-from-f fs-ntfs3-fix-some-memory-leaks-in-an-error-handling-path-of-log_replay.patch fs-ntfs3-update-i_ctime-when-xattr-is-added.patch fs-ntfs3-restore-ntfs_xattr_get_acl-and-ntfs_xattr_set_acl-functions.patch +cifs-fix-potential-double-free-during-failed-mount.patch +cifs-when-extending-a-file-with-falloc-we-should-make-files-not-sparse.patch +xhci-allow-host-runtime-pm-as-default-for-intel-alder-lake-n-xhci.patch diff --git a/queue-5.15/xhci-allow-host-runtime-pm-as-default-for-intel-alder-lake-n-xhci.patch b/queue-5.15/xhci-allow-host-runtime-pm-as-default-for-intel-alder-lake-n-xhci.patch new file mode 100644 index 00000000000..b03ef280995 --- /dev/null +++ b/queue-5.15/xhci-allow-host-runtime-pm-as-default-for-intel-alder-lake-n-xhci.patch @@ -0,0 +1,39 @@ +From 74f55a62c4c354f43a6d75f77dd184c4f57b9a26 Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Thu, 12 May 2022 01:04:50 +0300 +Subject: xhci: Allow host runtime PM as default for Intel Alder Lake N xHCI + +From: Mathias Nyman + +commit 74f55a62c4c354f43a6d75f77dd184c4f57b9a26 upstream. + +Alder Lake N TCSS xHCI needs to be runtime suspended whenever possible +to allow the TCSS hardware block to enter D3 and thus save energy + +Cc: stable@kernel.org +Suggested-by: Gopal Vamshi Krishna +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20220511220450.85367-10-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-pci.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -59,6 +59,7 @@ + #define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI 0x9a13 + #define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138 + #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI 0x461e ++#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI 0x464e + #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed + + #define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639 +@@ -268,6 +269,7 @@ static void xhci_pci_quirks(struct devic + pdev->device == PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI || + pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI || + pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI || ++ pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI || + pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI)) + xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; +