Please consider subscribing to LWNSubscriptions are the lifeblood of LWN.net. If you appreciate thiscontent and would like to see more of it, your subscription willhelp to ensure that LWN continues to thrive. Please visitthis page to join up and keep LWN onthe net.
Martin Peres and Timothée Ravier's session on day one of XDC2012 lookedat security in the graphics stack. They considered user expectations aroundsecurity in the graphical user interface (GUI), reviewed these expectationsagainst the implementations in X11 and Weston (the reference compositingwindow manager for Wayland), and covered some other ground as well. Martinbegan their presentation by noting that they had done quite a bit ofresearch on the topic, and although they are Linux security engineersrather than X developers, he expected that they would nevertheless haveuseful things to tell the audience.
Martin began with a review of security on the X server that focused onthe three classical areas: confidentiality, integrity, and availability.In each case, he described security weaknesses in the X server.
Starting with confidentiality issues, Martin used the example of a userentering a credit card number while shopping online. In this case, thecredit card number could be stolen if a key logger was running on themachine, or another program was taking screen shots periodically. Thisviolates the user's expectations of the GUI: applications should not beable to spy on each other's input events or output buffers. From theuser's point of view, the only time that arbitrary applications shouldobtain information from one another is under explicit user control (forexample, cut-and-paste). However, under X11, any application that canprovide themagiccookie generated by the X server has full access to other applications'input and output. In other words, X11 provides isolation only betweenusers, not between applications run by the same user. Thus, anyapplication that is launched by the user has the potential to breakconfidentiality in the manner of the credit card example.
Martin's second example concerned application integrity. A uservisits a bank web site, and, being a sophisticated user, carefully checksthat the URL shown in the browser's address bar shows "https" plus thecorrect domain. However, the user is unaware that they are visiting a fakedomain, and that the browser's address bar has been redrawn by a maliciousapplication. Consequently, the user's bank information is passed to athird party. This can happen under X11's Digital Rendering Infrastructure(DRI) version 1. (This problem is addressed in DRI2, which has been thedefault for a few years now.) In addition, virtual keyboards can injectinput to the X server; since the X server broadcasts input events, thevirtual-keyboard input can reach any application (just like a realkeyboard).
Martin's third point was that applications should not be able to makeother applications or the entire system unavailable. Under X11,applications can, however, act as screen lockers, denying access to thesystem. In addition, in the past, a virtual keyboard was able to killother applications using theXF86ClearGrab feature that wasintroduced in X server 1.11 (a feature that led toa high-profile security flaw that made itpossible to break into a screen-locked system by typing a particular keycombination).
At this point, Timothée took the lead to discuss techniques that havebeen developed to mitigate these security problems. The first of theapproaches that he described wasXSELinux. XSELinuxprovides finer-grained control within the X server, allowing control overfeatures such as drag-and-drop or access to the mouse. However, the levelof control provided by XSELinux is still too coarse-grained to be useful:it allows per-application control of access to X features, but cannot (forexample) restrict input to the currently selected application.Consequently, it is either not provided, or disabled, in mostdistributions. A sometimes recommended alternative for confiningapplications that use the X server isXephyr, whichimplements sandboxing by launching an X server inside another Xserver. Although this provides a good degree of isolation betweenapplications in different sandboxes, a sandboxing solution has problems ofits own: it becomes complicated to share information between applicationsin different sandboxes.
Timothée went on to describe two projects that have tried, in differentways, to bring greater security to the X server: QubesOS and PIGA-OS.Both of these projects aim to confine applications, control whichapplications can access input buffers of other applications, and so on.
QubesOS groups applications into"domains" that have similar levels of security. Each domain runs its Xserver in a separate Xen virtual machine. For example, surfing the web ina browser would be conducted in a low-security domain, while readingcorporate email is done in a separate, higher-securitydomain. Functionality such as cut-and-paste and drag-and-drop betweendomains is provided by means of a daemon that runs in the privileged dom0virtual machine that implements mandatory access control. QubesOS providesa high degree of isolation between applications.
However, Timothée described a number of drawbacks to QubesOS. It requiresmany virtual machines, which results in slow performance on desktop andlaptop systems. It is not feasible on mobile systems, because of heavyresource-usage requirements and the almost-mandatory requirement forhardware-assisted virtualization in order to achieve satisfactoryperformance. Furthermore, one can't be sure that Xen can isolate virtualmachines, so there might be ways to access buffers in other virtualmachines.
PIGA-OS [PDF], asystem that Martin and Timothée have worked on, takes a different approachfrom QuebesOS. Each application is placed in a separate SELinux domain andXSELinux is used to provide confinement in the X server. SELinux plusXSELinux provide many of the pieces needed for a secure X server, but somepieces are still missing. Therefore, PIGA-OS adds a daemon, PIGA-SYSTRANS,that grants rights to applications and prompts users when they switchbetween different domains as a consequence of their activities.
PIGA-OS has some notable advantages. It does not require virtualmachines. It dynamically adjusts (under user control) the permissions ofapplications according to the user's activity. However, a significantdownside of the PIGA-OS approach is that it requires quite some effort toset up the global SELinux policy that governs applications andactivities. (This is a one-time effort, but the policy must be updated ifan application acquires new features that require new types of privilegedaccess.)
Timothée then turned to the subject of theWayland, the display server protocol positedas a replacement for X11, and Weston, the reference implementation of thecompositing window manager for Wayland. His goal was to look at how Waylandand Weston have fixed some of the problems of the X server described aboveand outline the problems that remain.
Timothée divided up the discussion of security somewhat differently inthis part of the presentation, beginning by talking about the security ofinput in Wayland/Weston. On this front, the new system is in goodshape. Because Weston knows where applications are on the screen, it isable to decide which application should receive input events (this differsfrom the X server). This defeats key logging applications. Regardingintegrity of input, the kernel limits access to the two main sources(/dev/input and/dev/uinput) to the root useronly. Because Wayland/Weston does not (yet) support virtual keyboards it isnot (yet) possible to forge input. (The topic of virtual keyboards wasrevisited later in the talk.)
On the output side, Timothée observed that Weston does have someproblems with confidentiality and integrity. Weston uses theGraphics Execution Manager (GEM) to shareapplication buffers between the compositor and applications. The problemis that GEM buffers are referenced using handles that are 32-bitintegers. These handles can be guessed (or brute-forced), which means thatone application can easily access GEM buffers belonging to otherapplications. Martin noted that this problem would be resolved if and whenWeston moved to the use ofDMABUF (DMA buffersharing).
Timothée then considered how Weston should deal with applications thatneed exceptional handling with respect to security. The first of these thathe covered was virtual keyboards, which are pseudo-devices that arepermitted to send input events to the compositor. He made the general pointthat virtual keyboards should be "included" in the compositor, so that thecompositor knows that it can trust the input they provide. Peter Huttererraised a potential problem: each natural language (with a unique characterset) requires its own virtual keyboard, and it seems that every few monthssomeone starts a new virtual keyboard project for another language, withthe result that adding keyboards to the compositor would be a never-endingtask. In response, Timothée and Martin refined what they meant by"include". The compositor must not trust just any application to be avirtual keyboard. Rather, since the compositor knows which applications itis launching, it can choose which applications it will trust as virtualkeyboards. Peter agreed with this approach but noted that there may be some(solvable) complexities, since, when dealing with a multilingual user, aswitch from one language to another may involve not only a switch ofvirtual keyboards, but also a switch of the background framework thatgenerates input events.
Weston does not yet support screen-shot applications, but when thatsupport is added, some care will be needed to avoid confidentiality issues.Timothée's proposal was similar to that for virtual keyboards: thecompositor would allow only trusted applications that it has launched tomake screen shots. Again, there must be a method for specifying whichapplications the compositor should trust for this task.
Global keyboard shortcuts present a further problem. For example,media players commonly use keyboard shortcuts to provide functionalitysuch as pausing or skipping to the next track. Typically, media players are notvisible on the screen, and so do not receive input eventsdirectly. Therefore the compositor needs a way of registering specialkeystroke combinations and passing these to applications that haveregistered them. The problem is that this sort of functionality can allowthe implementation of a different kind of key logger: a maliciousapplication could register itself for many or all keystrokecombinations. Again, there needs to be a way of specify which applicationsare allowed to register global keyboard shortcuts, and perhaps whichkeystroke combinations they may register. Further complicating the problemis the fact that the user may change the global keyboard shortcuts that anapplication uses. Timothée said they had no solution to offer for thisproblem.
Peter Hutterer suggested what he called a "semantic approach" to theproblem, but noted that it would require a lot more code. Instead ofallowing applications to register keystroke combinations, the compositorwould maintain a global registry where applications would register to saythat they want to be notified for events such as "undo" or "cancel", andthe compositor would control the key that is assigned to the event. Thishas the potential advantage that shortcuts could be consistent acrossapplications. On the other hand, there will likely be conflicts betweenapplications over deciding which events are which. Peter noted that the GTKproject is currently doing some work in this area, and it may be worthcontacting people working on that project.
The situation with screen-locking applications is similar toscreen-shot applications. Currently, Weston does not support screenlocking, but when that support is added, there should be the notion ofhaving a restricted set of applications that the compositor permits to lockthe screen. Indeed, since the screen-locking code is typically small, andthe requirements are fairly narrow (so that there is no need for multipledifferent implementations), it may be sensible to implement thatfunctionality directly inside the compositor.
Timothée summarized the proposals for controlling application securityin Wayland and Weston. There should be a mandatory access control (MAC)framework as in theXAccess Control Extension (XACE). Suitable hooks should be placed in thecode to allow control of which applications can interact with one anotherand interact with Wayland to perform operations such as receivinginput. The MAC framework should be implemented as a library, so that accesscontrol is unified across all Wayland compositors.
Timothée ran through some of the factors blocking rootless Weston. Oneproblem is that Weston needs access to/dev/input, which isaccessible only to root. Root privilege is also required to send output tothe screen and to support hot plugging of keyboards and screens. Thesolution he proposed was to isolate the code that requires root privilegesinto a separate small executable that is run with root privileges. In thecase where Weston needed access to a privileged file, the small executablewould then open the required file and pass a file descriptor viaa UNIX domain socket to Weston. There was little comment on this proposal,which may signify that it seemed reasonable to everyone present.
Martin returned to the microphone to talk about hardware and driversecurity. He began with the simple observation that graphics drivers andhardware should not allow privilege escalation (allowing a user to gainroot access) and should not allow one user to read or write graphicsbuffers belonging to another user. Various platforms and drivers don'tlive up to these requirements. For example, on the Tegra 2 platform, theGPU permits shader routines to have full read and write access to all ofthe video RAM or all of the graphics-hosting RAM. Another example is theNVIDIA driver, which provides unprivileged users with access to nearly allof the GPU registers.
Martin emphasized the need for a sane kernel API that isolates GPU users anddoesn't expose GPU registers to unprivileged users. GPU access to RAM alsoneeds to be restricted, in order to prevent the GPU from accessing kerneldata structures. (The lack of such a restriction was the source ofthe recent vulnerability in the NVIDIA driver thatallowed root privilege escalation.)
One approach to isolating GPU users would be to apply a virtual-memorymodel to video memory, so that applications cannot touch each other'smemory. This approach provides the best security, but the problem is thatit is not supported by all graphics hardware. In addition, implementingthis approach increases context-switching times; this is a problem forDRI2, which does a lot of context switching, and for Qt5, where allapplications that use QML (which is the recommended approach) have anOpenGL context. TheNouveaudriver currently takes this approach, and some other modern GPUs are alsocapable of doing so.
An alternative approach for isolating GPU users is for the kernel tovalidate the user commands submitted to the GPU, in order to ensure thatthey touch only memory that belongs to the user. This approach has theadvantage that it can be implemented for any graphics hardware andcontext-switching costs are lower. However, it imposes a higher CPUoverhead. Currently the Radeon and Intel drivers take this approach.
Moving to another topic, Martin observed that a GPU buffer is not zeroedwhen it is allocated, meaning that the previous user's data is visible tothe new user. This could create a confidentiality issue. The problem isthat zeroing buffers has a heavy performance impact. He suggested twostrategies for dealing with this: zeroing deallocated buffers when the CPUis idle and using the GPU to perform zeroing of buffers. Lucas Stachpointed out that even if one of these strategies was employed, on embeddeddevices the memory bandwidth required for zeroing buffers was simply toogreat. Martin accepted the point, and noted that the goal was to allow theuser to choose the trade-off between security and performance.
The final topic of the presentation concerned plug-ins. Since thecompositor has full access to input events and application output buffers,this means that compositor plug-ins potentially have the same access, sothat a (possibly malicious) plug-in could cause a securityvulnerability. Martin said that they didn't have too many concreteproposals on how to deal with this, beyond noting that, whenever possible,plug-ins should not have access to user inputs and output buffers. Hesuggested thataddress-spacelayout randomization inside the GPU virtual memory may help, along withkilling applications that access invalid virtual addresses.
In some concluding discussion at the end of the session, Matthieu Herrbremarked that most X11 applications are not ready to handle errors fromfailed requests to the X server, and that if the graphics server is going toimplement finer-grained access control, then it's important thatapplications have a good strategy for handling the various errors that mayoccur. Martin agreed, adding "We don't want to fix X; it's notpossible. We can't ask people to rewrite [applications]. But with Waylandbeing new, we can do things better from day one.
"
From the various comments made during the presentation, it's clear thatthe X developers are well aware of the security problems in X11. It's equallyclear that they are keen to avoid making the same mistakes in Wayland and Weston.
The X.Org wiki haspointersto the slides and video for this presentation, as well aspointersto the slides and video for a follow-on security-related presentation(entitled "DRM2").
| Index entries for this article | |
|---|---|
| Kernel | Wayland and Weston |
| Security | Graphics |
| Security | X server |
| Conference | X.Org Developers Conference/2012 |
Posted Sep 25, 2012 22:25 UTC (Tue) byJohnLenz (guest, #42089) [Link] (1 responses) This has the advantage of using already existing authentication infrastructure (policykit) and not force weston to define an explicit list of events. Posted Sep 26, 2012 13:52 UTC (Wed) bymupuf (guest, #86890) [Link] However, a lot of work is left to be done on all this matter. We don't pretend to understand every valid use cases and the need of every applications so I may not be able to understand your point. Posted Sep 26, 2012 11:23 UTC (Wed) byk3ninho (subscriber, #50375) [Link] (4 responses) Is that 'zero-ing when not busy' actually a request for an in-kernel TRIM thread? Such a thread might also need to make promises about when its work eventually gets done, but that could be mitigated with a fallback plan for a on a busy system: explicitly wipe the memory before it's re-used. Do I hear "show me the code"? Ken. Posted Sep 26, 2012 13:43 UTC (Wed) bymupuf (guest, #86890) [Link] The wiping process should be run on the whole VRAM at boot time and then can be scheduled when the pool of wiped pages is getting low. This should lower the number of wiping and thus, lower the VRAM bandwidth usage. On the other hand, if we want all buffers to be wiped at allocation time, then we can lower the allocation complexity at the expense of memory-bandwidth usage (more wiping are needed). Posted Sep 26, 2012 16:16 UTC (Wed) bygioele (subscriber, #61675) [Link] (2 responses) A more general question: why are GPUs being treated differently from CPUs or coprocessors? We are there: GPUs need scheduling, process compartmentalisation, per-user limits, and so on, just like CPUs. It looks like people are reinventing everything on GPUs instead of just extending the existing concepts (if not code) to GPUs. Posted Sep 26, 2012 16:42 UTC (Wed) bymupuf (guest, #86890) [Link] (1 responses) In the end, we are "reinventing the wheel" but the concepts still holds (I didn't have the idea overnight for VRAM sanitization). However, the code is completely different because GPUs are more complex than CPUs. As for why GPUs aren't considered like CPUs, the reason is that they are built for throughput and aren't ready for being considered as a new processor (allmost no GPUs support preemption). We are slowly but surely going towards this direction but it is too early for us to design an API that would accommodate for both CPUs and GPUs. In the end, we can say that we indeed extend the already-existing CPU concepts to GPUs but it takes time and the GPU ecosystem is much fragmented than the CPU world. Moreover, most GPUs (if not all), aren't ready to be considered as an equivalent of the x86 (not even remotely). Posted Sep 27, 2012 16:37 UTC (Thu) byortalo (guest, #4654) [Link] But even if common hardware protection features are not (uniformly at least) available on GPUs, from what we know about other hardware, it seems that memory protection and priviledged instructions are foundational features for practical security mechanisms. If these features are not in the hardware I wonder if it's even possible to adress the issue of graphics stack security for multiple applications without: By the way, maybe option 2 is really workable in the context of graphical applications. Maybe there is a need for a risk/attacks analysis at a higher level and more thinking about the most important security features in order to provide a decent (if not completely satisfactory) implementation. For example, I would not mind trading a long context switch time (~1s) for access to full hardware control for a fullscreen application (game) while I may be reluctant to do that for a text editor and framebuffer security may even be a reason not to use a GUI for an encryption tool. Posted Sep 26, 2012 17:00 UTC (Wed) bydlang (guest, #313) [Link] (23 responses) you want to be able to do screenshots, or even create a video of what you are doing. you want to be able to have one application take over the screen and not let you do anything else, without that you couldn't have 'screensavers' that are also session locks. Kiosk mode for applications could not be done, etc. virtual keyboards are extremely useful in some cases. the problem isn't the capability for _some_ program to do these things, it's the capability for _any_ program to do these things. you shouldn't have to through out the capability to do these things, just change the control. X already requires the "magic cookie", so there is enough mechanism in place to allow this to work, we just need to change things so that you don't use the same cookie for every app, and don't give every cookie the same permissions. It would be best if this ability wasn't tied to SELinux (I'm not sure if XSELinux is, or is just a similar name) Posted Sep 26, 2012 17:50 UTC (Wed) byluto (guest, #39314) [Link] (6 responses) IMO this belongs in the compositor, not as a separate application. Screensavers / screenlockers are fragile and buggy on X right now [1][2]. If the (Wayland-style) compositor handled screen locking, then, if the compositor crashed, you're still secure -- the whole session goes away. [1] See, for example, the old bug where funny key combos caused the screen to unlock. That being said, I mostly agree with the rest of your comments. File descriptors might be a nicer way to handle permissions than magic cookies, though. Posted Sep 26, 2012 19:04 UTC (Wed) bydlang (guest, #313) [Link] (5 responses) the 'funny key combos cause the screen to unlock' were not an accident, that was a deliberate feature for debugging that accidently got enabled by default. as one of those people who routinely uses X remotely, file descriptors have a significant problem ;-). There's nothing inherently wrong with cookies, just with the permissions being the same for all apps from a single user. Posted Sep 26, 2012 20:03 UTC (Wed) byluto (guest, #39314) [Link] Or the compositor could have specific support for pluggable screensavers. In any case, I think that the Wayland compositor will end up being more line gnome-shell than compiz, so you may not have a choice anyway. Except that it was a feature to release screen grabs, which ought to be harmless for anything except screen lockers. Presumably this will get solved the same way as the rest of Wayland remoting which, AIUI, doesn't really exist right now. Maybe magic cookies would still be better for the remoting server, whatever it is, to tell what privileges its clients have. Posted Sep 28, 2012 9:15 UTC (Fri) bymjthayer (guest, #39183) [Link] (2 responses) If you put the cookie in a file in the user's home directory, as is done for the current X server cookies then yes. If you imagine different cookies for different privileges (reading from the screen, sending input events, whatever) there is no reason why there should not be different mechanisms for the clients which need them to obtain them. For example you could put them in global files readable only to a particular user group, or you could use DBus and PolicyKit to pass them (just an example, as I know that DBus and remote X don't get along very well at present), or even both. Posted Sep 28, 2012 19:13 UTC (Fri) bydlang (guest, #313) [Link] (1 responses) putting the cookie in one file and having all apps read it from that file would seem to match my criteria for a problem. But there's nothing saying that you couldn't have a different cookie for each app, and then give different cookies different permissions. this wouldn't be a matter of 'user this cookie for screenshots' type of thing, but a matter of 'application X was given cookie Y, application X is a screenshot app, so allow cookie Y to do screenshots' Assuming apps do something sane and only read this cookie once at startup, you could replace the file they read it from with something that's an interface to an application that can use SCM_CREDENTIALS to find out what app is talking to it, and return different contents to different apps. You can then have that program either give a different cookie to every app, or make whatever policy decisions it wants about what cookies to give to different apps. Posted Sep 28, 2012 19:28 UTC (Fri) bymjthayer (guest, #39183) [Link] Quite right; in fact my mind was on the track of SETGID or similar applications, but thinking again that is probably not such a great idea in this context. Posted Oct 1, 2012 4:27 UTC (Mon) byraven667 (subscriber, #5198) [Link] As I recall xscreensaver supports its different timewasters by each being an external program from the main screen lock, it would seem that a lock implemented in the compositor would likely operate the same way. The screen lock itself has a very well defined function and UI and could easily be hardwired in, especially if that gets rid of a bunch of failure cases. Posted Sep 26, 2012 17:51 UTC (Wed) bydpquigl (guest, #52852) [Link] (4 responses) Posted Sep 26, 2012 23:43 UTC (Wed) bymupuf (guest, #86890) [Link] (3 responses) The point of the presentation wasn't to fix X, it was to fix DRM, to talk about security in Wayland and discuss about a security policy for it. Posted Sep 27, 2012 0:15 UTC (Thu) bydlang (guest, #313) [Link] (2 responses) While I expect that doing checks on these half dozen or so 'special' priviledges would break a few things, I don't think it would be that many, and if the capaibility was available, distros would experiment with them. After all, we know that SELinux breaks things, but it's being deployed. I would expect that SELinux has broken far more things than a handful of permission checks in X would. this writeup makes it sound like it was talking about problems in X not in the DRM layer. Posted Sep 27, 2012 9:56 UTC (Thu) bySiosm (subscriber, #86882) [Link] I don't think we will be able to fix the input problems in X. SELinux is mostly used in a "targeted" way in Red Hat/Fedora, and thus does not protect GUI apps. It is a lot of work to create and maintain an SELinux policy for every GUI applications. The second talk deals with DRM problems. This one was done to recap known problems and make sure we do not do the same "mistakes" with Wayland/Weston Posted Oct 1, 2012 4:33 UTC (Mon) byraven667 (subscriber, #5198) [Link] Most SELinux permissions checks happen where applications should already expect them to be occurring such as on filesystem objects. Putting in permissions where there weren't any before and where there is a lot of backwards compatibility requirements for very old software seems like a very bad idea and quite likely to break the world. Posted Sep 26, 2012 19:06 UTC (Wed) bydlang (guest, #313) [Link] (3 responses) Server-side window decorations have the potential to label each window as to what app it is part of (users may still ignore the data, but at least it can't be faked by the app) but if you either allow the client to tell the server what to label a window, or do client-side decorations where the client is in full control, it's impossible for the user to be able to trust any window completely. Posted Sep 26, 2012 23:59 UTC (Wed) bymupuf (guest, #86890) [Link] As you said, this is fixable with server-side decoration rendering but it isn't when the client renders everything. I guess we could actually display the name of the binary in the compositor when hovering the mouse on top of the application bar but that's not obvious to most users. Posted Oct 1, 2012 4:38 UTC (Mon) byraven667 (subscriber, #5198) [Link] (1 responses) IIUC applications can set their window title or argv[0] to anything they want and I don't think that's a feature that would likely be dropped making the point moot. Posted Oct 1, 2012 8:51 UTC (Mon) byrenox (guest, #23785) [Link] And in a secure environement with server side decoration, this application's provided tittle can either be ignored or be added in addition to a color or text which provide the server's view of the application. That said, one could have virtual desktop/environment which would group application by security level even with client side decoration, of course for single applications this is annoying.. Posted Sep 26, 2012 19:11 UTC (Wed) bydlang (guest, #313) [Link] (3 responses) what if you are trying to create a video to demonstrate how to use the bank website? This is why the mantra "provide mechanism not policy" exists. Posted Sep 26, 2012 19:35 UTC (Wed) byjg (guest, #17537) [Link] (2 responses) Posted Sep 26, 2012 21:24 UTC (Wed) bydlang (guest, #313) [Link] (1 responses) Just don't make the mistake of thinking that those common use cases are the only use cases. I remember listening to you talk at some USENIX event a decade or so ago and talking about all the new things that were popping up on desktop systems (transparent terminal windows and similar IIRC) and you commented that when developing X you not only never considered such things, but if asked you would have said that it wasn't possible. Because the mechanism was flexible enough, new things that the initial developers never imagined were possible. It seems like a lot of people have forgotten that. Ubuntu is the force that it is today, not because they were doing any hard technical things that nobody else was doing, but in large part because they were offering sane defaults (with some technical effort in automating configs and device detection) that nobody else was doing at the time. Posted Sep 27, 2012 10:03 UTC (Thu) bySiosm (subscriber, #86882) [Link] As said in the article, the goal in not to prevent people from adding things to Wayland/Weston, but to deny access to security-related features by default, and to provide a way for distribution/developers to make sure access to those features is allowed, by default, only the applications really requiring it, not just any application. Posted Sep 26, 2012 20:18 UTC (Wed) byraven667 (subscriber, #5198) [Link] (2 responses) Posted Sep 26, 2012 23:40 UTC (Wed) bymupuf (guest, #86890) [Link] (1 responses) Well, I'm not in violent agreement with one them, I am one of them (Martin Peres). I'm here to clarify our views if needed. Posted Oct 1, 2012 3:54 UTC (Mon) byraven667 (subscriber, #5198) [Link] Posted Sep 27, 2012 10:44 UTC (Thu) bydgm (subscriber, #49227) [Link] (10 responses) Having insecure input and output, _in_addition_ to secure ones, is clearly desirable and good. Let applications chose. Posted Sep 27, 2012 13:42 UTC (Thu) bymupuf (guest, #86890) [Link] It's like saying that applications should be able to decide if they want raw access to disks or not. Willing to do so is suicidal. Posted Sep 27, 2012 14:50 UTC (Thu) bySiosm (subscriber, #86882) [Link] (5 responses) If it's not enabled by default, nobody will use it because it won't get testing and bugs won't be fixed. Only a very limited set of applications has to be "locked down" in the Wayland/Weston case. Any "classic" application won't even notice the change. This is hardly comparable. On a classic *nix system, you use different users to separate tasks which should not interact with each others. Communications channels between users (pipes...) must be explicitly created, most of the time by the most privileged user. Without MAC (Mandatory Access Control) there is no confinement between applications from the same user. With GUI applications, everything runs under the same user, so we can not rely on user separation anymore. In the Wayland/Weston case, only explicit user controlled channels allow interactions between applications (drag&drop, copy&paste). Again, people will naturally choose the easy way over the hard way. In order to work, security has to be default built-in design feature which should make common operation easy, and control uncommon operations. Posted Sep 28, 2012 10:34 UTC (Fri) bydgm (subscriber, #49227) [Link] (4 responses) Sorry for the harsh words, but this is the LAMEST possible argument you could make. If it was useful for someone people would use it. If it's not used it's because it's not useful, so we're all better without it. This strategy did not work all that well for GNOME, please do not repeat this mistake again. Nope, you got it wrong. Take virtual keyboards, for instance. Currently they are not possible in Wayland because it has been decided that the compositor should not touch input in any way, applications receive it directly from the kernel. This decision effectively locks down _all_ applications, even those for which input integrity is of no use. This does not need to be this way. And that is, the ability to pass information between applications, is what makes them useful. What we need is a mechanism to confine _selected_ applications. True. Also, people chose what works over what does not. Posted Sep 28, 2012 21:54 UTC (Fri) byCyberax (✭ supporter ✭, #52523) [Link] And that's good. You can implement a virtual keyboard right way, by writing a CUSE driver. This way every app in the system will be able to access it. Or you can extend the compositor to do this. Posted Oct 1, 2012 4:08 UTC (Mon) byraven667 (subscriber, #5198) [Link] (1 responses) It may be lame but it's true, non-default options don't get as much testing as default options, especially in volunteer-tested software, the less-used code paths are more likely to be buggy. Sure, some people will use non-default config options but their experience may be sub-par because of it. In any event, reasonable security options should be enabled by default. Imagine that something like password hashing were a non-default feature. What would happen is that most people would never turn it on and have plenty of bad things happen as a result. After the second or third time the security design problem bites them maybe they'd turn on the more secure feature but then would find themselves locked out of their system or some other horrible fate after which they'd find out that nobody turns the security feature on because it doesn't work. So then they'd just accept the additional risk of doing things in a more risky way that is likely to have a bad outcome because that's just the way things work. It seems that this kind of scenario has played out many times over the years, like MS Windows putting people in the Administrators group to get around the entire permissions checking system. The Windows issue with the Administrators group and all the trouble that has caused over the years seems to be exactly the kind of thing they are trying to avoid. Posted Oct 1, 2012 4:20 UTC (Mon) bydlang (guest, #313) [Link] many security people fall into the trap where they consider security the most important thing. In the real world it isn't. Security is a matter of risk, and you have to balance risk vs benefit. Posted Oct 4, 2012 7:39 UTC (Thu) byfarnz (subscriber, #17727) [Link] Have you a cite for that? My recollection, backed bythe protocol spec is that the Wayland compositor is the only application that gets input directly from the kernel; everything else is notified of events by the compositor. This is essential if the compositor is to transform events in arbitrary fashion - how can a surface know where it is in kernel-global coordinates if the compositor is the only thing that knows about the arbitrary transform applied to it? Posted Sep 27, 2012 22:18 UTC (Thu) bynix (subscriber, #2304) [Link] (2 responses) Posted Sep 28, 2012 10:08 UTC (Fri) bydgm (subscriber, #49227) [Link] (1 responses) And that's the point of my argument. Security has to be _possible_, but not _mandated_. With X11, right now, it's not possible. That is another way in which Wayland is an improvement over what we have right now. That doesn't mean, though, that many more steps in that direction are equally as good. We should be careful to not overshoot. Posted Oct 1, 2012 4:11 UTC (Mon) byraven667 (subscriber, #5198) [Link] That is a very situational judgement on a technology by technology and setting by setting basis. There are often ways to organize things more securely without being a burden for the user. Posted Sep 27, 2012 20:03 UTC (Thu) byDavidS (guest, #84675) [Link]XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
- each VRAM page should be marked with the id of the GPU user that created it.
- the wiping process requires another attribute (being_wiped) on each page. Before scheduling a bunch of page wiping, the correspondent pages should be marked "being_wiped". When the wiping process is done, the pages should be marked wiped (not linked to a single user) and the being_wiped should be cleared.
- when allocating memory for a user, memory pages that were previously used by this user should be use for the allocation. When none is left, wiped memory pages should be used. If none are left but there are pages being wiped, then the allocator should wait for them to be wiped before using them. Otherwise, just return ENOMEM.
I expect the performance-impact to be minimal in most cases. However, it makes the allocation more complicated and more memory-consuming.XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
1) either emulating them (something which apparently has started to appear but does not seem to be universally agreed upon);
2) or evolving the security model to adress a different kind of security features (for example: forbidd applications with conflicting security requirement to use the same "screen").XDC2012: Graphics stack security
XDC2012: Graphics stack security
[2] On the machine I'm typing on, sometimes the password prompt is completely invisible, and it's quite common for the unlocked screen to flash above the screen locker when DPMS comes back.XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
>XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
- JimXDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
Nope, you got it wrong. Take virtual keyboards, for instance. Currently they are not possible in Wayland because it has been decided that the compositor should not touch input in any way, applications receive it directly from the kernel. This decision effectively locks down _all_ applications, even those for which input integrity is of no use.
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
XDC2012: Graphics stack security
Copyright © 2012, Eklektix, Inc.
This article may be redistributed under the terms of theCreative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds