All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.6.y 0/1] ksmbd: validate owner of durable handle on reconnect
@ 2026-05-22 11:38 Alva Lan
  2026-05-22 11:39 ` [PATCH 6.6.y 1/1] " Alva Lan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alva Lan @ 2026-05-22 11:38 UTC (permalink / raw)
  To: gregkh, sashal, stable
  Cc: linux-kernel, linkinjeon, stfrench, d.ornaghi97, knavaneeth786,
	Alva Lan

Hi,

This patch backports upstream commit 49110a8ce654 ("ksmbd: validate owner
of durable handle on reconnect") to the 6.6.y stable branch to address
CVE-2026-31717.

The vulnerability allows any authenticated user to hijack an orphaned
durable file handle by predicting or brute-forcing the persistent ID.

The fix adds owner identity (UID, GID, account name) tracking to durable
handles and validates it during SMB2_CREATE (DHnC) reconnect, per the
MS-SMB2 specification.

An additional adaptation was needed for 6.6.y: in ksmbd_free_global_file_table(),
the call to ksmbd_destroy_file_table(&global_ft) was replaced with
idr_destroy/kfree, since the function changed to take a
struct ksmbd_session *. This matches the approach in upstream commit
d484d621d40f ("ksmbd: add durable scavenger timer").

Testing:
- Build tested: compiled cleanly on x86_64 with CONFIG_SMB_SERVER=y
- Boot tested: kernel 6.6.140 boots and ksmbd serves shares normally
- Functional test: verified using a Python SMB2 test client that:
  1. Legitimate owner (user_a) can reconnect to own durable handle (PASS)
  2. Different user (user_b) is rejected when attempting DHnC reconnect
     with user_a's persistent file ID (PASS - STATUS_OBJECT_NAME_NOT_FOUND)
- Regression test: normal SMB operations (upload, download, delete, mkdir)
  work correctly for both users

Thanks,
Alva Lan

Namjae Jeon (1):
  ksmbd: validate owner of durable handle on reconnect

 fs/smb/server/mgmt/user_session.c |  8 +--
 fs/smb/server/oplock.c            |  7 +++
 fs/smb/server/oplock.h            |  1 +
 fs/smb/server/smb2pdu.c           |  3 +-
 fs/smb/server/vfs_cache.c         | 90 +++++++++++++++++++++++++++----
 fs/smb/server/vfs_cache.h         | 12 ++++-
 6 files changed, 105 insertions(+), 16 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-25 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 11:38 [PATCH 6.6.y 0/1] ksmbd: validate owner of durable handle on reconnect Alva Lan
2026-05-22 11:39 ` [PATCH 6.6.y 1/1] " Alva Lan
2026-05-24 12:09 ` [PATCH 6.6.y 0/1] " Sasha Levin
2026-05-24 15:13 ` Namjae Jeon
2026-05-25 11:17   ` Alva Lan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.