Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lutris: Ubisoft Connect: Error at hooking API #6035

Closed
5 of 7 tasks
nutta-git opened this issue Oct 5, 2023 · 13 comments · Fixed by #6067
Closed
5 of 7 tasks

lutris: Ubisoft Connect: Error at hooking API #6035

nutta-git opened this issue Oct 5, 2023 · 13 comments · Fixed by #6067

Comments

@nutta-git
Copy link
Contributor

nutta-git commented Oct 5, 2023

Description

Ubisoft connect doesn't work with Lutris's default profile.

Steps to Reproduce

  1. ln -s /usr/bin/firejail /usr/local/bin/lutris
  2. cp /etc/firejail/lutris.profile ~/.config/firejail/lutris.profile (to a whitelist a single folder)
  3. firecfg --fix
  4. Launch Lutris
  5. Start Ubisoft Connect [WINE- Latest Version]

Expected behavior

Ubisoft Connect should work without throwing an error

Actual behavior

Lutris gave an API error[lutris-upc]

Behavior without a profile

  1. rm /usr/local/bin/lutris

Ubisoft Connect starts fine without Firejail profile

Environment

  • Arch Linux x86-64
  • firejail version 0.9.72

Checklist

  • The issues is caused by firejail (i.e. running the program by path (e.g. /usr/bin/vlc) "fixes" it).
  • I can reproduce the issue without custom modifications (e.g. globals.local).
  • The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • The profile (and redirect profile if exists) hasn't already been fixed upstream.
  • I have performed a short search for similar issues (to avoid opening a duplicate).
    • I'm aware of browser-allow-drm yes/browser-disable-u2f no in firejail.config to allow DRM/U2F in browsers.
  • I used --profile=PROFILENAME to set the right profile. (Only relevant for AppImages)

Log

Output of LC_ALL=C firejail /path/to/program

Reading profile /home/user/.config/firejail/lutris.profile
Reading profile /etc/firejail/allow-python2.inc
Reading profile /etc/firejail/allow-python3.inc
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-common.inc
Reading profile /etc/firejail/whitelist-usr-share-common.inc
Reading profile /etc/firejail/whitelist-runuser-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Seccomp list in: !modify_ldt, check list: @default-keep, prelist: unknown,
Parent pid 107596, child pid 107600
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Seccomp list in: !modify_ldt, check list: @default-keep, prelist: unknown,
Seccomp list in: !modify_ldt, check list: @default-keep, prelist: unknown,
Child process initialized in 61.71 ms
Warning: seccomp disabled, it requires a Linux kernel version 3.5 or newer.

(lutris:13): dbind-WARNING **: 17:55:41.010: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus_0: No such file or directory
2023-10-05 17:55:41,215: Starting Lutris 0.5.13
2023-10-05 17:55:41,216: Running AMD Mesa driver 23.2.0 on AMD Radeon RX 6600 XT (navi23, LLVM 16.0.6, DRM 3.54, 6.5.5-2-cachyos) (0x73ff)
2023-10-05 17:55:41,216: GPU: 8086:4680 1458:D000 (i915 drivers)
2023-10-05 17:55:41,216: GPU: 1002:73FF 1043:05D1 (amdgpu drivers)
2023-10-05 17:55:41,216: i386 libgnutls.so.30 missing (needed by gnutls)
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/lutris/style_manager.py", line 77, in _call_cb
    values = obj.call_finish(result)
             ^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown (2)
2023-10-05 17:55:53,341: Unable to load libGLX_nvidia.so.0
2023-10-05 17:55:53,341: Unable to locate libGLX_nvidia
lutris-wrapper: Ubisoft Connect
Started initial process 258 from /home/user/.local/share/lutris/runners/wine/wine-ge-8-17-x86_64/bin/wine /home/user/Games/ubisoft-connect/drive_c/Program Files (x86)/Ubisoft/Ubisoft Game Launcher/UbisoftConnect.exe
Start monitoring process.
fsync: up and running.
wine: Using setpriority to control niceness in the [-19,19] range
Initial process has exited (return code: 0)
Monitored process exited.
Exit with return code 0
2023-10-05 17:55:57,381: Game still running (state: running)
2023-10-05 17:55:57,381: Stopping Ubisoft Connect (wine)
2023-10-05 17:55:57,382: The game has run for a very short time, did it crash?

Output of LC_ALL=C firejail --debug /path/to/program

Uploaded File: lutris-firejail-debug.txt

lutris-firejail-debug.txt

@nutta-git
Copy link
Contributor Author

