-
-
Notifications
You must be signed in to change notification settings - Fork 168
fix(syscall): 修复一些系统调用 #1622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(syscall): 修复一些系统调用 #1622
Conversation
|
bugbot run |
|
|
||
| if how.o_flags.contains(FileFlags::O_NOFOLLOW) && file_type == FileType::SymLink { | ||
| return Err(SystemError::ELOOP); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O_NOFOLLOW check ignores O_PATH flag combination
Medium Severity
When O_PATH | O_NOFOLLOW are both set, Linux semantics dictate that open() should succeed and return an O_PATH file descriptor referencing the symbolic link itself. However, the new check unconditionally returns ELOOP when O_NOFOLLOW is set and the target is a symlink, breaking this valid use case. The check needs to exclude the case where O_PATH is also present in o_flags.
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3284ad11b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
kernel/src/filesystem/vfs/open.rs
Outdated
| if how.o_flags.contains(FileFlags::O_NOFOLLOW) && file_type == FileType::SymLink { | ||
| return Err(SystemError::ELOOP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow O_PATH|O_NOFOLLOW to open symlinks
The new unconditional O_NOFOLLOW && symlink => ELOOP check blocks openat calls that intentionally use O_PATH|O_NOFOLLOW to obtain a file descriptor for the symlink itself (Linux allows this and it is the standard way to later fstatat(AT_EMPTY_PATH|AT_SYMLINK_NOFOLLOW) the link). With this change, such calls now fail even though the caller explicitly requested a path-only FD, which breaks symlink-introspection use cases while not required to satisfy the OpenNoFollowSymlink test for non-O_PATH opens.
Useful? React with 👍 / 👎.
feat(time): 增加系统启动时间和运行时间的计算 fix(process): 添加获取当前进程数量的函数
|
bugbot run |
|
Skipping Bugbot: Unable to authenticate your request. Please make sure Bugbot is properly installed and configured for this repository. |
Uh oh!
There was an error while loading. Please reload this page.