Bug 275295 - Linuxulator: faccessat2 unsupported flag 0x100
Summary: Linuxulator: faccessat2 unsupported flag 0x100
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks: 247219
  Show dependency treegraph
 
Reported: 2023-11-24 08:30 UTC by Kenneth Raplee
Modified: 2024-03-27 13:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Raplee 2023-11-24 08:30:14 UTC
Recently a weird file permission issue had popped up with using the Brave browser through the Linuxulator when trying to run it:

/usr/local/bin/linux-brave: /compat/ubuntu/opt/brave.com/brave/brave-wrapper: Permission denied

The permissions were fine and the problem continued to persist after trying multiple Ubuntu-lator re-installations, even with different versions, e.g.: jammy, lunar, mantic.

Eventually I thought to peak into the dmesg output and found the following:


linux: jid 0 pid 63533 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 64609 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 66611 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 75500 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 77301 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 79047 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 85152 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 88585 (grep): syscall splice not really implemented
linux: jid 0 pid 64576 (kbd_mode): linux_ioctl_fallback fd=5, cmd=0x4b33 ('K',51) is not implemented
linux: jid 0 pid 64576 (kbd_mode): linux_ioctl_fallback fd=5, cmd=0x4b33 ('K',51) is not implemented
linux: jid 0 pid 50603 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 44462 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 44462 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 22 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 4658 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 11089 (setcap): capset[0] effective=0x80000000, permitted=0x0, inheritable=0x0 is not implemented
linux: jid 0 pid 15094 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 16805 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 18843 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 20469 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 24832 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 84149 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 85600 (systemctl): faccessat2 unsupported flag 0x100
linux: jid 0 pid 98160 (curl): unsupported setsockopt level 6 optname 31
linux: jid 0 pid 16546 (gpg-agent): syscall inotify_init not implemented


With regards to the "(gpg-agent)" line, I would like to note that I've also been having `apt update` GPG errors in the Ubuntu linuxulation. I've used `deb [trusted=yes] ...` in /compat/ubuntu/etc/apt/sources.list as a workaround to get updates but users shouldn't have to do this either.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2023-11-24 15:01:01 UTC
Looks like that flag is:
#define AT_SYMLINK_NOFOLLOW     0x100   /* Do not follow symbolic links.  */

Are you able to apply a patch and build a new kernel to test?
Comment 2 Ed Maste freebsd_committer freebsd_triage 2023-11-24 15:06:46 UTC
Ah, more extensive change is required, note the XXX comment in linux_faccessat2:

int
linux_faccessat2(struct thread *td, struct linux_faccessat2_args *args)
{
        int flags, unsupported;

        /* XXX. AT_SYMLINK_NOFOLLOW is not supported by kern_accessat */
        unsupported = args->flags & ~(LINUX_AT_EACCESS | LINUX_AT_EMPTY_PATH);
        if (unsupported != 0) {
                linux_msg(td, "faccessat2 unsupported flag 0x%x", unsupported);
                return (EINVAL);
        }
Comment 3 Kenneth Raplee 2023-11-24 16:25:05 UTC
(In reply to Ed Maste from comment #1)

I would be more than happy to help with testing provided patches. No problem with either patching and building.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2023-11-24 16:27:17 UTC
(In reply to Kenneth Raplee from comment #3)
Great, thanks. I thought I was going to have a straightforward, small patch to test before finding the source code comment that I left in PR comment #2.
Comment 5 Kenneth Raplee 2023-11-24 16:32:26 UTC
(In reply to Ed Maste from comment #4)
It's understood. I still wanted to put myself out there for testing. :)