Bug 11102 - Leases cause stat open with oplock type
Summary: Leases cause stat open with oplock type
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 critical (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 10077
  Show dependency treegraph
 
Reported: 2015-02-18 15:19 UTC by Ralph Böhme
Modified: 2015-02-22 19:35 UTC (History)
2 users (show)

See Also:


Attachments
stat open with oplock type (256.60 KB, text/plain)
2015-02-18 15:19 UTC, Ralph Böhme
no flags Details
git-am fix for master and 4.2.0 (6.16 KB, patch)
2015-02-18 19:54 UTC, Jeremy Allison
slow: review+
Details
git-am fix for 4.2.0 (6.87 KB, patch)
2015-02-19 22:29 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2015-02-18 15:19:13 UTC
Created attachment 10742 [details]
stat open with oplock type

Latest master will crash when leases are enabled whenever a Win 8.1 client does a right mouse click on a file and then chooses "Properties".

smbd explodes at

    file_find_dif: file wanbonjour_1.pdf file_id = fd01:87df5:0, gen = 194592634 oplock_type = 256 is a stat open with oplock type !

Attached is a level 10 log of a reproducer, beginning with the right click on the file.
Comment 1 Jeremy Allison 2015-02-18 17:17:21 UTC
Blocker for 4.2.0 I think.
Comment 2 Jeremy Allison 2015-02-18 17:29:51 UTC
Ralph, can you post a wireshark trace of a Win 8.1 client doing the same against a Win8.1 server please ? I want to check what Windows does in this case.
Comment 3 Ralph Böhme 2015-02-18 17:42:57 UTC
(In reply to Jeremy Allison from comment #2)
I don't have a Win8.1 server at hand atm, is a Win2012R2 ok?
Btw, you should be able to reproduce this easily.
Comment 4 Jeremy Allison 2015-02-18 17:48:38 UTC
Win2k12r2 should be fine. Also, I could reproduce this easily if I wasn't out at a conference with a laptop with only one Win7 VM available :-).
Comment 5 Jeremy Allison 2015-02-18 19:08:09 UTC
OK, I have a new stat open torture tester that shows existing stat opens with leases matter when breaking.

Should have a fix + new torture test shortly.
Comment 6 Jeremy Allison 2015-02-18 19:11:28 UTC
So it looks like it's only the paranoia check that needs fixing.
Comment 7 Jeremy Allison 2015-02-18 19:45:37 UTC
OK, I have reproduced the crash using my torture test, and have a fix that allows smbd to respond in the same way as Win7 (SMB2.1) server.

Will do a little more testing and then post for Ralph to test.
Comment 8 Jeremy Allison 2015-02-18 19:54:18 UTC
Created attachment 10743 [details]
git-am fix for master and 4.2.0

This fixes it for me and also adds a regression test (smb2.lease.statopen).
Comment 9 Jeremy Allison 2015-02-18 19:55:11 UTC
Comment on attachment 10743 [details]
git-am fix for master and 4.2.0

Ralph, can you confirm this fixes the problem for you and I'll submit it for master if you're happy.

Thanks,

Jeremy.
Comment 10 Ralph Böhme 2015-02-19 10:49:01 UTC
(In reply to Jeremy Allison from comment #9)
Fixes it for me too. Thanks!
Comment 11 Jeremy Allison 2015-02-19 22:29:01 UTC
Created attachment 10754 [details]
git-am fix for 4.2.0

Contains cherry-pick information - this is the fix that went into master that was positively reviewed by Ralph.
Comment 12 Jeremy Allison 2015-02-19 22:29:32 UTC
Re-assinging to Karolin for inclusion in 4.2.0.
Comment 13 Karolin Seeger 2015-02-22 13:17:30 UTC
Pushed to autobuild-v4-2-test.
Comment 14 Karolin Seeger 2015-02-22 19:35:04 UTC
Pushed to v4-2-test.
Closing out bug report.

Thanks!