Bug 1905720 - cannot open ssh redirected Display
Summary: cannot open ssh redirected Display
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: webkit2gtk3
Version: 33
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michael Catanzaro
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-08 22:10 UTC by Michael Osborne
Modified: 2021-05-10 16:17 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-10 02:50:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME evolution issues 1369 0 None None None 2021-02-16 21:14:46 UTC
WebKit Project 221990 0 None None None 2021-02-16 21:12:53 UTC

Description Michael Osborne 2020-12-08 22:10:35 UTC
Description of problem:
When running a webkit2gtk process via remote X11 under ssh the webkit process dies with the error:

(WebKitWebProcess:2): Gtk-WARNING **: 12:38:30.923: cannot open display: localhost:16.0 (this error was from Epiphany, a similar error occurs when runnin evolution)

This error only affects the webkit process, the rest of the program runs normally.

Version-Release number of selected component (if applicable):

webkit2gtk3-2.30.3-1 
also occurs with 2.30.2

How reproducible:

always



Steps to Reproduce:
1. ssh -Y <remote> or ssh -X <remote>
2. run epiphany or evolution
3.

Actual results:
webkit process dies with error "cannot open display: localhost:16.0"

Expected results:
page displays correctly


Additional info:
openssh-8.4p1-3.fc33.x86_64
epiphany-3.38.1-1.fc33.x86_64
evolution-3.38.1-1.fc33.x86_64


This error started with F33, it did not happen with F32.

Comment 1 Michael Catanzaro 2020-12-08 22:24:14 UTC
Feel free to report this upstream on WebKit Bugzilla. The chances of problems with SSH redirection being addressed here are zero, sorry.

