OPENAT2_REGULAR flag support for openat2#965
Closed
vfsci-bot[bot] wants to merge 4 commits intovfs.base.cifrom
Closed
OPENAT2_REGULAR flag support for openat2#965vfsci-bot[bot] wants to merge 4 commits intovfs.base.cifrom
vfsci-bot[bot] wants to merge 4 commits intovfs.base.cifrom
Conversation
This flag indicates the path should be opened if it's a regular file. This is useful to write secure programs that want to avoid being tricked into opening device nodes with special semantics while thinking they operate on regular files. This is a requested feature from the uapi-group[1]. A corresponding error code EFTYPE has been introduced. For example, if openat2 is called on path /dev/null with OPENAT2_REGULAR in the flag param, it will return -EFTYPE. EFTYPE is already used in BSD systems like FreeBSD, macOS. When used in combination with O_CREAT, either the regular file is created, or if the path already exists, it is opened if it's a regular file. Otherwise, -EFTYPE is returned. When OPENAT2_REGULAR is combined with O_DIRECTORY, -EINVAL is returned as it doesn't make sense to open a path that is both a directory and a regular file. [1]: https://uapi-group.org/kernel-features/#ability-to-only-open-regular-files Signed-off-by: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Just a happy path test. Signed-off-by: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Following the convention in include/uapi/asm-generic/fcntl.h and other architecture specific arch/*/include/uapi/asm/fcntl.h files. Signed-off-by: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Following the convention in include/uapi/asm-generic/fcntl.h and other architecture specific arch/*/include/uapi/asm/fcntl.h files. Signed-off-by: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Author
|
This PR is older than 14 days. Closing automatically. If the series is still relevant, a new version will create a new PR. Automated by ml2pr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Series: https://patchwork.kernel.org/project/linux-fsdevel/list/?series=1074017
Submitter: Dorjoy Chowdhury
Version: 6
Patches: 4/4
Message-ID:
<20260328172314.45807-1-dorjoychy111@gmail.com>Base: vfs.base.ci
Lore: https://lore.kernel.org/linux-fsdevel/20260328172314.45807-1-dorjoychy111@gmail.com
Automated by ml2pr