From: Greg Kroah-Hartman Date: Sun, 7 Sep 2025 08:05:02 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v5.4.299~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0086da80c4da5d50778adeec178478efebec5855;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: drm-amd-display-check-link_res-hpo_dp_link_enc-before-using-it.patch fs-relax-assertions-on-failure-to-encode-file-handles.patch --- diff --git a/queue-6.1/drm-amd-display-check-link_res-hpo_dp_link_enc-before-using-it.patch b/queue-6.1/drm-amd-display-check-link_res-hpo_dp_link_enc-before-using-it.patch new file mode 100644 index 0000000000..9743219ce2 --- /dev/null +++ b/queue-6.1/drm-amd-display-check-link_res-hpo_dp_link_enc-before-using-it.patch @@ -0,0 +1,51 @@ +From 0beca868cde8742240cd0038141c30482d2b7eb8 Mon Sep 17 00:00:00 2001 +From: Alex Hung +Date: Thu, 27 Jun 2024 16:45:39 -0600 +Subject: drm/amd/display: Check link_res->hpo_dp_link_enc before using it + +From: Alex Hung + +commit 0beca868cde8742240cd0038141c30482d2b7eb8 upstream. + +[WHAT & HOW] +Functions dp_enable_link_phy and dp_disable_link_phy can pass link_res +without initializing hpo_dp_link_enc and it is necessary to check for +null before dereferencing. + +This fixes 2 FORWARD_NULL issues reported by Coverity. + +Reviewed-by: Rodrigo Siqueira +Signed-off-by: Jerry Zuo +Signed-off-by: Alex Hung +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +[ Minor context change fixed. ] +Signed-off-by: Alva Lan +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c ++++ b/drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c +@@ -29,6 +29,8 @@ + #include "dc_link_dp.h" + #include "clk_mgr.h" + ++#define DC_LOGGER link->ctx->logger ++ + static enum phyd32clk_clock_source get_phyd32clk_src(struct dc_link *link) + { + switch (link->link_enc->transmitter) { +@@ -224,6 +226,11 @@ static void disable_hpo_dp_link_output(s + const struct link_resource *link_res, + enum signal_type signal) + { ++ if (!link_res->hpo_dp_link_enc) { ++ DC_LOG_ERROR("%s: invalid hpo_dp_link_enc\n", __func__); ++ return; ++ } ++ + if (IS_FPGA_MAXIMUS_DC(link->dc->ctx->dce_environment)) { + disable_hpo_dp_fpga_link_output(link, link_res, signal); + } else { diff --git a/queue-6.1/fs-relax-assertions-on-failure-to-encode-file-handles.patch b/queue-6.1/fs-relax-assertions-on-failure-to-encode-file-handles.patch new file mode 100644 index 0000000000..2a55ac5edf --- /dev/null +++ b/queue-6.1/fs-relax-assertions-on-failure-to-encode-file-handles.patch @@ -0,0 +1,81 @@ +From 974e3fe0ac61de85015bbe5a4990cf4127b304b2 Mon Sep 17 00:00:00 2001 +From: Amir Goldstein +Date: Thu, 19 Dec 2024 12:53:01 +0100 +Subject: fs: relax assertions on failure to encode file handles + +From: Amir Goldstein + +commit 974e3fe0ac61de85015bbe5a4990cf4127b304b2 upstream. + +Encoding file handles is usually performed by a filesystem >encode_fh() +method that may fail for various reasons. + +The legacy users of exportfs_encode_fh(), namely, nfsd and +name_to_handle_at(2) syscall are ready to cope with the possibility +of failure to encode a file handle. + +There are a few other users of exportfs_encode_{fh,fid}() that +currently have a WARN_ON() assertion when ->encode_fh() fails. +Relax those assertions because they are wrong. + +The second linked bug report states commit 16aac5ad1fa9 ("ovl: support +encoding non-decodable file handles") in v6.6 as the regressing commit, +but this is not accurate. + +The aforementioned commit only increases the chances of the assertion +and allows triggering the assertion with the reproducer using overlayfs, +inotify and drop_caches. + +Triggering this assertion was always possible with other filesystems and +other reasons of ->encode_fh() failures and more particularly, it was +also possible with the exact same reproducer using overlayfs that is +mounted with options index=on,nfs_export=on also on kernels < v6.6. +Therefore, I am not listing the aforementioned commit as a Fixes commit. + +Backport hint: this patch will have a trivial conflict applying to +v6.6.y, and other trivial conflicts applying to stable kernels < v6.6. + +Reported-by: syzbot+ec07f6f5ce62b858579f@syzkaller.appspotmail.com +Tested-by: syzbot+ec07f6f5ce62b858579f@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/linux-unionfs/671fd40c.050a0220.4735a.024f.GAE@google.com/ +Reported-by: Dmitry Safonov +Closes: https://lore.kernel.org/linux-fsdevel/CAGrbwDTLt6drB9eaUagnQVgdPBmhLfqqxAf3F+Juqy_o6oP8uw@mail.gmail.com/ +Cc: stable@vger.kernel.org +Signed-off-by: Amir Goldstein +Link: https://lore.kernel.org/r/20241219115301.465396-1-amir73il@gmail.com +Signed-off-by: Christian Brauner +Signed-off-by: Norbert Manthey +Signed-off-by: Greg Kroah-Hartman +--- + fs/notify/fdinfo.c | 4 +--- + fs/overlayfs/copy_up.c | 5 ++--- + 2 files changed, 3 insertions(+), 6 deletions(-) + +--- a/fs/notify/fdinfo.c ++++ b/fs/notify/fdinfo.c +@@ -51,10 +51,8 @@ static void show_mark_fhandle(struct seq + size = f.handle.handle_bytes >> 2; + + ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, NULL); +- if ((ret == FILEID_INVALID) || (ret < 0)) { +- WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret); ++ if ((ret == FILEID_INVALID) || (ret < 0)) + return; +- } + + f.handle.handle_type = ret; + f.handle.handle_bytes = size * sizeof(u32); +--- a/fs/overlayfs/copy_up.c ++++ b/fs/overlayfs/copy_up.c +@@ -361,9 +361,8 @@ struct ovl_fh *ovl_encode_real_fh(struct + buflen = (dwords << 2); + + err = -EIO; +- if (WARN_ON(fh_type < 0) || +- WARN_ON(buflen > MAX_HANDLE_SZ) || +- WARN_ON(fh_type == FILEID_INVALID)) ++ if (fh_type < 0 || fh_type == FILEID_INVALID || ++ WARN_ON(buflen > MAX_HANDLE_SZ)) + goto out_err; + + fh->fb.version = OVL_FH_VERSION; diff --git a/queue-6.1/series b/queue-6.1/series index 0a0957fb2e..d580384415 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -71,3 +71,5 @@ cpufreq-intel_pstate-fold-intel_pstate_max_within_limits-into-caller.patch cpufreq-intel_pstate-do-not-update-global.turbo_disabled-after-initialization.patch cpufreq-intel_pstate-unchecked-msr-aceess-in-legacy-mode.patch alsa-hda-realtek-add-support-for-hp-agusta-using-cs35l41-hda.patch +fs-relax-assertions-on-failure-to-encode-file-handles.patch +drm-amd-display-check-link_res-hpo_dp_link_enc-before-using-it.patch