Comment 2 Michael Catanzaro 2020-12-08 22:28:54 UTC
(In reply to Michael Osborne from comment #0)
> This error started with F33, it did not happen with F32.

...it did not happen with F32, with the same version of WebKit...?

Comment 3 Michael Osborne 2020-12-08 22:57:18 UTC
Correct, the initial version of webkit on F33 was the same as F32. I am not sure that webkit is the true source of the error. It is just the component that is generating the error.

Comment 4 Michael Catanzaro 2020-12-08 23:08:00 UTC
OK, probably not a WebKit bug then....

Unfortunately, I have no clue what component might be responsible.

Comment 5 Michael Catanzaro 2020-12-09 16:09:43 UTC
Could this be https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1600?

Comment 6 Michael Osborne 2020-12-10 20:28:20 UTC
Not this, I'm not using wayland, just plain ole X11.

Comment 7 Michael Catanzaro 2021-01-25 16:32:22 UTC
OK, there's not really anything I can do for you. I haven't used X11 since 2016, and I've never used SSH forwarding ever, and I have not the faintest clue which component to reassign this bug to. And we have established that no change in WebKit is responsible, since the same version of WebKit works fine on F32.

So... I can either close this bug, or reassign to another component for triage. I guess ssh, though I have no clue whether there is really any bug in ssh here. I'll get a second opinion....

Comment 8 Michael Catanzaro 2021-01-25 18:36:23 UTC
(In reply to Michael Osborne from comment #0)
> Additional info:
> openssh-8.4p1-3.fc33.x86_64
> epiphany-3.38.1-1.fc33.x86_64
> evolution-3.38.1-1.fc33.x86_64
> 
> 
> This error started with F33, it did not happen with F32.

Did you test Epiphany in F32, or only in F33?

Guess: Evolution enabled WebKit's sandbox for the first time in F33. If Evolution works in F32, but Epiphany does not, then we can conclude it's related to the sandbox. Try running with WEBKIT_FORCE_SANDBOX=0 and see if that works, please.

I asked Ray Strode and he guessed that XAUTHORITY might not be available in the sandbox, but it should be (unless the UI process thinks it is running in Wayland, which it should not), so I don't think that's related. His next guess was the hostname might not be available inside the sandbox, which uses a uts namespace. But I checked the struct utsname returned by uname(), and it does match the host, so it's not that either.

CC: Jakub since this is an SSH forwarding issue and we are a bit stumped.

Comment 9 Michael Osborne 2021-01-25 20:31:37 UTC
I just checked Epiphany in F32, it gives the same error. I thought I had checked that already. Hmmm, sorry about that.

Using WEBKIT_FORCE_SANDBOX=0 
both epiphany and evolution work in F33.

So, it appears that the sandbox is the culprit.

Comment 10 Michael Catanzaro 2021-01-25 21:13:59 UTC
Hm, interesting. Well that's good news I guess, since modifying the sandbox is pretty easy. I can add a hole for whatever is needed, if only we could figure out what that is.

The code is here:

https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp?rev=268472

The code that handles Xauthority is here:

https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp?rev=268472#L306

Comment 11 Michael Catanzaro 2021-02-16 20:26:33 UTC
I think we figured it out here: https://gitlab.gnome.org/GNOME/evolution/-/issues/1369#note_1038237.

Problem is the web process is trying to connect the X server over a TCP socket, but this is not allowed because it runs in a separate network namespace.

Comment 12 Michael Catanzaro 2021-02-16 21:14:35 UTC
OK, I've created an upstream bug and will post a patch there, which I'm fairly confident will fix this.

To actually commit the patch upstream, I need somebody who uses X11 forwarding to test it first, because I don't want to take the time to figure out how to set this up. If you'd be willing to test, I could do a Fedora scratch build to make it easier to try.

Comment 13 Michael Osborne 2021-02-16 22:19:39 UTC
Sure thing, I'd be happy to test it.

Comment 14 Michael Catanzaro 2021-02-17 17:50:33 UTC
Thanks, scratch build is here: https://koji.fedoraproject.org/koji/taskinfo?taskID=62169713

At minimum, you'll need webkit2gtk3-2.30.5-2.fc33.x86_64.rpm and webkit2gtk3-jsc-2.30.5-2.fc33.x86_64.rpm.

Comment 15 Michael Osborne 2021-02-18 23:55:19 UTC
I tested evolution and epiphany with webkit2gtk3-2.30.5-2.fc33.x86_64.rpm and webkit2gtk3-jsc-2.30.5-2.fc33.x86_64.rpm with multiple users. Everything looks fine now. No visible errors, no relevant errors listed to stdout either. Looks good from here. Thanks!

Comment 16 Michael Catanzaro 2021-02-19 00:04:12 UTC
OK great, thanks for testing.

Comment 17 Michael Osborne 2021-04-09 18:05:13 UTC
The latest versions, 2.32.0-1, of webkit2gtk3, and webkit2gtk3-jsc reintroduce this bug. :-( Reopening.

Comment 18 Michael Osborne 2021-04-09 18:07:22 UTC
The koji versions, 2.30.5-2, mentioned in comment 14 work fine.

Comment 19 Michael Catanzaro 2021-04-10 02:45:57 UTC
Upstream fix was https://trac.webkit.org/changeset/273965/webkit. That code hasn't changed, so something else must have broken.

Are you willing to try bisecting WebKit? It's not going to be fun and could take several days if you don't have an amazing computer, but that's a guaranteed way to figure out what has gone wrong. Otherwise it's hard to guess what could have changed.

Comment 20 Michael Catanzaro 2021-04-10 02:50:08 UTC
Ah nevermind, problem was it was never actually fixed in any release. It's only a regression if you compare to my scratch builds:

(In reply to Michael Osborne from comment #18)
> The koji versions, 2.30.5-2, mentioned in comment 14 work fine.

These worked fine because they were the scratch build with my patch applied. The change is in trunk but never got backported to 2.32. Oops. I will request it for 2.32.1. (Until then, you can downgrade to 2.30.5.)

Comment 21 Michael Catanzaro 2021-05-10 16:17:37 UTC
This should be fixed in 2.32.1.


Note You need to log in before you can comment on or make changes to this bug.