Bug 15624 - DH reconnect error handling can lead to stale sharemode entries
Summary: DH reconnect error handling can lead to stale sharemode entries
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.19.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-09 15:12 UTC by Ralph Böhme
Modified: 2024-10-04 07:57 UTC (History)
3 users (show)

See Also:


Attachments
Patches for v4-21-test (45.74 KB, text/plain)
2024-10-01 09:24 UTC, Stefan Metzmacher
metze: review? (slow)
gd: review+
Details
Patches for v4-20-test (45.69 KB, text/plain)
2024-10-01 09:54 UTC, Stefan Metzmacher
gd: review+
Details
Patches for v4-19-test (45.64 KB, text/plain)
2024-10-01 09:58 UTC, Stefan Metzmacher
gd: review+
Details
Patches for v4-20-test (45.66 KB, text/plain)
2024-10-02 13:48 UTC, Stefan Metzmacher
slow: review+
metze: review? (gd)
Details
Patches for v4-19-test (45.61 KB, text/plain)
2024-10-02 13:48 UTC, Stefan Metzmacher
slow: review+
metze: review? (gd)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2024-04-09 15:12:14 UTC
Currently in some error code paths in the DH reconnect code we leave stale sharemode entries around that can lead to all sorts of havoc.
Comment 1 Ralph Böhme 2024-04-09 15:14:59 UTC
Note, one way I've seen this happen is with a custom private VFS module stack that causes incorrect stat info in the cookie compared to the result from SMB_VFS_FSTAT() in the reconnect function.

Have patch, need bugnumber.
Comment 2 Samba QA Contact 2024-09-19 19:37:04 UTC
This bug was referenced in samba master:

d76edcd48437715c7541b5b1e6a56245c25f460b
5c57e840527432c4b1a7ec94894939022a9e9622
7add7dbf1aee13b4d9ab70d1a5312c8ff30d9e00
b45e78871aadca6ae33475bee890736838f44219
d8613d7ee23c4e990285a387eb9ac2eeefff9749
679e12aee2f0c283a6f9b9c6008c549a6ca9633e
90d776cb18395ed804f0ab4fd13ef571fc0ad827
692ed832dfff61ad1c9b646b5c8d6f85f25efb99
ef4ef04e7f83b1029446ff8b5fc5fdf4ab33edbd
14875448ca06a3a28800343a3a326f1a66bccec0
a91457f97c98fcec1ed062514c364271af1df669
2ff3b9bc0d254a63a913ff9084de3d794fee27d0
Comment 3 Stefan Metzmacher 2024-10-01 09:24:08 UTC
Created attachment 18452 [details]
Patches for v4-21-test
Comment 4 Stefan Metzmacher 2024-10-01 09:54:34 UTC
Created attachment 18453 [details]
Patches for v4-20-test
Comment 5 Stefan Metzmacher 2024-10-01 09:58:42 UTC
Created attachment 18454 [details]
Patches for v4-19-test
Comment 6 Guenther Deschner 2024-10-01 10:40:31 UTC
Comment on attachment 18452 [details]
Patches for v4-21-test

LGTM, RB+
Comment 7 Guenther Deschner 2024-10-01 10:40:45 UTC
Comment on attachment 18453 [details]
Patches for v4-20-test

LGTM, RB+
Comment 8 Guenther Deschner 2024-10-01 10:41:01 UTC
Comment on attachment 18454 [details]
Patches for v4-19-test

LGTM, RB+
Comment 9 Guenther Deschner 2024-10-01 10:41:42 UTC
Jule, please add to 4.19, 4.20 and 4.21, thanks!
Comment 10 Jule Anger 2024-10-02 08:09:51 UTC
Pushed to autobuild-v4-{21,20,19}-test.
Comment 11 Jule Anger 2024-10-02 09:08:12 UTC
4.19 and 4.20 don't compile, because lib/util/util_file.h does not exist.
Reassigning to Metze.
Comment 12 Samba QA Contact 2024-10-02 09:29:03 UTC
This bug was referenced in samba v4-21-test:

ae157ab2729087fa46282c004f7083a47f297ff5
1f6fc1ba3b5248dbb03ff6d7e42e2547496b52af
f4b1210f9586e186a42387ce648a7e03f23a5691
1d930df540414024351899a517de83c4260653be
62309ed59079ed86bfef3d116cfb76de54114727
41f1b054ca06d7c267a2d49c4850e9832059ddd6
acf50a3abfb25df17dc371082b7d28fe874f737a
bb7be26b5dc32b91ef2280af245e197c0f9deb3b
8fd281aff73d07e845995611662d88a48bfecf35
87ead9aec519afd82a070ea0efab36a14a7adb3e
923d52f90338937df72184fef2a813d9a96b8343
d42fa9251f948bc2b3a51a17dd69c9db98a72a45
Comment 13 Stefan Metzmacher 2024-10-02 13:48:13 UTC
Created attachment 18458 [details]
Patches for v4-20-test
Comment 14 Stefan Metzmacher 2024-10-02 13:48:53 UTC
Created attachment 18459 [details]
Patches for v4-19-test
Comment 15 Ralph Böhme 2024-10-02 13:52:33 UTC
Reassigning to Jule for inclusion of the fixed backports in 4.20 and 4.19.
Comment 16 Jule Anger 2024-10-02 14:28:48 UTC
Pushed to autobuild-v4-{20,19}-test.
Comment 17 Samba QA Contact 2024-10-02 15:38:03 UTC
This bug was referenced in samba v4-19-test:

796d026919f8374104f5050112220989a16a9321
b365e1068e47369751f7b626d9ffc429be6e2201
b5388c25b886b207e6a24e29c1495654c29d2de6
71568683ca70986296a7c8b06b755c380f2e1620
2c8dfff7d9e33dadf14df76bccb978cb955d4952
38242b55d93691a2b92225fa07fea27c85ee4e12
3e6d740bf3ef0acc92ae3a5c62d771368fa8725e
b0fb5a1d39a5c893f123fcbc33b44d0d35c0a04a
5f3f8835282cbb624d5a4ff6438e2345a4805eca
153f9027c9682f8860fe0c39bdc7659089d7c4a4
92d7e6c6339bfa686b9e63cdaa33db9013eff2a1
335ce71c63634c5eadb287b3ddf8ee283d1cc18b
Comment 18 Samba QA Contact 2024-10-02 15:57:04 UTC
This bug was referenced in samba v4-20-test:

a9cb9d32ae052e9185fb2ad7a1440ddb22a3cf62
78b677b43748c1d4f739f702bd256aff6b512349
b7fd8bdf0b1aed242e8fc67253e8bc8fc7c1aceb
57b194484cd73378c2fbdbdb5f5e07216f5be6a7
34e00dfc5f710b0c058f53583e6e592066c94d51
e261202e7d0e1f2cc6bbad9123a44da8ff99feb2
46ac92e15ecc666ff35b6ab72916c9a0662493ee
b4921859823a5929b8abbf7bd0e23af1268b5c4b
dc0f69fd13c61cb3b7162a2e92050fad653d05cf
4e419975cc35abb46ebbd70bc129e345b420efa3
e620d1a8713450ec27f0377627da05cb7d07eea3
630c870eef0b4cd559a9a727b154df4152d10e09
Comment 19 Jule Anger 2024-10-04 07:57:56 UTC
Closing out bug report.

Thanks!