Skip to content

smb: client: fix dangling pointer in DFS target hints

Fredric Cover linux-cifs lkml stable 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesIn review
  2. v22 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Resent series with proper thread structure and subject headers.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2smb: client: harden DFS cache against invalid target hintsfs/smb/client/dfs_cache.c+24 -70 replies
2/2smb: client: clear ce->tgthint in free_tgts()fs/smb/client/dfs_cache.c+2 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChenXiaoSong
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] smb: client: fix dangling pointer in DFS target hints

This series addresses a Use-After-Free bug where ce->tgthint was left pointing to freed memory after free_tgts() was called.

To fix this, Patch 1 hardens the DFS cache readers against ce->tgthint being NULL. Also, Patch 1 hardens callers of get_tgt_name(), which returns an error pointer when ce->tgthint is NULL.

Patch 2 clears ce->tgthint in free_tgts(), eliminating the dangling pointer.

v2 -> v3:
- Resent series with proper thread structure and subject headers.

v1 -> v2:
- Addressed automated review by Sashiko:
https://sashiko.dev/#/patchset/20260724023539.1596955-1-fredric.cover.lkernel%40gmail.com
- Split into a 2-patch series to harden readers against NULL and ERR_PTR target hints.

Fredric Cover (2):
smb: client: harden DFS cache against invalid target hints
smb: client: clear ce->tgthint in free_tgts()

 fs/smb/client/dfs_cache.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)
Signature · 1 line
2.53.0