Bug 14742 - Calling Windows info levels with SMB1trans2:setpathinfo with a POSIX connection on symlinks can crash smbd.
Summary: Calling Windows info levels with SMB1trans2:setpathinfo with a POSIX connecti...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.14.5
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-15 23:24 UTC by Jeremy Allison
Modified: 2021-10-05 13:19 UTC (History)
2 users (show)

See Also:


Attachments
git-am fix for 4.14.next. (10.93 KB, patch)
2021-06-16 17:49 UTC, Jeremy Allison
slow: review-
Details
git-am fix for 4.14.next. (10.98 KB, patch)
2021-06-16 18:27 UTC, Jeremy Allison
slow: review+
npower: review+
Details
git-am fix for 4.14.next. (11.75 KB, patch)
2021-08-17 16:18 UTC, Jeremy Allison
slow: review+
Details
git-am fix for 4.14.next. (2.02 KB, patch)
2021-08-20 15:46 UTC, Jeremy Allison
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2021-06-15 23:24:38 UTC

    
Comment 1 Jeremy Allison 2021-06-15 23:24:54 UTC
Have path, need bugnumber.
Comment 2 Samba QA Contact 2021-06-16 11:58:03 UTC
This bug was referenced in samba master:

ac10058d7f6b4605157f508189a448310f5f18da
263c95aee38c9198ad9a30c4d960d72f46b7c27a
Comment 3 Jeremy Allison 2021-06-16 17:49:37 UTC
Created attachment 16662 [details]
git-am fix for 4.14.next.
Comment 4 Jeremy Allison 2021-06-16 18:12:55 UTC
NB. I checked and POSIX-SYMLINK-SETPATHINFO run from master passes against 4.13, so this is something we only recently broke with the smb_fname->fsp changes I think (thank goodness).

So we only need this for 4.14.next.

Thanks Noel !
Comment 5 Ralph Böhme 2021-06-16 18:23:54 UTC
Comment on attachment 16662 [details]
git-am fix for 4.14.next.

Patch 1/2 is missing reviewed-by. Can we fix this at least for the backport?
Comment 6 Jeremy Allison 2021-06-16 18:27:07 UTC
Created attachment 16663 [details]
git-am fix for 4.14.next.

Updated with added RB. Sorry for missing that.
Comment 7 Ralph Böhme 2021-06-16 19:20:56 UTC
Reassigning to Karolin for inclusion in 4.14.
Comment 8 Karolin Seeger 2021-06-29 06:47:07 UTC
(In reply to Ralph Böhme from comment #7)
Pushed to autobuild-v4-14-test.
Comment 9 Karolin Seeger 2021-08-17 06:24:05 UTC
Hi Jeremy,

autobuild fails with:

UNEXPECTED(failure): samba3.smbtorture_s3.crypt.POSIX-SYMLINK-SETPATHINFO.smbtorture(nt4_dc_smb1)
REASON: Exception: Exception: using seed 1629117742
host=10.53.57.55 share=posix_share user=kseeger myname=lclnt4dc2smb1
Running POSIX-SYMLINK-SETPATHINFO
Starting POSIX-SYMLINK-SETPATHINFO test
cli_posix_open of file_setpath_real failed error NT_STATUS_ACCESS_DENIED
TEST POSIX-SYMLINK-SETPATHINFO FAILED!

Could you have a look, please?

Thanks!

Karolin
Comment 10 Ralph Böhme 2021-08-17 07:44:00 UTC
(In reply to Karolin Seeger from comment #9)
make -j test TESTS=POSIX-SYMLINK-SETPATHINFO works here.

Maybe autobuild was flaky? Can you please try it once again?
Comment 11 Ralph Böhme 2021-08-17 12:39:24 UTC
(In reply to Ralph Böhme from comment #10)
Karolin responded off-bugzilla that she tried three more times and it failed each of them.

I now also tried

$ script/autobuild.py --testbase=/m/$USER/WSEC --email-from=autobuild-hrx0@samba.org --email=$USER@samba.org --branch="private" --always-email --tail --keeplogs --verbose --restrict-tests=POSIX

on sn-sevel and it passed, so I'm at my whits end.

Jeremy, the test if failing right at the beginning when creating the testfile with cli_posix_open(). Go figure... :(
Comment 12 Jeremy Allison 2021-08-17 15:56:30 UTC
OK, let me try and modify the to create the file using standard mechanisms instead. Shouldn't make any difference, but if it gets the test to pass I won't worry about it :-).
Comment 13 Jeremy Allison 2021-08-17 16:18:02 UTC
Created attachment 16743 [details]
git-am fix for 4.14.next.

Can you try this version ? If nukes the test files using any possible methods then uses a cli_openx() to create the file. It shouldn't make any difference of course, as the original code should have been perfectly fine. But if it allows autobuild to pass I'm not going to worry about it :-).
Comment 14 Jeremy Allison 2021-08-17 16:19:03 UTC
Comment on attachment 16743 [details]
git-am fix for 4.14.next.

Works here in local testing of course.
Comment 15 Karolin Seeger 2021-08-19 11:16:47 UTC
(In reply to Jeremy Allison from comment #14)
Pushed to autobuild-v4-14-test.
Thanks for investigating!
Comment 16 Karolin Seeger 2021-08-20 07:03:26 UTC
(In reply to Jeremy Allison from comment #14)

Failing again with:

UNEXPECTED(failure): samba3.smbtorture_s3.crypt.POSIX-SYMLINK-SETPATHINFO.smbtorture(nt4_dc_smb1)
REASON: Exception: Exception: using seed 1629373298
host=10.53.57.55 share=posix_share user=kseeger myname=lclnt4dc2smb1
Running POSIX-SYMLINK-SETPATHINFO
Starting POSIX-SYMLINK-SETPATHINFO test
cli_openx of file_setpath_real failed (NT_STATUS_ACCESS_DENIED)
TEST POSIX-SYMLINK-SETPATHINFO FAILED!
Comment 17 Ralph Böhme 2021-08-20 07:15:22 UTC
(In reply to Karolin Seeger from comment #16)
Drat! I was kind of expecting this. :/ Jeremy, maybe we just remove the test from the backport? I really don't have any idea what could be causing this.
Comment 18 Jeremy Allison 2021-08-20 15:44:24 UTC
I'm sorry Karolin, I just don't know what is going on. I'll remove the test from the backport and resubmit.
Comment 19 Jeremy Allison 2021-08-20 15:46:13 UTC
Created attachment 16747 [details]
git-am fix for 4.14.next.

Fix only, test removed. Sorry for the trouble.
Comment 20 Ralph Böhme 2021-08-20 15:55:38 UTC
Reassigning to Karolin for inclusion in 4.14.
Comment 21 Karolin Seeger 2021-08-23 06:22:04 UTC
(In reply to Jeremy Allison from comment #19)
Pushed to autobuild-v4-14-test.
Thanks for investigating!
Comment 22 Samba QA Contact 2021-08-27 08:15:04 UTC
This bug was referenced in samba v4-14-test:

a7d66e00fa811512b0b44288474271453b914f21
Comment 23 Karolin Seeger 2021-08-27 08:37:10 UTC
Pushed to v4-14-test.
Closing out bug report.

Thanks!
Comment 24 Samba QA Contact 2021-10-05 13:19:21 UTC
This bug was referenced in samba v4-14-stable (Release samba-4.14.8):

a7d66e00fa811512b0b44288474271453b914f21