fix(libkernel): give FillStatfs the noexec flag so statfs builds on macOS #17767
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17767"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Gonic0 on 2026-11-09T15:10:02Z.
What
libkernelno longer compiles on macOS onmain:#9161 split the shared part of
NativeFstatfsintoFillStatfs, whichNativeStatfsnow also uses for a path. The macOS branch that setsKERNEL_MNT_NOEXECfromfstatfs(descriptor)ended up insideFillStatfs, which only receives thestatvfsresult.FillStatfsnow takes the flag, and each caller works it out:NativeFstatfson macOS:fstatfson the descriptor, as before #9161.NativeStatfson macOS:statfson the path, so the path form also reportsnoexecmounts.ST_NOEXECfrom thestatvfsresult, as before.Windows has its own
NativeStatfsandNativeFstatfs, which do not useFillStatfs.Tested
macOS 27.3, Apple M5 Pro, Apple clang, x86-64 Release under Rosetta 2. Tree:
mainb673b14c39with this change and #16591, #17425 and #17532, which macOS still needs to build. Between that commit andmainffe575754a, nothing inStdio.cppchanged, and the broken line is still there.ninja -k 0 libsfails onStdio.cpp:716(above). The other failures are the ones #16591 and #17532 fix.libs(407 libraries, NID patching included) andrelinkerbuild.ctest -R 'statfs|fstatfs|statvfs|kernel_sys_paths': 12 of 12 pass (guest_kernel_sys_paths_statfsand its patched form,guest_fstatfs,guest_statvfs,guest_fstatvfs,guest_fstatvfs_conversionand the other path tests).KERNEL_MNT_NOEXEC, so the flag itself is covered only by reading the code.ST_NOEXECtest as before.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-09T17:06:09Z.
Review: APPROVED
Read
496ee893aa.FillStatfsnow takesnoexec, and both callers compute it as(host.f_flag & ST_NOEXEC) != 0from thestatvfsthey already have. That is exactly whatFillStatfsdid onmain, so nothing changes there.NativeFstatfsgoes back tofstatfs(descriptor)as before #9161, andNativeStatfsusesstatfs(path)for the path case, whichmainnever setKERNEL_MNT_NOEXECfor. The rest of the flag and size filling is unchanged and shared.AI-assisted: yes (Claude Code)