News for hackers. Stuff that matters.
Re:Wayland vs. X – Overview by tapoxi on Wednesday December 20, 2023 @09:14AM (#38708899)
Alright let me just predict the thread.

>They didn't need to do this! Xorg worked fine!

They needed to do this, Xorg was complicated, insecure, and the maintainers moved on to Wayland. Nobody else wanted to take up the mantle of maintaining an X implementation.

>I can't take screenshots!

Wayland compositors require Freedesktop portal API calls to request access to take screenshots, record the screen, etc.

>Nvidia doesn't work!

It's better now, but there was a whole EGLStreams vs GBM debate that stalled progress for years.

Re:Wayland vs. X – Overview by ACS_Solver on Wednesday December 20, 2023 @09:44AM (#38709188)
Your prediction is probably right but it highlights what I still find to be a fundamental problem with Wayland. It's something that's very much user-facing, as it affects the behavior of desktop environments and several types of programs. It's also something that developers want because they don't want to write X applications or maintain Xorg itself.

The disconnect is developers want Wayland to replace X ASAP, while users want a smooth experience where nothing breaks due to it being Wayland, which is a high bar.

For me, Wayland remains one of the least favorite technologies I've dealt with. As a developer, I needed to port a custom Linux system to hardware that only has Wayland drivers and it was a giant pain. Wayland offers no advantage at all for that system but it broke a lot of functionality that relied on X in terms of window placement, etc. Took weeks of work to get a more complicated system that does 90% of what the previous one did, while still missing a few convenient features.

As a user, I try Wayland once in a while on one of my computers. It's improving - or more precisely, it's not Wayland itself but rather Wayland support of other software, like KDE. Earlier this year I finally worked under KDE/Wayland for a couple days with no issues, but then I again ran into some weirdness when using Unity so once again back to Xorg. What really makes Wayland hard to daily drive for me is that I have zero issues with Xorg. I don't use the things X can't do at all (fractional scaling is one I think?) so the bar for Wayland as a daily driver is admittedly a very high one, it needs to be completely free of issues because Xorg already does everything for me and Wayland's advantages are for the devs, not for me as a desktop user.

It also feels like it's improving slower than anything else has. Printing on Linux used to be a pain but now it works well. Wifi on Linux was hard to get working at some point but now it just works. Sensationally, gaming on Linux has become as easy as it is on Windows. Wayland protocols hit 1.0 in 2015 and now nine years later, it's approaching usability.

Re:Wayland vs. X – Overview by yjftsjthsd-h on Wednesday December 20, 2023 @10:46AM (#38709915)
> As a developer, I needed to port a custom Linux system to hardware that only has Wayland drivers and it was a giant pain. Wayland offers no advantage at all for that system but it broke a lot of functionality that relied on X in terms of window placement, etc.

FWIW, I've had decent luck running cage ( https://www.hjdskes.nl/projects/cage/ ), then on that xwayland, and then just ignoring wayland and running X clients. The result does still have some slight quirks, but it mostly works fine.

Re:Wayland vs. X – Overview by ACS_Solver on Wednesday December 20, 2023 @12:25PM (#38711073)
That looks pretty similar to what I ended up with! In the end, I had Weston running a rootful fullscreen Xwayland as the only Wayland window, and then X clients within that. There were still some complications, since I also wanted to make use of some GStreamer overlays that could totally sidestep window management, and the result wasn't perfect but it worked fine.

Still, I can't help but be somewhat unhappy about how the forced use of Wayland resulted in a fair amount of work, the end result of which was running X clients anyway and trying to pretend Wayland isn't there.

Re:Wayland vs. X – Overview by ndiddy on Wednesday December 20, 2023 @10:13AM (#38709517)
My main issue with Wayland is how big of a missed opportunity it is. If you're going to introduce a massive breaking change like this to modernize the Linux desktop, the least you can do is make it an actually compelling design. Wayland was originally created to fix the parts of Xorg that made it difficult to use it for embedded devices (digital signage, car infotainment systems, etc), so the base protocol only defines enough functionality to make that use case possible. Anything more complex than that requires using a complicated patchwork of Wayland protocol extensions, some of which are specific to certain compositors and many of which duplicate the X11 protocol extensions they're intended to replace. I'd be surprised if Wayland isn't more complicated to use than X11 in a few years.

Additionally, Wayland is already showing its age. The example that first comes to mind is how events are handled. Device events are received from the kernel and placed in a 4KB buffer that clients are supposed to read from and process. If the buffer fills up without being processed (for example, if high CPU or I/O stress causes a program to get descheduled for a few seconds and the user moves his mouse over the window), the compositor will sever its connection with the program, causing it to crash. This wasn't a problem for Wayland's initial embedded use case, but if you're trying to use it on desktop with devices such as high-polling rate mice it makes it far more unstable than X11 unless you have enough system resources to guarantee that no program will ever have its event handler thread pause for any reason. See here for more information: https://gitlab.freedesktop.org/wayland/wayland/-/issues/159

I wish that the "X11 is showing its age and should be replaced, but Wayland isn't the right option" viewpoint was more mainstream.

Re:Wayland vs. X – Overview by bzzzt on Wednesday December 20, 2023 @10:41AM (#38709844)
I don't see how a client application blocking its main event handler isn't broken? If you're going to do lots of work or blocking I/O you spin it off to another thread so UI updates will be handled without pause.
Re:Wayland vs. X – Overview by ndiddy on Wednesday December 20, 2023 @11:25AM (#38710373)
On desktop we don't have realtime scheduling. Processes can get descheduled for arbitrary amounts of time. This issue happens with well-behaved applications that don't block at all on their main event handler threads when the system is under high CPU or I/O load.
Re:Wayland vs. X – Overview by asoneth on Wednesday December 20, 2023 @12:01PM (#38710823)
> Nobody else wanted to take up the mantle of maintaining an X implementation.

This is the most surprising part to me.

Despite the volume of end-user complaints I haven't seen any developer stepping up to take over the soon-to-be deprecated X.Org Server or advertising their alternative X implementation.

Even if it remains niche like the various systemd alternatives it seems like a lot of people would be grateful.

Re:Wayland vs. X – Overview by bogwog on Wednesday December 20, 2023 @09:28AM (#38709023)
From my understanding, the biggest problem with Nvidia cards atm is the lack of explicit sync support in Wayland, which is something that is actively being worked on by both Nvidia and others.

That said, I've been using Nvidia+Wayland+KDE on my workstation for over a year now and while there are problems, it's certainly useable.

Re:Wayland vs. X – Overview by jbverschoor on Wednesday December 20, 2023 @09:25AM (#38709010)
Isn't only the transport layer of X insecure? That could be swapped out with another layer. With Wayland you have to use VNC which is fine for local networks, but not for remote ones.
Re:Wayland vs. X – Overview by hedora on Wednesday December 20, 2023 @10:13AM (#38709514)
There's nothing wrong with the transport layer's security, as far as I can tell. (For one thing, it's usually tunneled over SSH). The X11 security model assumes that anything with access to the screen has at least as much privilege as the user account that owns the session.

In practice, that's true (things like flatpack claim to support fake sandboxing, but whatever.)

Hypothetically, in a universe where Wayland was running on top of something other than the Linux desktop ecosystem, you could run untrusted code from bash with su, and have it talk to wayland directly, and it'd be OK. Today, you have to run it in a web browser, or using a VM with display virtualization drivers, or use any of a dozen other sandbox choices.

Those all managed to get the correct security properties under X11 because they're properly modularized. Wayland isn't, so to get this one feature, they're expecting all software to be rewritten.

Re:Wayland vs. X – Overview by DonHopkins on Wednesday December 20, 2023 @11:04AM (#38710127)
> they're expecting all software to be rewritten.

ALL software was ALREADY rewritten for the web, so just use a web browser running directly on the hardware instead of bothering with X11 or Wayland or some hypothetical replacement like X12. That's just an extra useless layer that nobody needs.

A web browser is totally extensible and scriptable in JavaScript and WASM. Standards based. Excellent networking support. Streaming video. Secure sandboxing. Remote accelerated 2D and 3D graphics and GPU programming and WASM engine. Not rocket science. Off-the-shelf, well tested, open standards based solution. Problem already solved.

Why this is not the most obvious thing in the world since the Effrafax painted a mountain pink, and hasn't already been done, totally baffles me. It's as if the Linux community would much rather bicker and squabble about X11 -vs- Wayland for another 30 years than solve the problem once and for all and permanently and perfectly.

https://en.wikipedia.org/wiki/Somebody_else%27s_problem

>An SEP is something we can't see, or don't see, or our brain doesn't let us see, because we think that it's somebody else's problem. That’s what SEP means. Somebody Else’s Problem. The brain just edits it out, it's like a blind spot.

>The Somebody Else's Problem field... relies on people's natural predisposition not to see anything they don't want to, weren't expecting, or can't explain. If Effrafax had painted the mountain pink and erected a cheap and simple Somebody Else’s Problem field on it, then people would have walked past the mountain, round it, even over it, and simply never have noticed that the thing was there.

https://news.ycombinator.com/item?id=38442601

https://news.ycombinator.com/item?id=38442660

https://news.ycombinator.com/item?id=38445174

https://news.ycombinator.com/item?id=31988890

https://news.ycombinator.com/item?id=29094938

https://news.ycombinator.com/item?id=29097030

https://news.ycombinator.com/item?id=20182294

https://news.ycombinator.com/item?id=11484148

https://news.ycombinator.com/item?id=5844345

Re:Wayland vs. X – Overview by marrs on Wednesday December 20, 2023 @07:12PM (#38715444)
I write software for web browsers for a living and I shudder at the thought of having all of my apps trapped in some bloaty, slow sandbox that's different enough from all the other bloaty and slow sandboxes to not actually support all the software it needs to run.

If I have to live on your world, I'll probably just chuck it all in and work with my hands for a living instead.

Re:Wayland vs. X – Overview by DonHopkins on Wednesday December 20, 2023 @10:51PM (#38716802)
So you'd rather have TWO different bloaty slow sandboxes layered on top of each other, instead of one bloaty slow sandbox. Right.
Re:Wayland vs. X – Overview by marrs on Thursday December 21, 2023 @04:53AM (#38718683)
I don't know what this means
Re:Wayland vs. X – Overview by hedora on Friday December 22, 2023 @09:46PM (#38741179)
The web browser is a sandbox, and it runs as an OS process, which is a sandbox.

I think their comment means you’d be better off targeting an OS level sandbox (maybe based on OCI(?), which means a different container for each OS kernel or breaking kernel change — new docker doesn’t run on old linux as it is).

If you chose the OS level sandbox correctly, that would probably be more cpu-efficient than the web browser.

However, that’s a big “if”, since most of the linux sandbox thingies take multiple seconds to spawn a process, and multiply memory usage by 10-100x.

Re:Wayland vs. X – Overview by DonHopkins on Saturday December 23, 2023 @08:47AM (#38744199)
No, I mean the other way around.

X11 sucks. Wayland sucks. Get rid of them both! But the browser's not going away, and it's open standards based and cross platform, and there's a huge amount of collaborative work and money and talent going into making it better and more powerful and more efficient and more secure across the entire industry and all platforms, unlike X11 and Wayland (which nobody gives a shit about outside of a few fanatical Linux desktop users), or even the Windows and Mac desktops and Android and iOS interfaces (which billions of people use every day, but are stagnant terribly designed dead-ends).

The browser is a sandbox, so why run it on top of another leaky inflexible insufficient outdated sandbox full of clumps of dehydrated urine and cat turds like X11 or Wayland, instead of directly on the hardware?

No modern desktop environment is complete without a browser, so since you're stuck with it, why not just use the browser itself as the desktop environment (or whatever user interface paradigm you choose to use), since you're never getting rid of the browser, and modern non-browser desktops aren't as flexible or powerful or extensible as a browser, and most useful applications have been ported to run in the web browser environment anyway, so they can run across many different platforms, and be easily distributed and efficiently used over the network (unlike Wayland or "modern" X11 apps).

I'm just surprised this seems to be so hard for some people to understand, in spite of the fact that I've been making the same argument for more than a decade, and provided many links to those arguments, because it seems extremely obvious and straightforward to me, and the technology is finally mature enough to pull it off.

Re:Wayland vs. X – Overview by marrs on Thursday December 28, 2023 @06:54PM (#38800222)
X11 isn't a sandbox and that's fine by me. I'm not particularly interested in zero trust computing. I'm not strongly opposed to it, but in general I'm going to choose a lightweight app over a resource hog. However bad X11 is, it runs the software I want to use. That's literally my only motivation for sticking with it. Sorry if you find all this offensive.

> No modern desktop environment is complete without a browser, so since you're stuck with it, why not just use the browser itself as the desktop environment..?

Because I want to use my desktop environment as my desktop environment. I've invested time and energy optimising it for my workflow and I'd like to continue to benefit from using it.

> non-browser desktops aren't as flexible or powerful or extensible as a browser

Again, I don't know what this means. My desktop is literally programmable. As in, I can edit and recompile the source code directly. Please tell me what's more powerful than that.

> they can run across many different platforms,...

I only need my apps to run on one platform

> ...and be easily distributed and efficiently used over the network (unlike Wayland or "modern" X11 apps).

`apt install my-x11-app my-wayland-app` `#include <sys/socket.h>`

Re:Wayland vs. X – Overview by marrs on Friday December 29, 2023 @11:17AM (#38806563)
I guess the term "sandbox" can become overloaded. I'm not thinking of OS processes as sandboxes in this context.

> However, that’s a big “if”, since most of the linux sandbox thingies take multiple seconds to spawn a process, and multiply memory usage by 10-100x.

And this is the thing I'm not willing to accept. Well, I can tolerate excessive memory consumption depending on what I'm doing, but I refuse to entertain long boot times. It's the main reason I avoid Java apps, Flatpacks, and so on.

Re:Wayland vs. X – Overview by DonHopkins on Saturday December 23, 2023 @09:59PM (#38750697)
I included a lot of links to my previous posts over ten years explaining what it means in lots of detail with many different words and numerous examples and citations.

Did you read any of them? Did you read my other explanation below that I just wrote personally for your benefit? Does it make any sense to you?

Do you understand what I mean now, or do you need me to give you some more citations of other times I've written the same thing, because there are more. What was unclear, and did I leave anything out?

Do you have any more questions I haven't answered time and again and already gave you links to but you just didn't bother reading?

It's exasperating and insulting that you blithely dismiss what I wrote without saying what you disagree with or can't understand, but I promise you, it really is easy to understand and extremely obvious on its face, if you will just take the time to read what I wrote, before complaining you don't know what it means.

If you have time to complain, then you have time to read what I wrote and linked to, before complaining you don't know what it means.

If you're too busy to read, then please don't waste your and my time complaining you don't understand what you didn't bother to read.

Re:Wayland vs. X – Overview by marrs on Thursday December 28, 2023 @08:38PM (#38800858)
I forgot about those links. No, I didn't look at them. I've taken a quick look now. They seem to be about X and everything that's wrong with it, which is fine, but I don't see much about browsers, and that's what I was responding to your comment about.

My experience with making an app work consistently across browsers is that it's hard work. Making it also work consistently with each OS it runs on is considerably harder. You want to guess how many times I've been asked to even consider either of those two things by a manager, let alone make them a priority? Never.

And going by my experience as a user of browser-based software, I'd say that's pretty normal across the industry.

And that's to say nothing of the fact that these apps are typically slow, cumbersome (by which I mean they throttle my CPU and drain my laptop battery), and crash no less frequently than unsafe apps written in unsafe languages like C (despite the fact that that's supposed to be impossible).

It seems to me that you want to rewrite the world in the browser. That doesn't seem very different to me from rewriting the world in Wayland. Whatever the differences between the two, they are insignificant besides the fallacy of rewriting the world.

As for the rest of your reply, I have no idea why you think I owe you however much time it would take me to read however many links you posted above. If you have something relevant to say, say it in the thread. Don't presume to leave it for me as a homework assignment.

Re:Wayland vs. X – Overview by simiones on Wednesday December 20, 2023 @09:36AM (#38709124)
My understanding is that any app which has access to X (so any windowed app) had full access to all other apps which have access. So, any app with a window can read the input from any other app on the same system, e.g. your sudo password. Or, take a screenshot of your bank info in Firefox.
Re:Wayland vs. X – Overview by ApolloFortyNine on Wednesday December 20, 2023 @09:54AM (#38709292)
The thing is a 'day 1' feature everyone hacks back in is clipboard sharing and screen share, each of which remove a decent chunk of these protections. Each essentially grants access to another apps data.

Plus the attack angle is someone having permission to execute apps on your machine, there's plenty of other nasty things they could do.

Re:Wayland vs. X – Overview by nolist_policy on Wednesday December 20, 2023 @10:26AM (#38709674)
> Plus the attack angle is someone having permission to execute apps on your machine, there's plenty of other nasty things they could do.

No, the attack angle is either a untrusted app running in a sandbox (fatpak, snap or crosvm or qemu with wayland passtrough[1]) with only a connection to the compositor or a trusted app running in a sandbox getting exploited, any apps handling foreign data is suspect here (Web browser, mail client, pdf, office suite, etc.).

[1] https://lore.kernel.org/qemu-devel/20231005024330.836-1-gurc...

Re:Wayland vs. X – Overview by aidenn0 on Wednesday December 20, 2023 @10:41AM (#38709845)
Everybody who uses web video conferencing will give their web-browser permission to record the screen. This already takes a huge chunk out of the security advantages. The advantage is not zero, but it doesn't seem to be as big of a win as one might want.
Re:Wayland vs. X – Overview by danShumway on Wednesday December 20, 2023 @01:54PM (#38712218)
> but it doesn't seem to be as big of a win as one might want.

That's a huge win. Firefox is a mainstream product with a ton of attention. And I get it from upstream repositories, it's not something I'm compiling myself.

If I can get away with giving 2-3 apps total on my computer screen recording permissions (OBS, Firefox, maybe a screenshot tool or an accessibility client), that is a massive reduction in attack surface, that would be a very large security win.

It would be great if the primary attack vector for recording my screen was an application with decades of sandboxing efforts going into preventing untrusted code from doing things like recording my screen without my knowledge.

Re:Wayland vs. X – Overview by aidenn0 on Wednesday December 20, 2023 @02:47PM (#38712772)
Firefox contains essentially 99+% of the untrusted application code I run, and I suspect this (or Chromium) is the case for many others too.
Re:Wayland vs. X – Overview by danShumway on Wednesday December 20, 2023 @03:18PM (#38713079)
Great! Firefox is also the app on my computer that does by-far the best job sandboxing untrusted code. It's good for us to be running most of our untrusted code in that environment, and even better for us to be blocking untrusted operations outside of that environment.

I genuinely don't understand the issue, it's a big security win if I can close off permissions on my system and have them open just for the apps that have good sandboxing around their untrusted code. Bonus points if the app in question allows per-domain screen recording permissions, which Firefox does.

I would go so far as to say that (one of) the reasons you run 99+% of your untrusted application code in Firefox is probably because Firefox is one of the very few places on your computer where it's safe to run that code. So it's a big win if we can start pulling some of those same sandboxing ideas into the native world; maybe that makes it easier to use more native apps for some tasks. It's a big win if I can treat apps on my computer the same way that I treat a random website.

Also keep in mind that "untrusted" is not a binary state. I pretty much only run apps on my computer that I "trust", but do they need to be able to record my screen? No, and I love the possibility of not needing to worry quite as much about what happens if they get compromised.

----

There's a somewhat strange notion here that because people do everything in the browser per-app privileges don't matter. But in fact, the reason the browser's security model works and the desktop's doesn't is because the browser has per-domain privileges and permissions, and it's not that per-app permissions don't matter, it's that they do matter and the lack of them is why we centralize untrusted code into one of the few apps on our computers that has per-"app" permissions. Browser permissions work because they are granular, you can grant Zoom access to record your desktop without granting access to Facebook.

So maybe if the desktop copies that, maybe far in the future you won't need to run everything in your web browser just to feel secure. But as it stands with X11 I feel a lot more comfortable using a browser to record my screen specifically because it has privileges and permissions around that are segmented per-domain/"app". The lack of sensible security controls on the desktop is a contributing factor to why people don't use the desktop, and being able to lock that in and restrict the scope of where screen recording can happen does make me feel a lot more secure about my desktop.

Re:Wayland vs. X – Overview by danShumway on Wednesday December 20, 2023 @01:47PM (#38712141)
> No, the attack angle is either a untrusted app running in a sandbox (f[l]atpak, snap or crosvm or qemu with wayland passtrough[1]) with only a connection to the compositor or a trusted app running in a sandbox getting exploited

Agreed. This debate is particularly frustrating because X11 vulnerabilities get brought up as an excuse for ignoring other sandboxing efforts, and then Wayland gets dismissed because of vulnerabilities when not using other sandboxing methods. You can't win!

----

Even if I'm giving my web browser full access to my computer, there are apps I want to sandbox without running them in a full VM. And there are multiple parts to this puzzle to get better security and sandboxing, but those sandboxing efforts don't work if I can't secure the most basic parts of the visual desktop. If someone is demanding perfect sandboxing before we start looking at X11, they're going to be waiting a long time because there is a limit to how much progress we can make in this area while X11 stays dominant.

And okay, sure, we're setting up clipboard access for web browsers, but I can turn that off. And then I can take advantage of flatpak, snap, qemu, whatever and I can at least get closer to actual sandboxing controls, even for non-malicious apps. And I can do partial sandboxing, which is also a good thing -- the idea that everything needs to be either fully separated from each other or have full permissions is just not a good approach to security, sometimes we partially trust things.

----

Linux security is like we're in a boat with multiple holes that are taking in water, and whenever anybody tries to plug one of the holes, critics jump out and say, "what's the point, if someone can execute apps on your machine, there's plenty of other nasty things they could do." And so you move to the other hole and somebody says, "what's the point, attackers can just record your desktop." There are multiple holes on the ship, let's start patching them.

Getting better sandboxing controls into Linux is something that is going to take time and that means we're going to be patching holes while other holes exist that we haven't gotten around to yet. There is a limit to what tools like Bubblewrap can do for a graphical app if it's hooked up to X11. And yeah, I want clipboard controls for my web browser, but also I run more apps on my computer than just a web browser, and different apps have different problems. It's not even just about exploits or malicious apps entirely, sandboxing is useful even just for setting up temporary builds or dealing with buggy code and the fact that we don't have perfect solutions shouldn't be an excuse to not improve the situation at all.

Re:Wayland vs. X – Overview by simiones on Wednesday December 20, 2023 @10:26AM (#38709671)
> The thing is a 'day 1' feature everyone hacks back in is clipboard sharing and screen share, each of which remove a decent chunk of these protections. Each essentially grants access to another apps data.

Oh, yes, it's very likely that Wayland will end up with the exact same vulnerabilities. It's very hard in fact to design a windowing system that allows rich interaction between apps, but still maintains per user access control (never mind actually implementing it).

Re:Wayland vs. X – Overview by jbverschoor on Wednesday December 20, 2023 @02:07PM (#38712345)
Ahh ok, I never knew that. That sounds horribly wrong.
Re:Wayland vs. X – Overview by vlovich123 on Wednesday December 20, 2023 @09:51AM (#38709262)
I believe there's work ongoing to upgrade to using H264 using MS's RDP protocol rather than VNC and getting that to work under wayland. That's waaaay better than X forwarding or VNC. if I recall correctly you've also got it backwards - I seem to recall X forwarding is much worse for higher latency networks than VNC.
Re:Wayland vs. X – Overview by yjftsjthsd-h on Wednesday December 20, 2023 @10:49AM (#38709951)
No, the big problem with X isn't the transport but that once a client has access to the X server it can do more or less anything it wants (including logging keyboard input and recording other windows).

And I haven't actually used it[0] but I thought waypipe was the better option for remoting?

[0] Well, successfully or recently; I'm assuming it's usable now.

Re:Wayland vs. X – Overview by addicted on Wednesday December 20, 2023 @09:28AM (#38709032)
From what I understand, and I’m no expert on this, X pretty much broke application sandboxing. X’s design was inherently insecure in the context of modern OS security practices.
Re:Wayland vs. X – Overview by chasil on Wednesday December 20, 2023 @12:40PM (#38711297)
OpenBSD does implement some kind of privilege separation for X.

  $ ps ax -ouser,args | awk 'NR==1;/X.*:/'
  USER     COMMAND
  _x11     /usr/X11R6/bin/X :0 vt05 -auth /etc/X11/xenodm/authdir/authfiles/A:0-PFzcIG (Xorg)
  root     X: [priv] (Xorg)
Re:Wayland vs. X – Overview by woodruffw on Wednesday December 20, 2023 @09:41AM (#38709169)
Without claiming that X is secure: I think it’s more accurate to say that X has never cared about application isolation at all, since it wasn’t (like its contemporaries) built with that paradigm in mind.

In other words: while not originally UNIX-y, X matured in an ecosystem that idiomatically treats every userspace program as a perfect proxy for the user agent themselves. Sandboxing is a foreign (but good!) idiom that’s being bolted onto that paradigm.

Re:Wayland vs. X – Overview by asveikau on Wednesday December 20, 2023 @09:38AM (#38709138)
I think you're phrasing that incorrectly. There was no application sandboxing for X to break. And you can't build sandboxing atop X.

You speak as if application sandboxing within the ever existed in the past... Not that people tried to build it and X doesn't play well with it.

Re:Wayland vs. X – Overview by gpderetta on Wednesday December 20, 2023 @09:52AM (#38709273)
I don't profess to have any deep knowledge of X11 or Wayland, but I don't understand how sandboxing can't work in X11. XWayland exists and it is either non-sandboxed (hence Wayland doesn't add any security benefit) or it is. And if it is it means that X can be sandboxed and it should be possible to run XonX sandboxes. Something like xnest.
Re:Wayland vs. X – Overview by asveikau on Wednesday December 20, 2023 @10:52AM (#38709993)
This is a very good comment.

I guess then the claim is more that no common implementation is amenable to sandboxing, and the compatibility break of a brand new protocol means they can implement it from day 1 in the way they like. Which is a lot weaker an argument, but practically speaking, it's true that no one is rushing to bolt on security features to X. To be clear I'm not realy a Wayland fan.

Re:Wayland vs. X – Overview by hedora on Wednesday December 20, 2023 @10:19AM (#38709599)
You certainly can build sandboxing atop X11. If you're reading using a web browser on a Linux desktop (or in a VM on a Linux desktop), then you're literally staring at an existence proof.
Re:Wayland vs. X – Overview by asveikau on Wednesday December 20, 2023 @10:48AM (#38709946)
I guess the point is it can't be sandboxed by directly exposing X protocol messages to the sandboxed app. Although your sibling comment by gpderetta makes an excellent point. I guess they're saying no one wants to sandbox the X protocol, and breaking compatibility, proponents would claim, lets you design a sandbox friendly protocol from scratch.
Re:Wayland vs. X – Overview by beeboobaa on Wednesday December 20, 2023 @10:31AM (#38709744)
> It's better now

So it actually works now? Last time I tried switch to Wayland I also had to switch from i3 to Sway which just flat out refused to run until I gave it some hilariously insane command line argument like --my-next-gpu-wont-be-nvidia, and even then just crashed.

Demanding your users buy different (expensive!) hardware is obviously a non-starter. Especially if you want to do ML. Good luck without an nvidia card.

Re:Wayland vs. X – Overview by account42 on Wednesday December 20, 2023 @10:32AM (#38709752)
> They needed to do this

Few things are ever truly needed. Those things don't include Wayland. That doesn't mean there are reasons for it but it does mean you can't just discard the downsides.

> Xorg was complicated

And Wayland will be complicated too by the time its mature. Especially when you include all the other compontents needed to provide the same functionality as X.org

> Xorg was [...] insecure

Under what threat model? Personally I have no interest in the zero-trust model needed for proprietary app stores and would rather not pay the cost.

> the maintainers moved on to Wayland

A lot of those maintainers are employed by Red Hat and other corporations. They moved because their employers have reasons to move to Wayland - those reasons don't neccessarily matter to all users.

> Nobody else wanted to take up the mantle of maintaining an X implementation.

Isn't it a bit early to pronounce that. X is mature software. It works just fine for most people. Why would you expect someone to immediately jump at messing with it?

Re:Wayland vs. X – Overview by bzzzt on Wednesday December 20, 2023 @10:47AM (#38709929)
> Under what threat model? Personally I have no interest in the zero-trust model needed for proprietary app stores and would rather not pay the cost.

Under the threat model of websites using browser exploits to grab other data on your system?

Or under the threat model of company policy or legislation not allowing you to handle confidential information on a system that can't offer even a basic guarantee of privacy.

Re:Wayland vs. X – Overview by account42 on Wednesday December 20, 2023 @11:00AM (#38710084)
> Under the threat model of websites using browser exploits to grab other data on your system?

Browsers already have multiple layers of sandboxes. You can always add another one to the browser if you are paranoid.

Personally I prefer not running untrusted javascript in the first place (where I can avoid it). An exploit that gains control of the browser is already a doomsday scenario if you are using the browser for internet banking, work or anything that matters. Being able to grab the input and output of other applications is a nothingburger in comparison.

> Or under the threat model of company policy or legislation not allowing you to handle confidential information on a system that can't offer even a basic guarantee of privacy.

Those are usually fine with running countless proprietary drivers and tools with root access. So in other words it's security threater.

Re:Wayland vs. X – Overview by bzzzt on Friday December 22, 2023 @02:54AM (#38731979)
There are more applications than a browser that can be exploited. Seems to me a secure GUI server is better than hardening thousands of applications.

I also prefer running trusted code, but that's not an option most of the time (for varying definitions of trust)

99% of the apps I use have no business with the contents of other apps I run so why allow it? Because X11 can't do anything about it is not a valid reason.

Re:Wayland vs. X – Overview by yjftsjthsd-h on Wednesday December 20, 2023 @10:58AM (#38710061)
> Or under the threat model of company policy or legislation not allowing you to handle confidential information on a system that can't offer even a basic guarantee of privacy.

Last I'd checked, Windows had the same security issues as X, so it's unlikely to come up.

Re:Wayland vs. X – Overview by bzzzt on Friday December 22, 2023 @02:49AM (#38731964)
Untrue. Windows has permissions for capturing the screen which you have to enable on a per-application basis.

Next to that Windows has an even stronger permission model regarding DRMed content. But thats only to please movie studios it seems...

Re:Wayland vs. X – Overview by bufio on Wednesday December 20, 2023 @09:17AM (#38708928)
Has Wayland fixed the fact that compositing sucks by definition?
Re:Wayland vs. X – Overview by SilverCode on Wednesday December 20, 2023 @09:50AM (#38709252)
"combine (two or more images) to make a single picture, especially electronically" ... sucks?

I can't even begin to think how you would present multiple windows to a user if you didn't composite them into a single image. Even if you are doing a 3D virtual desktop, you still have to composite the layers down to 2 single slightly offset images.

Re:Wayland vs. X – Overview by account42 on Wednesday December 20, 2023 @10:48AM (#38709945)
Compositing in the context of window management hase a more specific meaning:

https://en.wikipedia.org/wiki/Compositing_window_manager

vs.

https://en.wikipedia.org/wiki/Stacking_window_manager

There are advantages and disadvantages to both approaches. Note that X.org is traditionally a stacking window manager but has had the compositing model bolted on for a long time now.

Re:Wayland vs. X – Overview by yencabulator on Wednesday December 20, 2023 @05:14PM (#38714348)
Compositing WM is not "versus" stacking WM. Practically all mainstream Wayland desktops are floating ("stacking") based UI paradigms, while using compositing to construct the final screen image. The wikipedia article you linked to shows examples of stacking window management on the compositing window manager page!

Are you thinking of tiling WMs? The major tiling Wayland compositors support floating windows when you want them, too.

Re:Wayland vs. X – Overview by account42 on Thursday December 21, 2023 @03:55AM (#38718360)
No, from the Wiki article on stacking WMs (empahsis mine):

> A stacking window manager (also called floating window manager) is a window manager that draws and allows windows to overlap, without using a compositing algorithm. All window managers that allow the overlapping of windows but are not compositing window managers are considered stacking window managers, although it is possible that not all use exactly the same methods.

It's possible that you have another definition but for me (and it seems for Wikipedia) the distinction is that a stacking WM does not keep buffers for individual windows but instead has them draw directly into the desktop buffer (details vary, the programs themselves might not have access to the buffer but send pixmaps that get blitted there). This results in lower resource usage and fewer copies but requires programs to redraw newly exposed regions when you move a window which may result in visible artifacts when programs cannot render fast enough.

Re:Wayland vs. X – Overview by Zambyte on Wednesday December 20, 2023 @09:58AM (#38709340)
Sure, if you don't like composition you could use something like cage[0]

[0] https://www.hjdskes.nl/projects/cage/

Re:Wayland vs. X – Overview by acdha on Wednesday December 20, 2023 @09:48AM (#38709220)
What useful discussion were you expecting from this question? All major window managers use compositing so clearly “sucks” cannot be globally true. Is there some specific problem that you have encountered?
Re:Wayland vs. X – Overview by wffurr on Wednesday December 20, 2023 @09:31AM (#38709061)
“Sucks” I mean if you want tear free rendering there’s not a lot of choices other than compositing.
Re:Wayland vs. X – Overview by mouse_ on Wednesday December 20, 2023 @09:31AM (#38709063)
X was so insecure that wayland maintainers must now work tirelessly to roughly emulate these insecurities such as taking screenshots and sharing their desktop in their new protocol.

Don't get me wrong; I don't like X, but if I had it my way we'd all be using Haiku with a Linux or BSD kernel right now.

Re:Wayland vs. X – Overview by BenjiWiebe on Wednesday December 20, 2023 @09:46AM (#38709208)
If those are insecurities, I want an insecure desktop. I use my computer to get things done, not be a paradigm of security.
Re:Wayland vs. X – Overview by vlovich123 on Wednesday December 20, 2023 @09:56AM (#38709323)
Those aren't inherently insecurities, but the way X implemented them was quite insecure. Wayland is now having to do the heavy lifting of defining a secure protocol to implement it and migrating the entire Linux GUI ecosystem to using the new mechanisms. Also, I can take screenshots just fine on Wayland via KWin. I can't pick arbitrary 3p apps just yet but KWin's screenshotter is fine. Not sure about screen recording as I haven't needed that. VNC-style applications don't work but if you do a search you come up with sunshine+moonlight which uses Nvidia's protocol + H264 streaming.
Re:Wayland vs. X – Overview by troyvit on Wednesday December 20, 2023 @10:36AM (#38709802)
> Wayland protocols hit 1.0 in 2015 and [...] (from further up in the thread[1])

> Also, I can take screenshots just fine on Wayland via KWin. I can't pick arbitrary 3p apps just yet but KWin's screenshotter is fine.

Maybe in another nine years Wayland users can choose whatever screenshot tool they want. X is annoying but I'd go crazy if that was my life.

[1] https://news.ycombinator.com/item?id=38709188

Re:Wayland vs. X – Overview by nolist_policy on Wednesday December 20, 2023 @10:51AM (#38709979)
You can wait 9 years and have a low chance of your screenshot tool working on Wayland.

Or you can use a different tool that supports Wayland now.

Or you can can add Wayland support to your favorite tool now (assuming it's open-source).

Re:Wayland vs. X – Overview by account42 on Wednesday December 20, 2023 @10:54AM (#38710020)
"secure" really has become a buzzword.

> Those aren't inherently insecurities, but the way X implemented them was quite insecure.

In what way does X.org add any security holes to the average Linux desktop where you have programs (from a trusted package repository) which can access everything your user account can?

Re:Wayland vs. X – Overview by vlovich123 on Wednesday December 20, 2023 @10:40PM (#38716743)
You get that not every program invoked on a desktop necessarily comes by that way right? But that’s not actually the core problem. I trust you can do your own research as to what the security issues are, but as a starter here’s https://www.ctrl.blog/entry/clipboard-security.html

These are very old issues and are some of the major reasons Wayland was started in the first place. May want to read up on what the problems identified by the project were when it started considering all X maintainers migrated their time and energy to Wayland.

Re:Wayland vs. X – Overview by account42 on Thursday December 21, 2023 @04:05AM (#38718426)
I am well aware of what programs with access to my computer can do. That's why I use programs from sources I trust.

I have zero interest in a low trust computing model because that comes with a cost to usability and performance, especially for power users but not also for others.

I also get that most commercial software developers these days should be treated as adversaries because they will break any trust you place in them. The correct response to that should be to not use their software or to create and enforce laws to get them to behave. This is really no different to anti-social behavior outside cyberspace - we have laws and police to enforce them precisely so that we can walk the streets alone without fear and leave our homes unattended. The degree of that safety varies greatly around the world and I much prefer living in places where I don't have to have bars in front of my windows. The same applies to computers.

Re:Wayland vs. X – Overview by dale_glass on Thursday December 21, 2023 @08:51AM (#38720353)
This is not practical for most people.

Eg, this completely excludes Steam. Laws aren't a good way to deal with the issue because they don't prevent damage. Try and sue some guy living in Russia.

Re:Wayland vs. X – Overview by biblbroxxx on Wednesday December 20, 2023 @11:03AM (#38710114)
Spectacle can record a screen, too. It works fine in general, but I had some issues with applications that were running with Xwayland.
Re:Wayland vs. X – Overview by anthk on Wednesday December 20, 2023 @10:59AM (#38710077)
Again, I said this multiple times: XTerm/UXTerm has a secure mode to lock all input.
Re:Wayland vs. X – Overview by foul on Wednesday December 20, 2023 @12:28PM (#38711113)
Way way better than Xorg, but sooner or later 3D has to come to unix-world.