]> totsipaki.net Git - Published.git/blame - BlackBoxInside/GNUTOO.txt
Edits and comments by GNUTOO
[Published.git] / BlackBoxInside / GNUTOO.txt
CommitLineData
e0d5d4ef
NP
1- As for the software and hardware boundaries, Alexandre olivia also
2 has 2 interesting articles on the consequences for freedom of various
3 cases:
4
5 https://www.fsfla.org/ikiwiki/blogs/lxo/draft/blob-fallacy
6 https://www.fsfla.org/ikiwiki/blogs/lxo/draft/unshittify.en.html
7
8 It might be interesting to take that into account somehow for a wider
9 discussion and also look at the risk of nonfree software in different
10 cases.
11
12Table 2.1
13---------
14PT Security also had also very long articles on the topic in their
15blog. They also contains more background on the 'disable' bits like Alt
16disable, like why they seems to have been added and so on.
17
182.4 Accessibility
19-----------------
20With:
21> and prevent playback of audiovisual material by applying Digital
22> Restriction Management (DRM) [Ruan, 2014][6].
23and:
24> [6] Page 49
25
26I didn't manage to find that claim. The reality being described is a
27bit different: it can display things on the screen that cannot be
28copied by the operating system probably either by displaying things to
29the GPU directly (Intel EPT with the keypad example page 49), or in the
30next page by injecting encrypted frames along with the decryption key
31to the GPU.
32
33So here it doesn't really prevent the playback, it rather enables
34playback at huge freedom costs (basically loosing the control of your
35computer).
36
37So maybe the sentence could be reworked a bit by telling that it's
38involved in DRM and telling a bit how.
39
40Otherwise readers might think that I want to play some forbidden video
41like a video from a resistance group in a repressive country, and then
42somehow the Management Engine would prevent me from doing that.
43
44Maybe it could but I'm not aware of it having done that so far.
45
46My feeling while reading the book chapter on DRM is that there is some
47advocacy/justification for DRM, so it might be a good idea to try to
48rework the sentence in a non-neutral way that is against the DRM.
49
50I also have a feeling that DRM is the main cause why we have things
51like the Management Engine / TrustZone, etc on all consumer devices and
52that we cannot replace the nonfree boot software with free software.
53
54It might be less relevant for x86 as the history of the Management
55Engine is not directly linked to DRM, but on smartphones I think that
56the link between DRM and operating systems running in TrustZone (and by
57extension signed bootloaders that loads these operating systems) is
58stronger. But I was only given indirect information on that and the
59source didn't want to go on record.
60
612.5.2
62-----
63About secure boot, I think we can in theory enroll our own certificate
64but at the end of the day all that is extremely complex to handle and
65practical freedoms are been made extremely difficult to use.
66
67Your article has something like that:
68> When Secure Boot is activated, it is impossible to install an
69> alternative bootloader (see chapter 4).
70
71Here people will think that with UEFI Secure Boot you cannot install
72GRUB and that Microsoft said so. And the Chapter 4 doesn't talk about
73that interpretation all, and only talks about free boot fimrware
74(distributions), not boot restrictions.
75
76Here this seems to be because:
77(1) There seems to be 2 meanings of secure boot. One is the UEFI Secure
78 Boot standard, and another could be the a chain of trust that
79 starts in hardware. Here you mean the second one.
80
81(2) Bootloader is typically associated with GRUB running after the
82 BIOS or UEFI.
83
84Here's an example of modification:
85> When a hardware chain of trust that enforces signatures is enabled,
86> works (its security is not broken), and that users don't have the
87> signing key nor can bail out of that, it is impossible to replace the
88> boot firmware. Chapter 4 will show free software boot firmwares.
89
90Also there a correct technical term for GNU Boot would probably be a
91'free software boot firmware distribution', but 'boot firmware' can
92be confused with 'WiFi firmware' or 'CPU Microcode', so I tend to use
93boot software instead. But 'distribution' is important (more below).
94
95In practice the term bootloader seems to be used in x86 for GRUB that
96runs after the BIOS or UEFI, but also for 'u-boot' that does the same
97than GRUB + BIOS/UEFI, so it's a bit messy.
98
99As for the broader context GNU Boot and Libreboot are distributions,
100like Trisquel, Guix or Parabola. The only difference is that we package
101(and sometimes deblob like in the case of GNU Boot) software like GRUB,
102Coreboot, etc.
103
104As for what does what I think it might be interesting to avoid
105confusions: Coreboot's code only initialize the hardware, and is
106incapable of booting an operating system. So during the build it also
107download, compile and include a third party software that know how to
108load an operating system. You have several options like:
109- SeaBIOS: A free BIOS implementation.
110- Tinaocore: A free UEFI implementation.
111- GRUB: A bootloader that can boot many operating systems.
112- etc (there are more).
113
114And distributions like GNU Boot or Libreboot package all that, and ship
115binary images that users can test and install (Coreboot doesn't ship
116any binary image). We also go further than Coreboot as we try to
117release an image that is directly usable by users without having to add
118more configuration and so on.
119
120As for UEFI secure boot, the social aspects of that is also extremely
121interesting here. For instance despite the "security" constraint for
122free software, the fact that some known nonfree boot software was signed
123and didn't implement signature verification or another scheme seem to
124have been completely tolerated:
125https://mjg59.dreamwidth.org/60248.html
126
127Another interesting thing I came across is that to make BIOS/UEFI
128updates work when the user had the TPM enabled, the vendor simply added
129a backdoor for the update. There was a security talk about it. In
130contrast here too we struggle to use the TPM properly within free
131software, especially because of these updates...
132
1332.5.4
134-----
135About using the Management Engine for security if it was to run free
136software, some of the 'applications' like EPID are not very useful. For
137instance GNU Taler can have a better mechanism without having a central
138trust on a company like Intel.
139
140Though for remote administration it looks extremely useful but the user
141would need to be aware that it's enabled or disabled somehow, otherwise
142it could even be abused with free software.
143
144Another way would be to write our own applications somehow, and we'd
145probably end up with very different feature set.
146
147For instance it could be used to improve boot security, and there is
148already a wide area of research in this direction in FLOSS projects
149(example: HEADS, Pure Boot, shim, etc). So moving part of it in the
150Management engine somehow could make sense. In addition the TPM is now
151an application, so a lot could be done by combining all that.
152
153Though the question here would also be to understand how well the
154Management Engine itself would be protected from the rest of the
155system else there would not be much point into using it for such
156schemes (and there are also other schemes that are less dependent on
157preventing privilege escalation).
158
1593.2.1 Marketting in technology
160------------------------------
161While I completely missed the marketing aspect before reading your
162article (thanks a lot for that), I think it's not the complete picture.
163
164I think that the nonfree software model badly needs a lot of these
165security features, and that even free software can also benefits from a
166small subset of these features (though without depending on them too
167much, an example would be the NX bit or similar code flow integrity
168protections).
169
170If we just look at the basics, we have some huge differences between a
171free software OS and a nonfree one. If we assume the distribution model
172for free software and not appimage or software shipped directly by the
173developers, the distributions trust the applications they ship not to
174be malicious whereas nonfree software usually doesn't.
175
176This doesn't mean that checks are not done before shipping (the XZ
177backdoor was caught before being really useful for its creator for
178instance). But once shipped it's trusted, and this changes things a
179lot (more on that below).
180
181In contrast for nonfree software addition there is usually both a
182commercial imperative and the ability to hide things (like security
183flaws, backdoors, etc). This could be done for legitimate purposes for
184instance to do a BIOS update with while keeping the TPM working, or not
185to fix some security issues (because they cost money) and only fixing
186the most important ones, or even have semi-legitimate uses that
187can also be considered malicious, like drivers for forensics hardware
188and so on but that are meant to be limited to some states / organization
189only (though in practice this is not always the case).
190
191And commercial imperative + the ability to hide things also mean that
192companies writing driver for nonfree operating systems also have the
193same incentives, and even when caught, they could pressure the nonfree
194OS not to blacklist their driver, or at least be that important for the
195survival of that operating system that they cannot be blacklisted,
196without having to do any pressure themselves.
197
198The combination of all that (users installing whatever + unfixed bugs,
199and backdoors) makes it way more likely to have full compromise of a
200device with a nonfree OS than with a GNU/Linux distribution where users
201only install software they trust (usually from their distribution and
202that's all). So when you add the ability to run untrusted code to all
203the mess in the nonfree software case, the untrusted code can exploit
204old buggy drivers that are signed and so on, and get full device
205compromise.
206
207In addition in nonfree operating system like Microsoft Windows there is
208also a big issue with things like drivers that was already present in
209DOS at least: people writing software For Windows or making hardware for
210Windows often need to modify the system in some ways. But the operating
211system is nonfree. And Microsoft probably doesn't look at driver
212source code (unless it's free software and needs to be signed somehow).
213So you can even have some attack surface there as the drivers can also
214be untrusted.
215
216If we look at how UEFI secure boot is managed (like explained in the
217article from Mathew Garret (mjg59)), we can see a bit of all that.
218Anti-virus are also known to whitelist some software (like the Sony
219rootkit back in the days).
220
221So all that looks like a nightmare to secure, so if you assume that
222Microsoft doesn't want to switch to free software, having more
223and more security features in the hope of reducing the damage enough to
224make it acceptable by users would be a good plan for them.
225
226In the case of Apple they probably managed to limit way more the attack
227surface: they make the hardware and the OS for instance, so they can
228have less driver issues if they want, and they can probably restrict
229more what applications can do, but that's at the expense of users
230practical freedom (users are stuck with their hardware and so on), and
231it doesn't remove all these problems at all (I guess they have similar
232issues with the drivers they don't have leverage on, anti-viruses that
233probably need privileges and that are badly written, and so on). And
234here too there is untrusted code everywhere. The most extreme
235version of this approach here is probably the ipad and iphone where
236users don't have any freedom left (they can't run the application they
237want). And yet malicious untrusted applications can still exploit their
238data as long as they don't attack the operating system.
239
240And so if you're Microsoft, the attack surface is bigger, so a
241potential solution looks exactly like the model of the Management
242engine: you implement security features in some place that is somewhat
243isolated from the rest of the system, with lower attack surface and
244that has higher privilege to be able to do something meaningful for
245security. The HVCI feature mentionned in the article about BlackLotus
246you mention seem to be something like that too.
247
248And it's not limited to the computer, since everything uses that model
249you end up with packet sniffing / IDS outside of the computer, etc. And
250that again can easily be evaded. So you've got layers on top of layers
251and it gets more and more complex to secure. So now there are
252new security solutions that try to tackle the complexity, to even
253infiltrate group of people that attack computers, to try to gather
254'intelligence', and also use statistics and information gathering, etc,
255to predict what the attack will be to better counter them and so on.
256
257In contrast in GNU/Linux the issue tend to be less severe since people
258typically contribute upstream directly, though we also have some out of
259tree free drivers of very bad quality that are often shipped in
260distributions (usually not in FSF approved one since they typically use
261nonfree firmwares), but then users would either need to run untrusted
262code that then reuse these to do privilege escalation or to be close to
263the attacker (like in the case of a bad WiFi driver or even firmware).
264
265So that limits the risk a lot. Though things are far from perfect.
266Computers are too complex to be properly secured against some very
267simple use case like opening a document that you don't trust. For
268instance someone that does political dissent usually needs to
269open documents from unknown people. And sometimes these document have
2700 days in them, and it's possible because document formats are hard to
271parse (harder than network protocols for instance). But for most people
272things are fine.
273
274And selling 0 days probably earns more money than basic computer crime
275/ delict anyway, so that kind of shields the general population against
276wider attacks under GNU/Linux.
277
2783.2.2.1 CVE
279-----------
280It's also worth nothing that nowadays a company can manage their own
281CVEs, and some free software projects started to do that. I'm unsure
282of the impact as I've no idea how in practice this affects things. For
283instance it may be possible to still fill the CVE not directly to the
284company. Reference: https://lwn.net/Articles/961978/
285
2863.2.3 potential security hole that remains pernamently active
287--------------------------------------------------------------
288Here a reply to Intel would be to look at what happens in practice with
289things like the HAP bit that is used by me_cleaner.
290
291The research of PT Security and of people that looked at its use point
292that it was made for security critical systems: by setting that bit,
293the operating system (minix) boots and at some point stops loading
294extra applications.
295
296This means that at least part of the united states governement agrees
297with the free software community by classifying the Management
298Engine as a security risk. If I recall well Dell also sold computers
299with that bit enabled, for similar markets.
300
301The part about disabling AMT we can somewhat verify the me_cleaner part
302as some ME operating system versions have been analyzed partially by PT
303Security and others.
304
305But a lot remains not-analysed: they only analyzed very specific
306versions of the Management Engine AND only very specific parts inside
307these specific versions.
308
309So we know what the HAP bit does or is supposed to do but not much
310more. We don't know what all the code that runs before the evaluation
311of the bit does exactly. It probably initializes some hardware for sure
312but we lack source code and a community behind, and also the practical
313freedoms like the ability to modify the code, to do proper research.
314
3153.2.4 backdoor
316--------------
317It might be interesting to point out real world use case(s) as a
318backdoor like PLATINIUM to show that it can really be used like that:
319https://en.wikipedia.org/wiki/Management_Engine#PLATINUM
320
3214.1 Is AMD s Smarter Choice?
322----------------------------
323I think it could be improved a bit by telling that AMD *competes
324(mostly) in the same market* or talk about market somehow.
325
326Because otherwise there are *a lot* of alternative, like ARM or RISCV
327computers, but it's not the same market.
328
329For instance it's extremely complicated to find ARM computers that are
330in the same range than Intel/AMD with price range, power consumption,
331computing power, extensibility (many PCIe ports, SATA), etc.
332
3334.3 Free computing systems
334--------------------------
335The I945 Thinkpads don't have a Management Engine and AMT was not
336enabled by the manufacturer (it's supposed to be in the Intel Network
337card for I945). So GNU Boot doesn't change much here beside replacing
338the BIOS by free software, which also removes a rootkit along the way
339(named Computrace). And that rootkit had also known security
340vulnerabilities. But as I understand it is supposed to only affect
341Windows, but again we don't have the Lenovo BIOS source code.
342
343For GM45 it's a bit different, the boot flash has a partition table
344(called Intel flash descriptor, or IFD) and we simply configure that
345not to have an ME partition.
346
347Here's an example:
348> $ ifdtool -d grub_x200_8mb_libgfxinit_txtmode_usqwerty.rom
349> [...]
350> Found Region Section
351> FLREG0: 0x00000000
352> Flash Region 0 (Flash Descriptor): 00000000 - 00000fff
353> FLREG1: 0x07ff0003
354> Flash Region 1 (BIOS): 00003000 - 007fffff
355> FLREG2: 0x00001fff
356> Flash Region 2 (Intel ME): 00fff000 - 00000fff (unused)
357> FLREG3: 0x00020001
358> Flash Region 3 (GbE): 00001000 - 00002fff
359> FLREG4: 0x00001fff
360> Flash Region 4 (Platform Data): 00fff000 - 00000fff (unused)
361
362So you have a lower bound and an upper bound to the partition and in
363the case of the ME there are special values to tell to disable the
364partition if I recall well. These are the '00fff000' and '007fffff'
365there. Here there is also a Platform Data partition that is disabled.
366
367In contrast if we take the partition table itself, it starts at
3680x00000000 and ends at 0x00000fff and 0xfff is 4KiB, and it's size is
3694KiB once extracted. The Gigabit Ethernet is 12K (0x00002fff -
3700x00001000) == 12KiB.
371
372So when we replace the content of that flash chip, it also erases the
373Management Engine OS along the way. The Management Engine most likely
374has a ROM though. And the GM45 one wasn't dumped as far as I know.
375
376The problem that we have is that on more recent computers the code that
377the Management Engine runs initialize some hardware, and more and more
378code is needed. So removing it either results in an unstable or
379non-booting computer.
380
381I suspect that disabling the Management Engine was unofficially
382supported by Intel somehow for the GM45, and I was told it stopped
383being supported at some point because of cost reasons: it costed less
384to have software to workaround hardware flaws at boot than make the
385hardware work properly from the start.
386
3874.3 Free Computing Systems
388---------------------------
389
390I think that for ARM there might be more powerful servers that could
391also work with fully free software but I didn't investigate them. Back
392in the days Paul Kocialkowski looked at some of them. But as said before
393these are not the same market than x86, so it's not a drop in
394replacement.
395
396Computers made with KGPE-D16 mainboards can also be the fastest x86
397computer that boots with fully free software (though users need to not
398use external ATI/AMD/Nvidia GPUs else that will run nonfree software).
399
400There are also RISC-V computers.
401
402The use case is also important to consider because you don't need
403external GPUs in servers whereas for workstations you typically need
404one or more screens so you need at least a good display controller and
405ideally a GPU.
406
407PS: Can I also send the link to neox who also co-maintain GNU Boot with
408 me? It might interest him to read or review it as well.
409
410Denis.
411
412