Bug 16126 - Implement openat2 intercept in pseudo
Summary: Implement openat2 intercept in pseudo
Status: RESOLVED FIXED
Alias: None
Product: Pseudo
Classification: Yocto Project Subprojects
Component: pseudo (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium+ normal
Target Milestone: 6.0 M2
Assignee: Mark Hatle
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-01-07 07:45 UTC by Khem Raj
Modified: 2026-04-30 20:58 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2026-01-07 07:45:09 UTC
openat2 in introduced in upcoming 2.43 release of glibc. Pseudo needs to be aware of this function and create an intercept for it.
Comment 1 Richard Purdie 2026-01-12 17:51:03 UTC
For tar on stream9 we need to intercept the syscall too:

https://git.yoctoproject.org/pseudo/tree/ports/linux/guts/syscall.c
https://git.yoctoproject.org/pseudo/tree/ports/linux/guts/syscall.c
Comment 3 Mark Hatle 2026-01-15 00:55:56 UTC
psseudo master has a syscall intercept for SYS_openat2 that returns ENOSYS.  This should unblock immediate users.

Additionally, I've adapted 'openat' as a possible 'openat2' implementation.

See: https://git.yoctoproject.org/pseudo/commit/?h=fray/master-wip&id=022e103f0b1223fb6557d730471196cb2223ac27

This is a first version.  Once the function (not syscall) is mainstream, we'll likely want to have 'openat' call 'openat2', as well and adjust it to pass through whatever openat2 interface glibc ends up with, but until then this SHOULD work and is good enough for testing purposes.
Comment 4 Randy MacLeod 2026-01-15 16:09:08 UTC
Lower to M+.

We've got a patch to return ENOSYS for now and
there is a plan for a proper implementation.
Comment 5 Paul Barker 2026-04-08 09:45:48 UTC
Based on Zoltan's testing, it looks like we'll need full openat2() handling to build on Fedora 44 [1].

[1]: https://lore.kernel.org/openembedded-core/1b979680925d535d3cd344a8b736b8f862d52498.camel@pbarker.dev/
Comment 6 Paul Barker 2026-04-13 15:45:51 UTC
We could use the gnulib openat2() implementation, relying on the fact that it calls openat() which we already handle.

https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/openat2.c;h=2be62c921c5b90e8b0d528b33501ed3e1f2d7f92;hb=HEAD
Comment 7 Richard Purdie 2026-04-15 13:52:24 UTC
https://git.yoctoproject.org/pseudo/log/?h=rpurdie/openat2 has a one idea of how we could make it work, I found and worked around the issue in Mark's implementation. I am worried there may be chroot issues with that change though.
Comment 8 Richard Purdie 2026-04-30 20:58:30 UTC
https://git.yoctoproject.org/pseudo/commit/?id=6533a536f93a13ec39e5fd42e3385798729e093f and following commit.