Page MenuHomeFreeBSD

linux(4): Handle specific to Linux fstatat() error case
Needs ReviewPublic

Authored by dchagin on Jul 13 2023, 9:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 17, 9:50 PM
Unknown Object (File)
Nov 12 2025, 11:21 AM
Unknown Object (File)
Oct 21 2025, 2:46 PM
Unknown Object (File)
Oct 21 2025, 2:46 PM
Unknown Object (File)
Oct 21 2025, 2:37 AM
Unknown Object (File)
Oct 15 2025, 1:13 AM
Unknown Object (File)
Sep 23 2025, 11:33 PM
Unknown Object (File)
Sep 22 2025, 11:50 AM
Subscribers

Details

Reviewers
mjg
kib
Summary

Linux fstatat() returns ENOENT if pathname is an empty string and
AT_EMPTY_PATH was not specified in flags.

trivial fix, to get an opinon, is this needed for FreeBSD fstatat?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52614
Build 49505: arc lint + arc unit

Event Timeline

Are you doing second copyinstr() over the same user path? This introduces the race.

What is the current FreeBSD reaction to the condition?

In D41015#933552, @kib wrote:

Are you doing second copyinstr() over the same user path? This introduces the race.

yes, first in namei

What is the current FreeBSD reaction to the condition?

ENOTDIR as documented

In D41015#933552, @kib wrote:

Are you doing second copyinstr() over the same user path? This introduces the race.

yes, first in namei

What is the current FreeBSD reaction to the condition?

ENOTDIR as documented

Look at NIRES_EMPTYPATH. If the flag is set and ENOTDIR is returned, translate it to ENOENT.

I assume we want to keep the FreeBSD error?

i would say unless there is a good reason to deviate, the error returned should be compatible with linux

In D41015#933638, @mjg wrote:

i would say unless there is a good reason to deviate, the error returned should be compatible with linux

I don’t have a strong opinion, if we get a consensus, I’ll prepare the fix. Konstantin?