Bug 15375 - Symlinks to files can have random DOS mode information in a directory listing
Summary: Symlinks to files can have random DOS mode information in a directory listing
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 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-24 12:22 UTC by Ralph Böhme
Modified: 2023-05-31 16:11 UTC (History)
1 user (show)

See Also:


Attachments
Patch for 4.18 cherry-picked from master (6.37 KB, patch)
2023-05-26 13:43 UTC, Ralph Böhme
no flags Details
Patch for 4.18 cherry-picked from master (6.57 KB, patch)
2023-05-26 13:46 UTC, Ralph Böhme
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2023-05-24 12:22:44 UTC
bin/smbclient -U 'slow%x' //localhost/share -c "ls 1/2/3/*"
  .                                   D        0  Wed May 24 13:03:33 2023
  ..                                  D        0  Tue May 23 10:41:25 2023
  link1                           VRdtr        5  Tue May 23 10:49:26 2023

This happens because in vfswrap_readdir() we don't zero initialize the SMB_STRUCT_STAT variable. The detailed steps leading up to using the uninitialized variable is a bit more "von Hinten durch die Brust ins Auge", gimme a call if you want to learn the details. :)

Have patch, need bugnumber...
Comment 1 Samba QA Contact 2023-05-24 21:43:03 UTC
This bug was referenced in samba master:

b4af281b2d7bfddbdb7289dadbed9db623bf0e84
0391120079b032077c3914c10189b85e61dc8498
412373984db6d0c20ba38076d06d0a87631890d0
Comment 2 Ralph Böhme 2023-05-26 13:43:21 UTC
Created attachment 17896 [details]
Patch for 4.18 cherry-picked from master
Comment 3 Ralph Böhme 2023-05-26 13:46:29 UTC
Created attachment 17897 [details]
Patch for 4.18 cherry-picked from master
Comment 4 Jeremy Allison 2023-05-26 17:13:01 UTC
Re-assigning to Jule for inclusion in 4.18.next.
Comment 5 Jule Anger 2023-05-31 07:49:24 UTC
Pushed to autobuild-v4-18-test.
Comment 6 Samba QA Contact 2023-05-31 10:48:03 UTC
This bug was referenced in samba v4-18-test:

5865388ede8b5d3d3b389be49261574dde7008d7
09ea170e3b4a5c962e29b86d1eadf06a430bc9a6
af9dc206043809a706063019112a191e81456ed7
Comment 7 Jule Anger 2023-05-31 16:11:09 UTC
Closing out bug report.

Thanks!
Comment 8 Samba QA Contact 2023-05-31 16:11:25 UTC
This bug was referenced in samba v4-18-stable (Release samba-4.18.3):

5865388ede8b5d3d3b389be49261574dde7008d7
09ea170e3b4a5c962e29b86d1eadf06a430bc9a6
af9dc206043809a706063019112a191e81456ed7