Bug 14662 - smbd: regression in mkdir_internal can cause incorrect error to be returned
Summary: smbd: regression in mkdir_internal can cause incorrect error to be returned
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.14.0rc4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-10 11:16 UTC by Sachin Prabhu
Modified: 2021-04-20 10:10 UTC (History)
4 users (show)

See Also:


Attachments
git-am fix for 4.14.next. (1.45 KB, patch)
2021-03-10 23:56 UTC, Jeremy Allison
jra: review? (abartlet)
jra: review? (slow)
anoopcs: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sachin Prabhu 2021-03-10 11:16:52 UTC
This bz is being created for a patch I requested for merge at
https://gitlab.com/samba-team/samba/-/merge_requests/1826

Copying over the summary:

Commit - 405d1164 smbd: open a pathref fsp on the parent directory

adds a TALLOC_FREE() call which clears out the errno required by the subsequent map_nt_error_from_unix() call. The errno is possibly cleared by a destructor called by the TALLOC_FREE(). This results in an incorrect nt_status being returned.

This is causing failures in smb2.create.mkdir-dup with glusterfs as the backing fs.

Fix this by calling map_nt_error_from_unix(errno) before the TALLOC_FREE() call is made.

I have tested this patch using smbtorture smb2.create.mkdir-dup test with glusterfs as the backend filesystem for both replicate and disperse volumes.
Comment 1 Jeremy Allison 2021-03-10 23:56:10 UTC
Created attachment 16521 [details]
git-am fix for 4.14.next.

Cherry-pick from master. Needed for 4.14.next.
Comment 2 Jeremy Allison 2021-03-11 17:23:47 UTC
Re-assigning to Karolin for inclusion in 4.14.next.
Comment 3 Karolin Seeger 2021-03-31 09:05:03 UTC
Pushed to autobuild-v4-14-test.
Comment 4 Samba QA Contact 2021-03-31 11:11:53 UTC
This bug was referenced in samba v4-14-test:

6b8226b7355ca7c290d859e5cdbac7d72b24a3c1
Comment 5 Karolin Seeger 2021-04-01 10:22:25 UTC
Closing out bug report.

Thanks!
Comment 6 Samba QA Contact 2021-04-20 10:10:48 UTC
This bug was referenced in samba v4-14-stable (Release samba-4.14.3):

6b8226b7355ca7c290d859e5cdbac7d72b24a3c1