The number of stat calls caused by a single CREATE request
Anoop C S
anoopcs at autistici.org
Fri Jul 28 07:00:18 UTC 2017
On Thu, 2017-07-27 at 17:37 -0700, Richard Sharpe via samba-technical wrote:
> Hi folks,
> I have been looking at the performance of CREATE and am seeing as many
> as 15 stat-like requests for a single create.
> Now, some of those are the result of our VFS module trying to get
> CREATE TIME, but I have the stack-trace info for 11 of them and it is
> not pretty:
> 1. Four of them result from calls to smbd_check_access_rights (a
> couple it seems are for calculating the MxAc Extra Create Parameter.)
> 2. Two of them at least result from vfs_GetWd
> 3. The majority of them are for "." while two are for the actual path
> that is ".".
Can it be somehow related to the series of patches that went in for fixing CVE-2017-2619? Yes,
vfs_GetWd() results in stat call and introduction of non_widelink_open() and process_symlink_open()
via those CVE fixes adds to the number of invocations of vfs_GetWd(). Moreover open_dir_safely() now
does an extra check using check_name() on "."
Please correct me if I am wrong.
> It is amazing to me that we do not use VALID_STAT to handle that, and
> I have a VALID_STAT use in the VFS module but it seems Samba is
> creating fresh struct smb_filenames all over the place for ".".
More information about the samba-technical