Bug 12969 - Disconnected durable handles with handle lease
Summary: Disconnected durable handles with handle lease
Status: ASSIGNED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Ralph Böhme
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-16 05:43 UTC by Ralph Böhme
Modified: 2023-12-06 16:30 UTC (History)
1 user (show)

See Also:


Attachments
Reproducer (6.92 KB, patch)
2017-08-16 05:43 UTC, Ralph Böhme
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2017-08-16 05:43:05 UTC
Created attachment 13476 [details]
Reproducer

Disconnected durable handles must be preserved in case of a lease break when the "breaking-to" lease state contains SMB2_LEASE_HANDLE_CACHING (MS-SMB2 3.3.4.7 Object Store Indicates a Lease Break).

Attached WIP test verifies this against Windows server 2016. Samba fails the same test, because in share_mode_stale_pid() we ignore share-mode entries of disconnected opens and mark them for removal.

Samba master fails right away:

$ ./bin/smbtorture -U USER //localhost/share smb2.durable-open
...
test 1: Hold RH, requesting R, expecting break to RH and grant of R
failure: reconnect-contended-lease [
../source4/torture/smb2/durable_open.c:2890: status was NT_STATUS_OBJECT_NAME_NOT_FOUND, expected NT_STATUS_OK: smb2_create failed
]

The same test passes against Windows:

$ ./bin/smbtorture -U Administrator //10.10.11.14/share smb2.durable-open
....
test 1: Hold RH, requesting R, expecting break to RH and grant of R
test 2: Hold RH, requesting RH, expecting break to RH and grant of RH
test 3: Hold RH, requesting RW, expecting break to RH and grant of R
...

Working on a fix as part of my persistent handles research.