fix(libkernel): fail a malformed ioctl request with ENOTTY #7956

Merged
Lindamea1 merged 2 commits from upstream-pr/7956 into main 2026-10-20 04:49:59 +00:00
Lindamea1 commented 2026-10-19 16:05:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lindamea1 on 2026-10-19T16:05:59Z.


What

On main, ioctl and _ioctl throw when a file, pipe or character device gets a request word that FreeBSD's sys_ioctl rejects as malformed, unless the word is in the termios group t (such a word already fails there with ENOTTY); a closed descriptor fails with EBADF instead of ENOTTY, and a guest socket given a null argument with EFAULT. The OpenOrbis PS4 toolchain's net_http sample stops there: its musl sends the Linux TIOCGWINSZ (0x5413, no direction bit) to standard output on the first printf, and the run ends with

ioctl: request 0x00005413 on a file is not implemented, fd=1

@Get-fix reported this on Windows 11 in #5564; with #5569 the sample ran its whole flow. #3093 tracks it as [ ] Linux terminal ioctl 0x5413 (#5564, #5569), and its later updates (1, 2) count a change that answers the Linux TIOCGWINSZ with ENOTTY among the changes that let 14, then 15, of the 16 samples start on Windows. The other changes listed there (#5990 to #5994, #6376, #5138) are merged, and Get-fix's open #6519, #6520 and #6521 were tested with such a change too. On Linux, main's libkernel.prx throws the same line for ioctl(1, 0x5413, buffer) when standard output is redirected to a file (probe under Tested).

This carries @husseinkad's commit from #5569 (opened by @MarcZX10), with his authorship kept (git cherry-pick -x 3eb7edd9cf). #5569 was closed with "Closing: no title is known to reach this. [...] If a title stops on this on current main, reopen with the title ID and the log line." The log line is above; I can't reopen #5569, so this is a new pull request. Its two conflicts with current main are resolved without changing its code: the test keeps main's CloseOnExecRequest and KeepOnExecRequest next to MalformedRequests, and the debt entry keeps main's FIOCLEX wording with the commit's sentence added.

Reference: FreeBSD 11.4 sys_ioctl truncates the request to 32 bits and returns ENOTTY if it has none of IOC_VOID, IOC_IN and IOC_OUT, if it has IOC_OUT and length 0, or if it has IOC_VOID and a length that is neither 0 nor sizeof(int) (encoding). That comes before the argument's copyin and before kern_ioctl looks up the descriptor, so it wins over EFAULT and EBADF. The IOC_OUT test is the branch built with any of COMPAT_FREEBSD4, COMPAT_FREEBSD5 and COMPAT_43, and amd64 GENERIC has the first two; without them, IOC_IN with length 0 fails as well.

  • File::IoctlRequestMalformed applies those three tests. File::Ioctl checks it first, and ioctl_nid_postfix checks it for a guest socket before the lookup and the null-argument EFAULT, so every descriptor kind, a closed one included, fails with ENOTTY.
  • Well-formed requests take the same path as before.
  • My commit adds 0x5413 to the test's malformed words and pins the two boundary words the check takes as well-formed: 0x20046601 (IOC_VOID, length 4) and 0x80006601 (IOC_IN, length 0) given to a guest socket with a null argument fail with EFAULT, not ENOTTY. It also rewrites the carried debt sentence as the open gap: an input request with length 0 is not rejected as malformed, and which of the COMPAT options the PS5 kernel has is unknown.

Differences from the reference: an IOC_IN request with length 0 is still treated as well-formed, as in a kernel with those COMPAT options; whether the PS5 kernel has them is unknown, as docs/dev/debt/libkernel.md records. Not measured on a console.