Setting ignore to seccomp !modify_ldt and seccomp.32 !modify_ldt fixes this issue.

ignore seccomp !modify_ldt
ignore seccomp.32 !modify_ldt

Should I close this issue or keep it open?

@glitsj16
Copy link
Collaborator

glitsj16 commented Oct 6, 2023

Should I close this issue or keep it open?

Thank you for reporting. Disabling the seccomp filter like you did might fix your issue, but the lutris sandbox would be more hardened if we could ascertain an improved, working filter. Let's keep this open so people can chime in to try determining such a replacement seccomp filter.

Could you try to find a working seccomp filter? There's more info here.

@nutta-git
Copy link
Contributor Author

@glitsj16
I don't know much about this to offer any help, I sort of found out by trial and error.
I followed the link your provided, and try to find out which seccomp was causing issues.
When I run:
firejail --seccomp-error-action=log /usr/bin/lutris
Everthing works fine, and journalctl doesn't list anything

When I run :
firejail /usr/bin/lutris
I get original issue

@glitsj16
Copy link
Collaborator

glitsj16 commented Oct 6, 2023

That's relevant info, thanks!

Anyhing in journalctl when you --seccomp-error-action=EPERM (the default) and --seccomp-log=yes?

@nutta-git
Copy link
Contributor Author

@glitsj16
firejail --seccomp-error-action=EPERM /usr/bin/lutris
I get the original issue and nothing is shown on [journalctl --grep=SECCOMP --follow]

firejail --seccomp-log=yes /usr/bin/lutris
Console prints out:
Error: invalid --seccomp-log=yes command line option
And nothing happens.

@glitsj16
Copy link
Collaborator

glitsj16 commented Oct 6, 2023

@nutta-git
Argh, my bad. You'll need to change the default # seccomp-log no to seccomp-log yes in /etc/firejail/firejail.config... Apologies for the confusion.

@nutta-git
Copy link
Contributor Author

@glitsj16
No worries, I edited firejail.config, rebooted and tried again.
Term1) sudo journalctl --grep=SECCOMP --follow

Term2) firejail --seccomp-error-action=EPERM /usr/bin/lutris

Original Issue and nothing was listed on journalctl

I tried: firejail --seccomp-error-action=log /usr/bin/lutris again

And it seems to work fine, but nothing is being listed in journalctl

@nutta-git
Copy link
Contributor Author

I don't mean to impose, but can you try to reproduce the issue by following the steps found in the First Post.
I feel like this a problem is unique to me. If its not reproducible, then we can close this issue.

@glitsj16
Copy link
Collaborator

glitsj16 commented Oct 6, 2023

No problem. I'll try to reproduce over the weekend, although my hardware isn't any good for gaming & wine. We can keep this open for a while. Other collaborators/users might have input.

@rusty-snake
Copy link
Collaborator

Tried allow-debuggers?

@nutta-git
Copy link
Contributor Author

@rusty-snake
I un-commented allow-debuggers in .config/firejail/lutris.profile
Also have; seccomp-log yes in /etc/firejail/firejail.config

Then I re-ran the test.

Term1) sudo journalctl --grep=SECCOMP --follow

Term2) firejail --seccomp-error-action=EPERM /usr/bin/lutris

Now I no longer get the original issue, nothing is listed in journalctl

I tried: firejail --seccomp-error-action=log /usr/bin/lutris

Same result as the first command, no issue and no journalctl log

@nutta-git
Copy link
Contributor Author

I think I found the right syscalls for this issue: ptrace,clone3 (and optionally) process_vm_readv.

I had journalctl -f | grep "kernel" running, looking for syscalls lutris was using
I need to whitelist just ptrace and clone3, journalctl did list for process_vm_ready when a game was running, but it didn't crash the game.

seccomp !modify_ldt,!clone3,!ptrace,!process_vm_readv
seccomp.32 !modify_ldt

@glitsj16
Copy link
Collaborator

Nice finds! Please consider opening a PR.

nutta-git added a commit to nutta-git/firejail that referenced this issue Oct 24, 2023
Fix for netblue30#6035 
I don't know if !process_vm_readv is required see
kmk3 pushed a commit to nutta-git/firejail that referenced this issue Nov 1, 2023
Need to whitelist `ptrace` and `clone3` for Ubisoft Connect to work.

journalctl did list `process_vm_readv` when a game was running, but it
didn't crash the game.

Fixes netblue30#6035.
@kmk3 kmk3 changed the title Lutris: Error at hooking API lutris: Ubisoft Connect: Error at hooking API Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants