FAILED: patch "[PATCH] smb: client: clear ce->tgthint in free_tgts()" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x b1b741cf8e7ce1b91d937e23decd3d3358748700
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090318-driven-showgirl-ba4f@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b1b741cf8e7ce1b91d937e23decd3d3358748700 Mon Sep 17 00:00:00 2001
From: Fredric Cover <[email protected]>
Date: Fri, 24 Jul 2026 15:01:46 -0700
Subject: [PATCH] smb: client: clear ce->tgthint in free_tgts()
When free_tgts() frees all structures in ce->tlist, ce->tgthint is left pointing to one of the freed cache_dfs_tgt structures.
If ce->tgthint is not reset before it is used later, it results in a use-after-free.
Set ce->tgthint to NULL in free_tgts() after the elements are freed to reflect that no elements remain.
fs/smb/client/dfs_cache.c +2 -0
@@ -122,6 +122,8 @@ static inline void free_tgts(struct cache_entry *ce)kfree (t->name);kfree (t); } + +WRITE_ONCE (ce->tgthint,NULL ); }static inline void flush_cache_ent (struct cache_entry *ce)
Sasha Levin
maintainerPATCH 1/1 smb: client: clear ce->tgthint in free_tgts()
From: Fredric Cover <[email protected]>
[ Upstream commit b1b741cf8e7ce1b91d937e23decd3d3358748700 ]
When free_tgts() frees all structures in ce->tlist, ce->tgthint is left pointing to one of the freed cache_dfs_tgt structures.
If ce->tgthint is not reset before it is used later, it results in a use-after-free.
Set ce->tgthint to NULL in free_tgts() after the elements are freed to reflect that no elements remain.
--- fs/cifs/dfs_cache.c | 2 ++ 1 file changed, 2 insertions(+)
fs/cifs/dfs_cache.c +2 -0
@@ -118,6 +118,8 @@ static inline void free_tgts(struct cache_entry *ce)kfree (t->name);kfree (t); } + +WRITE_ONCE (ce->tgthint,NULL ); }static inline void flush_cache_ent (struct cache_entry *ce)
Signature · 1 line
2.53.0