From: Greg Kroah-Hartman Date: Thu, 30 Nov 2023 13:36:25 +0000 (+0000) Subject: 5.10-stable patches X-Git-Tag: v5.15.141~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a87f6f3a71bf7d717be0d6ae228de96dcf94b234;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: asoc-simple-card-fixup-asoc_simple_probe-error-handling.patch nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch --- diff --git a/queue-5.10/asoc-simple-card-fixup-asoc_simple_probe-error-handling.patch b/queue-5.10/asoc-simple-card-fixup-asoc_simple_probe-error-handling.patch new file mode 100644 index 00000000000..da646c38e73 --- /dev/null +++ b/queue-5.10/asoc-simple-card-fixup-asoc_simple_probe-error-handling.patch @@ -0,0 +1,80 @@ +From 41bae58df411f9accf01ea660730649b2fab1dab Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto +Date: Tue, 19 Sep 2023 05:34:18 +0000 +Subject: ASoC: simple-card: fixup asoc_simple_probe() error handling + +From: Kuninori Morimoto + +commit 41bae58df411f9accf01ea660730649b2fab1dab upstream. + +asoc_simple_probe() is used for both "DT probe" (A) and "platform probe" +(B). It uses "goto err" when error case, but it is not needed for +"platform probe" case (B). Thus it is using "return" directly there. + + static int asoc_simple_probe(...) + { + ^ if (...) { + | ... +(A) if (ret < 0) + | goto err; + v } else { + ^ ... + | if (ret < 0) +(B) return -Exxx; + v } + + ... + ^ if (ret < 0) +(C) goto err; + v ... + + err: +(D) simple_util_clean_reference(card); + + return ret; + } + +Both case are using (C) part, and it calls (D) when err case. +But (D) will do nothing for (B) case. +Because of these behavior, current code itself is not wrong, +but is confusable, and more, static analyzing tool will warning on +(B) part (should use goto err). + +To avoid static analyzing tool warning, this patch uses "goto err" +on (B) part. + +Reported-by: kernel test robot +Reported-by: Dan Carpenter +Signed-off-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/87o7hy7mlh.wl-kuninori.morimoto.gx@renesas.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/generic/simple-card.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/sound/soc/generic/simple-card.c ++++ b/sound/soc/generic/simple-card.c +@@ -634,10 +634,12 @@ static int asoc_simple_probe(struct plat + + int dai_idx = 0; + ++ ret = -EINVAL; ++ + cinfo = dev->platform_data; + if (!cinfo) { + dev_err(dev, "no info for asoc-simple-card\n"); +- return -EINVAL; ++ goto err; + } + + if (!cinfo->name || +@@ -646,7 +648,7 @@ static int asoc_simple_probe(struct plat + !cinfo->platform || + !cinfo->cpu_dai.name) { + dev_err(dev, "insufficient asoc_simple_card_info settings\n"); +- return -EINVAL; ++ goto err; + } + + dai_props->cpu_dai = &priv->dais[dai_idx++]; diff --git a/queue-5.10/ext4-make-sure-allocate-pending-entry-not-fail.patch b/queue-5.10/ext4-make-sure-allocate-pending-entry-not-fail.patch index 66538b0a687..9c204c2ddcb 100644 --- a/queue-5.10/ext4-make-sure-allocate-pending-entry-not-fail.patch +++ b/queue-5.10/ext4-make-sure-allocate-pending-entry-not-fail.patch @@ -22,14 +22,12 @@ Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- - fs/ext4/extents_status.c | 123 ++++++++++++++++++++++++++++----------- + fs/ext4/extents_status.c | 123 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 89 insertions(+), 34 deletions(-) -diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c -index 6c55ab427e650..cccbdfd49a86b 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c -@@ -152,8 +152,9 @@ static int __es_remove_extent(struct inode *inode, ext4_lblk_t lblk, +@@ -152,8 +152,9 @@ static int __es_remove_extent(struct ino static int es_reclaim_extents(struct ext4_inode_info *ei, int *nr_to_scan); static int __es_shrink(struct ext4_sb_info *sbi, int nr_to_scan, struct ext4_inode_info *locked_ei); @@ -41,7 +39,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 int __init ext4_init_es(void) { -@@ -450,6 +451,19 @@ static void ext4_es_list_del(struct inode *inode) +@@ -450,6 +451,19 @@ static void ext4_es_list_del(struct inod spin_unlock(&sbi->s_es_lock); } @@ -61,7 +59,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 /* * Returns true if we cannot fail to allocate memory for this extent_status * entry and cannot reclaim it until its status changes. -@@ -841,11 +855,12 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, +@@ -841,11 +855,12 @@ int ext4_es_insert_extent(struct inode * { struct extent_status newes; ext4_lblk_t end = lblk + len - 1; @@ -76,7 +74,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 if (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) return 0; -@@ -873,11 +888,17 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, +@@ -873,11 +888,17 @@ int ext4_es_insert_extent(struct inode * ext4_es_insert_extent_check(inode, &newes); @@ -94,7 +92,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 write_lock(&EXT4_I(inode)->i_es_lock); err1 = __es_remove_extent(inode, lblk, end, NULL, es1); -@@ -902,13 +923,18 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, +@@ -902,13 +923,18 @@ retry: es2 = NULL; } @@ -118,7 +116,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 goto retry; ext4_es_print_tree(inode); -@@ -1316,7 +1342,7 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end, +@@ -1316,7 +1342,7 @@ static unsigned int get_rsvd(struct inod rc->ndelonly--; node = rb_next(&pr->rb_node); rb_erase(&pr->rb_node, &tree->root); @@ -127,7 +125,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 if (!node) break; pr = rb_entry(node, struct pending_reservation, -@@ -1913,11 +1939,13 @@ static struct pending_reservation *__get_pending(struct inode *inode, +@@ -1913,11 +1939,13 @@ static struct pending_reservation *__get * * @inode - file containing the cluster * @lblk - logical block in the cluster to be added @@ -142,7 +140,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct ext4_pending_tree *tree = &EXT4_I(inode)->i_pending_tree; -@@ -1943,10 +1971,15 @@ static int __insert_pending(struct inode *inode, ext4_lblk_t lblk) +@@ -1943,10 +1971,15 @@ static int __insert_pending(struct inode } } @@ -162,7 +160,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 } pr->lclu = lclu; -@@ -1976,7 +2009,7 @@ static void __remove_pending(struct inode *inode, ext4_lblk_t lblk) +@@ -1976,7 +2009,7 @@ static void __remove_pending(struct inod if (pr != NULL) { tree = &EXT4_I(inode)->i_pending_tree; rb_erase(&pr->rb_node, &tree->root); @@ -171,7 +169,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 } } -@@ -2037,10 +2070,10 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, +@@ -2037,10 +2070,10 @@ int ext4_es_insert_delayed_block(struct bool allocated) { struct extent_status newes; @@ -184,7 +182,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 if (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) return 0; -@@ -2060,6 +2093,8 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, +@@ -2060,6 +2093,8 @@ retry: es1 = __es_alloc_extent(true); if ((err1 || err2) && !es2) es2 = __es_alloc_extent(true); @@ -193,7 +191,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 write_lock(&EXT4_I(inode)->i_es_lock); err1 = __es_remove_extent(inode, lblk, lblk, NULL, es1); -@@ -2082,11 +2117,18 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, +@@ -2082,11 +2117,18 @@ retry: es2 = NULL; } @@ -215,7 +213,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 goto retry; ext4_es_print_tree(inode); -@@ -2192,21 +2234,24 @@ unsigned int ext4_es_delayed_clu(struct inode *inode, ext4_lblk_t lblk, +@@ -2192,21 +2234,24 @@ unsigned int ext4_es_delayed_clu(struct * @inode - file containing the range * @lblk - logical block defining the start of range * @len - length of range in blocks @@ -243,7 +241,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 /* * Two cases - block range within single cluster and block range -@@ -2227,7 +2272,9 @@ static void __revise_pending(struct inode *inode, ext4_lblk_t lblk, +@@ -2227,7 +2272,9 @@ static void __revise_pending(struct inod f_del = __es_scan_range(inode, &ext4_es_is_delonly, first, lblk - 1); if (f_del) { @@ -254,7 +252,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 } else { last = EXT4_LBLK_CMASK(sbi, end) + sbi->s_cluster_ratio - 1; -@@ -2235,9 +2282,11 @@ static void __revise_pending(struct inode *inode, ext4_lblk_t lblk, +@@ -2235,9 +2282,11 @@ static void __revise_pending(struct inod l_del = __es_scan_range(inode, &ext4_es_is_delonly, end + 1, last); @@ -269,7 +267,7 @@ index 6c55ab427e650..cccbdfd49a86b 100644 __remove_pending(inode, last); } } else { -@@ -2245,18 +2294,24 @@ static void __revise_pending(struct inode *inode, ext4_lblk_t lblk, +@@ -2245,18 +2294,24 @@ static void __revise_pending(struct inod if (first != lblk) f_del = __es_scan_range(inode, &ext4_es_is_delonly, first, lblk - 1); @@ -300,6 +298,3 @@ index 6c55ab427e650..cccbdfd49a86b 100644 +out: + return ret; } --- -2.42.0 - diff --git a/queue-5.10/nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch b/queue-5.10/nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch new file mode 100644 index 00000000000..0c2ae572edc --- /dev/null +++ b/queue-5.10/nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch @@ -0,0 +1,51 @@ +From 5fc242c1180458aaea3b6abacc72873e277762f4 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Sat, 14 Oct 2023 21:34:40 -0400 +Subject: nfsd: lock_rename() needs both directories to live on the same fs + +From: Al Viro + +commit 1aee9158bc978f91701c5992e395efbc6da2de3c upstream. + +... checking that after lock_rename() is too late. Incidentally, +NFSv2 had no nfserr_xdev... + +Fixes: aa387d6ce153 "nfsd: fix EXDEV checking in rename" +Cc: stable@vger.kernel.org # v3.9+ +Reviewed-by: Jeff Layton +Acked-by: Chuck Lever +Tested-by: Jeff Layton +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfsd/vfs.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/fs/nfsd/vfs.c ++++ b/fs/nfsd/vfs.c +@@ -1758,6 +1758,12 @@ nfsd_rename(struct svc_rqst *rqstp, stru + if (!flen || isdotent(fname, flen) || !tlen || isdotent(tname, tlen)) + goto out; + ++ err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev; ++ if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) ++ goto out; ++ if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) ++ goto out; ++ + retry: + host_err = fh_want_write(ffhp); + if (host_err) { +@@ -1792,12 +1798,6 @@ retry: + if (ndentry == trap) + goto out_dput_new; + +- host_err = -EXDEV; +- if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) +- goto out_dput_new; +- if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) +- goto out_dput_new; +- + if (nfsd_has_cached_files(ndentry)) { + has_cached = true; + goto out_dput_old; diff --git a/queue-5.10/series b/queue-5.10/series index d2a6891daf9..aaa3abafa7e 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -53,3 +53,5 @@ ext4-using-nofail-preallocation-in-ext4_es_insert_de.patch ext4-using-nofail-preallocation-in-ext4_es_insert_ex.patch ext4-fix-slab-use-after-free-in-ext4_es_insert_exten.patch ext4-make-sure-allocate-pending-entry-not-fail.patch +nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch +asoc-simple-card-fixup-asoc_simple_probe-error-handling.patch