Tested

  • Gentoo Linux, kernel 7.2.8, GCC 16.2.1, glibc 2.43, CMake 4.3.4, Ninja 1.13.2; Release build with BUILD_TESTING=ON on upstream main 43a2abaf7.
  • guest_kernel_fcntl (core/libs/tests/GuestKernelFcntl.cpp) sends 0, 123, 0x5401, 0x5413, 0x40007468, 0x20087468 and 0x00087468, each with a buffer and with a null argument, to an open UDP socket, an open file, the same file after close, descriptor -1 and a pipe, and requires -1 with ENOTTY. It also sends 0x20046601 and 0x80006601 with a null argument to the socket and requires -1 with EFAULT. Its existing checks of FIOCLEX, FIONCLEX, FIONBIO, FIONREAD, the BSD TIOCGWINSZ (ENOTTY) and FIOASYNC (throws) are unchanged. It passed 3 runs in a row.
  • Negative control, with this branch's test: with DescriptorControl.cpp, DescriptorControl.hpp and Udp.cpp from main, guest_kernel_fcntl aborts at its first null-argument call on the socket, ioctl(socket, 0, nullptr), which fails with EFAULT (guest errno 14 at the abort, under gdb). With only Udp.cpp from main it aborts at the same call. With all three from main, a scratch copy of the test that runs one section per process shows the file and pipe sections ending with terminate called after throwing an instance of 'std::runtime_error' and what(): ioctl: request 0x00000000 on a file is not implemented, fd=5 (on a pipe for the pipe). DescriptorControl.hpp or DescriptorControl.cpp alone from main does not build, since Udp.cpp then calls an undeclared or undefined function. The 0x20046601 and 0x80006601 checks on the socket have no negative control, since they pass on main too: run alone in the same scratch copy with all three files from main, they pass.
  • A probe linked against the built libkernel.prx, with standard input from /dev/null (a character device): on main, ioctl(1, 0x5413, buffer) with standard output redirected to a file throws ioctl: request 0x00005413 on a file is not implemented, fd=1; 0x5413, 0x5401 and 0 throw on a file, a pipe and the character device, while 0x40007468, 0x20087468 and 0x00087468 (group t) fail there with ENOTTY; descriptor 4000 fails with EBADF, and a UDP socket with a null argument fails with EFAULT. With this change all of these, _ioctl, and 0x5413 with the upper 32 bits set fail with ENOTTY, while 0x20046601 (void, length 4) and 0x80006601 (in, length 0) still throw on a file, as FIOASYNC with a buffer does, and on a socket with a null argument they and FIONREAD fail with EFAULT, as on main.
  • tools/select_tests.py picked 1349 of 1638 tests for this diff: 1334 passed, 0 failed, 15 skipped (the 13 video_out_flip_* tests and video_out_frame_dump_queue report no display or Vulkan device, as SDL's offscreen driver has no Vulkan here; agc_driver_stencil_ref_export reports that the device lacks VK_EXT_shader_stencil_export). guest_udp, guest_sendfile and guest_sce_net are among the passed.
  • x86_64-w64-mingw32-g++ 16.2.0 -fsyntax-only -Wall -Wextra on the three changed .cpp files: no errors or warnings, as for their main versions. This is a syntax check, not a Windows build or run.
  • tools/check_compile.py --base upstream/main: 3 translation units compile.
  • tools/check_conventions.py --base upstream/main with this title and body: 0 errors, 1 warning (debt-length on the ioctl entry, 1649 characters; it is 1297 on main, already over the 1000 the warning allows).
  • tools/pr_overlap.py --branch lists #7437 (socket fcntl duplication), which changes neighbouring lines of GuestKernelFcntl.cpp and the next debt entry; it implements other commands, so whichever of the two is merged second needs only a textual rebase. It could not compare the open PRs that conflict with main; merged with this branch, #5021, #6977 and #7201 conflict in the same files as they do with main, and #7332 merges cleanly.
  • Not run on Windows, macOS or a console.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: OpenOrbis PS4 toolchain sample net_http, #3093
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4923826531 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7956). Originally posted by [Lindamea1](https://github.com/Lindamea1) on 2026-10-19T16:05:59Z. --- ### What On `main`, `ioctl` and `_ioctl` throw when a file, pipe or character device gets a request word that FreeBSD's `sys_ioctl` rejects as malformed, unless the word is in the termios group `t` (such a word already fails there with `ENOTTY`); a closed descriptor fails with `EBADF` instead of `ENOTTY`, and a guest socket given a null argument with `EFAULT`. The OpenOrbis PS4 toolchain's `net_http` sample stops there: its musl sends the Linux `TIOCGWINSZ` (0x5413, no direction bit) to standard output on the first `printf`, and the run ends with ``` ioctl: request 0x00005413 on a file is not implemented, fd=1 ``` @Get-fix reported this on Windows 11 in [#5564](https://github.com/boykopovar/AnyPS5/issues/5564#issuecomment-6175617921); with #5569 the sample ran its whole flow. [#3093](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6175615457) tracks it as `[ ] Linux terminal ioctl 0x5413 (#5564, #5569)`, and its later updates ([1](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6193457139), [2](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6199513813)) count a change that answers the Linux `TIOCGWINSZ` with `ENOTTY` among the changes that let 14, then 15, of the 16 samples start on Windows. The other changes listed there (#5990 to #5994, #6376, #5138) are merged, and Get-fix's open #6519, #6520 and #6521 were tested with such a change too. On Linux, `main`'s `libkernel.prx` throws the same line for `ioctl(1, 0x5413, buffer)` when standard output is redirected to a file (probe under Tested). This carries @husseinkad's commit from #5569 (opened by @MarcZX10), with his authorship kept (`git cherry-pick -x 3eb7edd9cf`). #5569 was [closed](https://github.com/boykopovar/AnyPS5/pull/5569#issuecomment-6158591662) with "Closing: no title is known to reach this. [...] If a title stops on this on current main, reopen with the title ID and the log line." The log line is above; I can't reopen #5569, so this is a new pull request. Its two conflicts with current `main` are resolved without changing its code: the test keeps `main`'s `CloseOnExecRequest` and `KeepOnExecRequest` next to `MalformedRequests`, and the debt entry keeps `main`'s `FIOCLEX` wording with the commit's sentence added. Reference: FreeBSD 11.4 [`sys_ioctl`](https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/kern/sys_generic.c#L703-L718) truncates the request to 32 bits and returns `ENOTTY` if it has none of `IOC_VOID`, `IOC_IN` and `IOC_OUT`, if it has `IOC_OUT` and length 0, or if it has `IOC_VOID` and a length that is neither 0 nor `sizeof(int)` ([encoding](https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/sys/ioccom.h#L41-L52)). That comes before the argument's [`copyin`](https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/kern/sys_generic.c#L734-L737) and before [`kern_ioctl`](https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/kern/sys_generic.c#L788-L812) looks up the descriptor, so it wins over `EFAULT` and `EBADF`. The `IOC_OUT` test is the branch built with any of `COMPAT_FREEBSD4`, `COMPAT_FREEBSD5` and `COMPAT_43`, and amd64 [`GENERIC`](https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/amd64/conf/GENERIC#L54-L55) has the first two; without them, `IOC_IN` with length 0 fails as well. - `File::IoctlRequestMalformed` applies those three tests. `File::Ioctl` checks it first, and `ioctl_nid_postfix` checks it for a guest socket before the lookup and the null-argument `EFAULT`, so every descriptor kind, a closed one included, fails with `ENOTTY`. - Well-formed requests take the same path as before. - My commit adds 0x5413 to the test's malformed words and pins the two boundary words the check takes as well-formed: 0x20046601 (`IOC_VOID`, length 4) and 0x80006601 (`IOC_IN`, length 0) given to a guest socket with a null argument fail with `EFAULT`, not `ENOTTY`. It also rewrites the carried debt sentence as the open gap: an input request with length 0 is not rejected as malformed, and which of the COMPAT options the PS5 kernel has is unknown. Differences from the reference: an `IOC_IN` request with length 0 is still treated as well-formed, as in a kernel with those COMPAT options; whether the PS5 kernel has them is unknown, as `docs/dev/debt/libkernel.md` records. Not measured on a console. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Gentoo Linux, kernel 7.2.8, GCC 16.2.1, glibc 2.43, CMake 4.3.4, Ninja 1.13.2; Release build with `BUILD_TESTING=ON` on upstream `main` `43a2abaf7`. - `guest_kernel_fcntl` (`core/libs/tests/GuestKernelFcntl.cpp`) sends 0, 123, 0x5401, 0x5413, 0x40007468, 0x20087468 and 0x00087468, each with a buffer and with a null argument, to an open UDP socket, an open file, the same file after `close`, descriptor -1 and a pipe, and requires -1 with `ENOTTY`. It also sends 0x20046601 and 0x80006601 with a null argument to the socket and requires -1 with `EFAULT`. Its existing checks of `FIOCLEX`, `FIONCLEX`, `FIONBIO`, `FIONREAD`, the BSD `TIOCGWINSZ` (`ENOTTY`) and `FIOASYNC` (throws) are unchanged. It passed 3 runs in a row. - Negative control, with this branch's test: with `DescriptorControl.cpp`, `DescriptorControl.hpp` and `Udp.cpp` from `main`, `guest_kernel_fcntl` aborts at its first null-argument call on the socket, `ioctl(socket, 0, nullptr)`, which fails with `EFAULT` (guest errno 14 at the abort, under gdb). With only `Udp.cpp` from `main` it aborts at the same call. With all three from `main`, a scratch copy of the test that runs one section per process shows the file and pipe sections ending with `terminate called after throwing an instance of 'std::runtime_error'` and `what(): ioctl: request 0x00000000 on a file is not implemented, fd=5` (`on a pipe` for the pipe). `DescriptorControl.hpp` or `DescriptorControl.cpp` alone from `main` does not build, since `Udp.cpp` then calls an undeclared or undefined function. The 0x20046601 and 0x80006601 checks on the socket have no negative control, since they pass on `main` too: run alone in the same scratch copy with all three files from `main`, they pass. - A probe linked against the built `libkernel.prx`, with standard input from `/dev/null` (a character device): on `main`, `ioctl(1, 0x5413, buffer)` with standard output redirected to a file throws `ioctl: request 0x00005413 on a file is not implemented, fd=1`; 0x5413, 0x5401 and 0 throw on a file, a pipe and the character device, while 0x40007468, 0x20087468 and 0x00087468 (group `t`) fail there with `ENOTTY`; descriptor 4000 fails with `EBADF`, and a UDP socket with a null argument fails with `EFAULT`. With this change all of these, `_ioctl`, and 0x5413 with the upper 32 bits set fail with `ENOTTY`, while 0x20046601 (void, length 4) and 0x80006601 (in, length 0) still throw on a file, as `FIOASYNC` with a buffer does, and on a socket with a null argument they and `FIONREAD` fail with `EFAULT`, as on `main`. - `tools/select_tests.py` picked 1349 of 1638 tests for this diff: 1334 passed, 0 failed, 15 skipped (the 13 `video_out_flip_*` tests and `video_out_frame_dump_queue` report `no display or Vulkan device`, as SDL's offscreen driver has no Vulkan here; `agc_driver_stencil_ref_export` reports that the device lacks `VK_EXT_shader_stencil_export`). `guest_udp`, `guest_sendfile` and `guest_sce_net` are among the passed. - `x86_64-w64-mingw32-g++` 16.2.0 `-fsyntax-only -Wall -Wextra` on the three changed `.cpp` files: no errors or warnings, as for their `main` versions. This is a syntax check, not a Windows build or run. - `tools/check_compile.py --base upstream/main`: 3 translation units compile. - `tools/check_conventions.py --base upstream/main` with this title and body: 0 errors, 1 warning (`debt-length` on the `ioctl` entry, 1649 characters; it is 1297 on `main`, already over the 1000 the warning allows). - `tools/pr_overlap.py --branch` lists #7437 (socket `fcntl` duplication), which changes neighbouring lines of `GuestKernelFcntl.cpp` and the next debt entry; it implements other commands, so whichever of the two is merged second needs only a textual rebase. It could not compare the open PRs that conflict with `main`; merged with this branch, #5021, #6977 and #7201 conflict in the same files as they do with `main`, and #7332 merges cleanly. - Not run on Windows, macOS or a console. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: OpenOrbis PS4 toolchain sample net_http, #3093 <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-19 16:25:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T16:25:53Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 7437 core/libs/tests/GuestKernelFcntl.cpp L115-116
docs/dev/debt/libkernel.md L202-204

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.

Pull request Shared files not compared
PR 5021 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 6044 core/libs/tests/GuestKernelFcntl.cpp
PR 6149 docs/dev/debt/libkernel.md
PR 6469 docs/dev/debt/libkernel.md
PR 6519 docs/dev/debt/libkernel.md
PR 6658 docs/dev/debt/libkernel.md
PR 6740 docs/dev/debt/libkernel.md
PR 6977 core/libs/prx/libkernel/Socket/src/Udp.cpp
core/libs/tests/GuestKernelFcntl.cpp
docs/dev/debt/libkernel.md
PR 7049 docs/dev/debt/libkernel.md
PR 7088 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 core/libs/prx/libkernel/File/include/DescriptorControl.hpp
core/libs/prx/libkernel/File/src/DescriptorControl.cpp
docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7201 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 7332 core/libs/prx/libkernel/Socket/src/Udp.cpp
core/libs/tests/GuestKernelFcntl.cpp
docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7554 docs/dev/debt/libkernel.md
PR 7556 docs/dev/debt/libkernel.md
PR 7605 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 7949 docs/dev/debt/libkernel.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6271966341 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7956#issuecomment-6271966341). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T16:25:53Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 7437](https://www.github.com/boykopovar/AnyPS5/pull/7437) | `core/libs/tests/GuestKernelFcntl.cpp` [L115-116](https://github.com/boykopovar/AnyPS5/blob/49fd13a74150cfffdfcdfefd3c90404403e922b8/core/libs/tests/GuestKernelFcntl.cpp#L115-L116)<br>`docs/dev/debt/libkernel.md` [L202-204](https://github.com/boykopovar/AnyPS5/blob/49fd13a74150cfffdfcdfefd3c90404403e922b8/docs/dev/debt/libkernel.md#L202-L204) | | | 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. | Pull request | Shared files not compared | |---|---| | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestKernelFcntl.cpp` | | [PR 6149](https://www.github.com/boykopovar/AnyPS5/pull/6149) | `docs/dev/debt/libkernel.md` | | [PR 6469](https://www.github.com/boykopovar/AnyPS5/pull/6469) | `docs/dev/debt/libkernel.md` | | [PR 6519](https://www.github.com/boykopovar/AnyPS5/pull/6519) | `docs/dev/debt/libkernel.md` | | [PR 6658](https://www.github.com/boykopovar/AnyPS5/pull/6658) | `docs/dev/debt/libkernel.md` | | [PR 6740](https://www.github.com/boykopovar/AnyPS5/pull/6740) | `docs/dev/debt/libkernel.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`core/libs/tests/GuestKernelFcntl.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 7049](https://www.github.com/boykopovar/AnyPS5/pull/7049) | `docs/dev/debt/libkernel.md` | | [PR 7088](https://www.github.com/boykopovar/AnyPS5/pull/7088) | `core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 7105](https://www.github.com/boykopovar/AnyPS5/pull/7105) | `docs/dev/debt/libkernel.md` | | [PR 7121](https://www.github.com/boykopovar/AnyPS5/pull/7121) | `core/libs/prx/libkernel/File/include/DescriptorControl.hpp`<br>`core/libs/prx/libkernel/File/src/DescriptorControl.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 7149](https://www.github.com/boykopovar/AnyPS5/pull/7149) | `docs/dev/debt/libkernel.md` | | [PR 7192](https://www.github.com/boykopovar/AnyPS5/pull/7192) | `docs/dev/debt/libkernel.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libkernel/Socket/src/Udp.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`core/libs/tests/GuestKernelFcntl.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 7464](https://www.github.com/boykopovar/AnyPS5/pull/7464) | `docs/dev/debt/libkernel.md` | | [PR 7509](https://www.github.com/boykopovar/AnyPS5/pull/7509) | `docs/dev/debt/libkernel.md` | | [PR 7554](https://www.github.com/boykopovar/AnyPS5/pull/7554) | `docs/dev/debt/libkernel.md` | | [PR 7556](https://www.github.com/boykopovar/AnyPS5/pull/7556) | `docs/dev/debt/libkernel.md` | | [PR 7605](https://www.github.com/boykopovar/AnyPS5/pull/7605) | `core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 7949](https://www.github.com/boykopovar/AnyPS5/pull/7949) | `docs/dev/debt/libkernel.md` |
MarcZX10 commented 2026-10-19 16:39:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T16:39:41Z.

Review: COMMENTED


Manual overlap check against #7437:

  • The implementation changes are separate: #7437 adds socket fcntl duplication commands, while this PR rejects malformed ioctl requests. In Udp.cpp, they modify the fcntl_nid_postfix and ioctl_nid_postfix paths respectively.
  • Both PRs add assertions in GuestKernelFcntl.cpp's socket coverage and update adjacent entries in docs/dev/debt/libkernel.md, but they cover different behavior. I found no duplicate implementation or dependency. When rebasing/merging, retain both test additions and both debt updates.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5574708788 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7956#pullrequestreview-5574708788). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T16:39:41Z. **Review:** COMMENTED --- Manual overlap check against #7437: - The implementation changes are separate: #7437 adds socket `fcntl` duplication commands, while this PR rejects malformed `ioctl` requests. In `Udp.cpp`, they modify the `fcntl_nid_postfix` and `ioctl_nid_postfix` paths respectively. - Both PRs add assertions in `GuestKernelFcntl.cpp`'s socket coverage and update adjacent entries in `docs/dev/debt/libkernel.md`, but they cover different behavior. I found no duplicate implementation or dependency. When rebasing/merging, retain both test additions and both debt updates.
harmsluis commented 2026-10-20 02:18:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harmsluis on 2026-10-20T02:18:53Z.


Windows run (Windows 11 build 26300, non-elevated, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON), since the PR only syntax-checked the changed files:

  • This PR (5fafbef24) merged onto main 34b1b77ab without conflicts (DescriptorControl.cpp, Udp.cpp, GuestKernelFcntl.cpp and the debt note auto-merged). guest_kernel_fcntl builds with no new warnings and passes 5/5 (ctest --repeat until-fail:5).
  • Control, the implementation files restored to main while keeping this PR's test: guest_kernel_fcntl aborts (0xc0000409). A local print in RequireFailure (not part of the PR) shows the first malformed ioctl returns -1 with errno 14 (EFAULT) instead of 25 (ENOTTY).

Not covered: the full build, and any title run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281802348 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7956#issuecomment-6281802348). Originally posted by [harmsluis](https://github.com/harmsluis) on 2026-10-20T02:18:53Z. --- Windows run (Windows 11 build 26300, non-elevated, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`), since the PR only syntax-checked the changed files: - This PR (`5fafbef24`) merged onto `main` `34b1b77ab` without conflicts (`DescriptorControl.cpp`, `Udp.cpp`, `GuestKernelFcntl.cpp` and the debt note auto-merged). `guest_kernel_fcntl` builds with no new warnings and passes 5/5 (`ctest --repeat until-fail:5`). - Control, the implementation files restored to `main` while keeping this PR's test: `guest_kernel_fcntl` aborts (`0xc0000409`). A local print in `RequireFailure` (not part of the PR) shows the first malformed `ioctl` returns -1 with errno 14 (`EFAULT`) instead of 25 (`ENOTTY`). Not covered: the full build, and any title run.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7956
No description provided.