Repository navigation
Conversation
…_CREAT|O_EXCL|O_DIRECTORY FreeBSD rejects an access mode of 3 in kern_openat and the combination of O_CREAT, O_EXCL and O_DIRECTORY in vn_open_cred before it looks the path up. sceKernelOpen, open and openat threw std::invalid_argument for access mode 3 and, on Windows, created the file for the second combination. (cherry picked from commit 038a070)
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Tested on Linux, since the description says only Windows was built and run.
|
|
Thanks for the Linux run and reverted-source negative control. I updated the validation section to include your exact scope and the unrelated uutils |
jotitadev
left a comment
There was a problem hiding this comment.
Built and ran this on Linux, since the PR has no local run. Head fd407e34a0ea380e6aee225e8975080fef86e120 merged on main 452494439. Intel i7-8700, Ubuntu 26.04 (kernel 7.0), GCC 15.2, CMake 4.2.3, Ninja, Release, BUILD_TESTING=ON, full build.
guest_filesystemandguest_kernel_syspass, 3 of 3 runs.- With
main'sOpen.cppand the PR's tests, both abort at the first access-mode-3 check:sceKernelOpen: invalid access mode(std::invalid_argument). - The
O_CREAT | O_EXCL | O_DIRECTORYchecks already pass onmainon this host. I removed only the access-mode-3 assertions and keptmain'sOpen.cpp: both tests pass, and noinvalid-flags.txtis created. The hostopen()already rejects that combination withEINVALon this kernel (7.0). So on this host these checks would not catch a regression; they still matter for hosts whoseopen()accepts it. The access-mode half does fail without the fix. - Non-GPU suite (
ctest -E "^agc|gpu|vulkan|video_out" -j6): 648/650 both with this PR and onmain. The two failures,file_writer_binaryandfile_writer_text, also fail onmainon this machine.
Not checked: Windows, macOS.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Thanks for running the tests on current Linux and separating the host-dependent checks. The access-mode-3 negative control confirms that part detects the regression on this host; I have noted that the create/exclusive/directory case is already rejected by this kernel and therefore is not independently demonstrated by that control. The two non-GPU suite failures reproduce on main. |
|
Thanks for the Linux cross-checks. The access-mode regression is reproduced with |
|
The conventions failure on the current head is only the required |
What
Reject two invalid flag combinations in the libkernel open entry points before path lookup: access mode 3 and the O_CREAT | O_EXCL | O_DIRECTORY combination. They return EINVAL (or the corresponding SCE error) instead of throwing or creating a regular file. Adds regression coverage for sceKernelOpen, open, _open, and openat.
This PR carries Hussein Kadhim’s existing commit from issue #6855. The commit author is preserved; the Windows tests, fuzz probes, and independent reviews described in the issue are Hussein’s reported results, not runs by me.
Tested
guest_filesystem,guest_kernel_sys,file_streams,guest_dup,guest_kernel_fcntl,guest_posix_filesystem, andguest_truncatepass; revertingOpen.cppmakes the two new test executables abort as expected. Two unrelatedfile_writer_*failures also occur on main with Ubuntu’s uutilscp.python3 tools/check_conventions.py --base upstream/mainpassed on the current-main cherry-pick.git diff --check upstream/main...HEADpassed.Related open PRs
Manual overlap review of the intake report: #5831 changes Windows append-write handling in
Open.cpp; #5835 adds archive-aware path handling toOpen.cpp; #6044 reorganizes test registration and shares test paths. These changes do not implement the invalid-flag behavior. When integrating with #5835, retain the early invalid-flag check and its archive-aware path resolution.Checklist