Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] from Firefox52: NO pure ALSA?, WAS: Firefox 49.0 & Youtube... Audio: No
Date: Fri, 16 Dec 2016 19:16:39
Message-Id: CAGfcS_=UDb35V==i5Ma3K6pNBBSyU0Ecp7_u97ZOYSfj-AwnqQ@mail.gmail.com
In Reply to: Re: [gentoo-user] from Firefox52: NO pure ALSA?, WAS: Firefox 49.0 & Youtube... Audio: No by Miroslav Rovis
1 On Fri, Dec 16, 2016 at 11:51 AM, Miroslav Rovis
2 <miro.rovis@××××××××××××××.hr> wrote:
3 > On 161216-08:35-0500, Rich Freeman wrote:
4 >>
5 >> I'm not sure I understand what distinction you're making. I can't say
6 >> I'm intimately familiar with the security model around Pulseaudio (at
7 >> a glance it seems similar to X11 with its use of cookies, though
8 >> obviously if you tell it to broadcast unencrypted multicast RTP on
9 >> your LAN you'll get the obvious effects) but X11 has a couple of
10 >> glaring security weaknesses. The most obvious is the fact that any
11 >> random X11 client can read the keyboard input of any other client on
12 >> the same server unless you jump through a bunch of hoops that I don't
13 >> think anybody actually jumps through (though I do believe some of the
14 >> X11 PIN entry programs may use them at least). Anything you type into
15 >> an xterm could be read by your browser, and in turn by any code able
16 >> to execute outside any sandbox that browser might have (root privs not
17 >> needed for this).
18 >
19 > I don't claim it can not, but I doubt anyone can do it in my
20 > grsecurity-hardened based Gentoo machine.
21
22 As far as I'm aware grsecurity provides no protection against X11
23 client evesdropping. This is an X11 "feature" and not an exploit
24 per-se.
25
26 Here is one overview of the possibilities:
27 https://pipefish.me/2012/08/28/spying-on-screens-and-keystrokes-the-dangers-of-open-x11/
28
29 Any program that has access to your X11 cookie and which can connect
30 to your X server (which includes anything actually displaying a window
31 on your screen), can generally grab any of the keyboard input bound
32 for any window on your screen. There are ways for programs to block
33 this, but they're not super-practical.
34
35 Amusingly enough I stumbled upon this blog:
36 https://blog.separateconcerns.com/2014-10-24-cli-passwords.html
37
38 This page "helpfully" suggests that you can secure your system by
39 using a console pinentry program instead of an X11-based one, with the
40 underlying assumption being that console software is more secure for
41 this sort of thing. While the basic assumption is probably true, in
42 this particular case it is definitely not. Entering a password on an
43 actual virtual console or over ssh is in fact secure. However,
44 entering it into an xterm (which is presumably what you're using if
45 you would otherwise be using an x11 pinentry program) is absolutely
46 not secure. The x11 pinentry program probably uses XGrabKeyboard to
47 ensure that other clients can't evesdrop, while the console-based
48 version doesn't know anything about x11. Some xterm implementations
49 have a secure mode buried in the menus which turns on this mode which
50 you can use to safely enter passwords, but almost nobody knows about
51 this.
52
53 There are a lot of "cargo cult" tips out there which are based on a
54 lack of understanding of how software like X11 actually work. Of
55 course, X11 is so convoluted that almost nobody actually understands
56 everything about how it works, which is why Wayland has always been
57 right around the corner. In general, though, it largely dates back to
58 an era where people had rsh listening on all their hosts.
59
60 >
61 >> And I wouldn't be surprised if a lot of X servers still run as root
62 >> for modesetting/etc.
63 >
64 > What user is that? It you want, tell me how to check it, and let's see
65 > how spyware-prone my system is.
66
67 If you don't have USE=-suid on your xorg-server package, then X is
68 probably running suid root.
69
70 In order to not have it run this way you need support for kernel
71 modesetting. I was surprised when I found out that X11 even worked
72 that way (we're talking late 90s here). It seems a bit like running
73 pppd as root so that it can directly talk to a UART because you have
74 an aversion to using /dev/ttyS*. In any case the kernel devs have
75 generally been making the move to kernel modesetting so that your
76 device drivers actually are in the kernel and not in random userspace
77 programs (I'm all for microkernels, but not like this).
78
79 If you don't have kernel modesetting enabled then X11 won't be able to
80 run with -suid set. Google for gentoo kernel modesetting for a guide
81 on how to enable it on most modern hardware.
82
83 >
84 > It's been discussed over and over again. Lots of people are firm in
85 > their understanding that Lennart is an actor by and for the big
86 > business. Me too.
87
88 Well, he is a Red Hat employee. Nobody really debates that.
89
90 >
91 > Whatever would anybody try to claim Pulseaudio code is, but to make up
92 > for what was missing in some FOSS GNU Linux boxen for the missing
93 > functionality that the big players couldn't otherwise get for their
94 > Total Surveillance...
95 >
96
97 Uh, if the NSA wanted to spy on your box I doubt they'd do it by
98 trying to sneak something into the open-source pulseaudio code that
99 has numerous maintainers and which is copied all over the place.
100
101 They'd probably just load some microcode into your audio hardware, and
102 have it talk to some microcode in your NIC hardware, and if they
103 needed some buffer they'd work it into your hard drive firmware. Then
104 it works no matter what OS you're using at the moment, or even if you
105 boot off of a DVD.
106
107 And if they did want to do it more traditionally in userspace, they'd
108 hardly be foiled because you aren't running Pulseaudio. They'd just
109 modify your ALSA drivers or run a program that simply opens your
110 microphone and sends the audio to some remote host.
111
112 In the end whether software works for you or against you largely
113 depends on how well you understand how it all works. Don't get me
114 wrong, there are lots of good reasons not to use Pulseaudio. I
115 probably wouldn't run it on a server, unless it was something like a
116 home music server. However, on a traditional desktop it is generally
117 useful because it enables all kinds of sticky stuff that historically
118 has been difficult, and which seem like the sort of things that should
119 be easy. Most people would expect to be able to plug a USB headset
120 into a laptop and have it "just work." Older approaches like ALSA
121 were designed for a more static world.
122
123 It isn't unlike CUPS. Sure, if all you need is to occasionally print
124 to a postfix printer on a serial/parallel port then you don't really
125 need it. However, for just about everything else it helps quite a
126 bit. Software usually gets written and becomes popular because it
127 scratches some kind of itch.
128
129 If there is software that you don't care for, I suggest learning how
130 it works anyway. Knowledge is power. Besides, you never know when
131 you'll need to evesdrop on somebody in an emergency... :)
132
133 --
134 Rich

Replies