Hírolvasó

Ekstrand: How to write a Vulkan driver in 2022

3 év 4 hónap óta
Over on the Collabora blog, Jason Ekstrand has a detailed look at writing a Vulkan graphics driver in today's world. "Not only has Vulkan grown, but Mesa has as well, and we've built up quite a suite of utilities and helpers for making writing Vulkan drivers easier." The blog post takes the form of a tutorial of sorts, though the end result is not a functioning Vulkan driver, the framework of one is shown. At the time we were developing ANV (the Intel Vulkan driver), the Vulkan spec itself was still under development and everything was constantly in flux. There were no best practices; there were barely even tools. Everyone working on Vulkan was making it up as they went because it was a totally new API. Most of the code we wrote was purpose-built for the Intel driver because there were no other Mesa drivers to share code. (Except for the short-lived LunarG Intel driver based in ilo, which we were replacing.) If we had tried to build abstractions, they could have gotten shot to pieces at any moment by a spec change. (We rewrote the descriptor set layout code from scratch at least five or six times before the driver ever shipped.) It was frustrating, exhausting, and a whole lot of fun.

These days, however, the Vulkan spec has been stable and shipping for six years, the tooling and testing situation is pretty solid, and there are six Vulkan drivers in the Mesa tree with more on the way. We've also built up a lot of common infrastructure. This is important both because it makes writing a Vulkan driver easier and because it lets us fix certain classes of annoying bugs in a common place instead of everyone copying and pasting those bugs.

jake

[$] A way out for a.out

3 év 4 hónap óta
The a.out executable format dates back to the earliest days of Linux — and before. It has not been used in any serious way for decades, but support still exists in the Linux kernel and has resisted all attempts at its removal. Back in January, Borislav Petkov tried yet again to delete support for this format, leading to another extended discussion. There is one difference this time around, though: the effort to get rid of a.out support might just succeed.
corbet

Security updates for Thursday

3 év 4 hónap óta
Security updates have been issued by Debian (php-twig), Mageia (abcm2ps, libpano13, and pesign), openSUSE (nextcloud and xen), Oracle (kernel, kernel-container, and openssl), SUSE (java-1_7_1-ibm and xen), and Ubuntu (linux-oem-5.14, openvpn, and thunderbird).
jake

[$] A method for replacing Python tuple entries

3 év 4 hónap óta
A recent discussion on the python-ideas mailing list gives some insight into how to—or how not to—propose a feature to be added to the language. At first blush, adding a method to Python's immutable tuple type for replacing one of its elements is not a particularly strange idea, nor one that would cause much in the way of backward-compatibility concerns. Even though there was some evidence offered that such a method might be useful, it seems pretty unlikely that the idea will go anywhere, at least in part because of the repetitive, bordering on aggressive, manner in which its benefits were argued.
jake

GNOME 42 released

3 év 4 hónap óta
Version 42 of the GNOME desktop environment is out.

This release introduces Dark mode and an entirely new screenshot workflow. Beyond that, there are several improved Settings panels, many of the GNOME applications have been ported to GTK 4 and libadwaita, and much more.

See the release notes for more information.

corbet

Security updates for Wednesday

3 év 4 hónap óta
Security updates have been issued by Mageia (cyrus-sasl, openssl, sphinx, and swtpm), openSUSE (qemu), Red Hat (expat, rh-mariadb103-mariadb, and rh-mariadb105-mariadb), SUSE (apache2, binutils, java-1_7_0-ibm, kernel-firmware, nodejs12, qemu, and xen), and Ubuntu (ckeditor and linux, linux-aws, linux-kvm, linux-lts-xenial).
corbet

Matthew Garrett: AMD's Pluton implementation seems to be controllable

3 év 4 hónap óta
I've been digging through the firmware for an AMD laptop with a Ryzen 6000 that incorporates Pluton for the past couple of weeks, and I've got some rough conclusions. Note that these are extremely preliminary and may not be accurate, but I'm going to try to encourage others to look into this in more detail. For those of you at home, I'm using an image from here, specifically version 309. The installer is happy to run under Wine, and if you tell it to "Extract" rather than "Install" it'll leave a file sitting in C:\\DRIVERS\ASUS_GA402RK_309_BIOS_Update_20220322235241 which seems to have an additional 2K of header on it. Strip that and you should have something approximating a flash image.

Looking for UTF16 strings in this reveals something interesting:

Pluton (HSP) X86 Firmware Support
Enable/Disable X86 firmware HSP related code path, including AGESA HSP module, SBIOS HSP related drivers.
Auto - Depends on PcdAmdHspCoreEnable build value
NOTE: PSP directory entry 0xB BIT36 have the highest priority.
NOTE: This option will NOT put HSP hardware in disable state, to disable HSP hardware, you need setup PSP directory entry 0xB, BIT36 to 1.
// EntryValue[36] = 0: Enable, HSP core is enabled.
// EntryValue[36] = 1: Disable, HSP core is disabled then PSP will gate the HSP clock, no further PSP to HSP commands. System will boot without HSP.

"HSP" here means "Hardware Security Processor" - a generic term that refers to Pluton in this case. This is a configuration setting that determines whether Pluton is "enabled" or not - my interpretation of this is that it doesn't directly influence Pluton, but disables all mechanisms that would allow the OS to communicate with it. In this scenario, Pluton has its firmware loaded and could conceivably be functional if the OS knew how to speak to it directly, but the firmware will never speak to it itself. I took a quick look at the Windows drivers for Pluton and it looks like they won't do anything unless the firmware wants to expose Pluton, so this should mean that Windows will do nothing.

So what about the reference to "PSP directory entry 0xB BIT36 have the highest priority"? The PSP is the AMD Platform Security Processor - it's an ARM core on the CPU package that boots before the x86. The PSP firmware lives in the same flash image as the x86 firmware, so the PSP looks for a header that points it towards the firmware it should execute. This gives a pointer to a "directory" - a list of different object types and where they're located in flash (there's a description of this for slightly older AMDs here). Type 0xb is treated slightly specially. Where most types contain the address of where the actual object is, type 0xb contains a 64-bit value that's interpreted as enabling or disabling various features - something AMD calls "soft fusing" (Intel have something similar that involves setting bits in the Firmware Interface Table). The PSP looks at the bits that are set here and alters its behaviour. If bit 36 is set, the PSP tells Pluton to turn itself off and will no longer send any commands to it.

So, we have two mechanisms to disable Pluton - the PSP can tell it to turn itself off, or the x86 firmware can simply never speak to it or admit that it exists. Both of these imply that Pluton has started executing before it's shut down, so it's reasonable to wonder whether it can still do stuff. In the image I'm looking at, there's a blob starting at 0x0069b610 that appears to be firmware for Pluton - it contains chunks that appear to be the reference TPM2 implementation, and it broadly decompiles as valid ARM code. It should be viable to figure out whether it can do anything in the face of being "disabled" via either of the above mechanisms.

Unfortunately for me, the system I'm looking at does set bit 36 in the 0xb entry - as a result, Pluton is disabled before x86 code starts running and I can't investigate further in any straightforward way. The implication that the user-controllable mechanism for disabling Pluton merely disables x86 communication with it rather than turning it off entirely is a little concerning, although (assuming Pluton is behaving as a TPM rather than having an enhanced set of capabilities) skipping any firmware communication means the OS has no way to know what happened before it started running even if it has a mechanism to communicate with Pluton without firmware assistance. In that scenario it'd be viable to write a bootloader shim that just faked up the firmware measurements before handing control to the OS.

The bit 36 disabling mechanism seems more solid? Again, it should be possible to analyse the Pluton firmware to determine whether it actually pays attention to a disable command being sent. But even if it chooses to ignore that, if the PSP is in a position to just cut the clock to Pluton, it's not going to be able to do a lot. At that point we're trusting AMD rather than trusting Microsoft, but given that you're also trusting AMD to execute the code you're giving them to execute, it's hard to avoid placing trust in them.

Overall: I'm reasonably confident that systems that ship with Pluton disabled via setting bit 36 in the soft fuses are going to disable it sufficiently hard that the OS can't do anything about it. Systems that give the user an option to enable or disable it are a little less clear in that respect, and it's possible (but not yet demonstrated) that an OS could communicate with Pluton anyway. However, if that's true, and if the firmware never communicates with Pluton itself, the user could install a stub loader in UEFI that mimicks the firmware behaviour and leaves the OS thinking everything was good when it absolutely is not.

So, assuming that Pluton in its current form on AMD has no capabilities outside those we know about, the disabling mechanisms are probably good enough. It's tough to make a firm statement on this before I have access to a system that doesn't just disable it immediately, so stay tuned for updates.

comments

[$] Three candidates vying for Debian project leader

3 év 4 hónap óta
Three candidates have thrown their hat into the ring as candidates for the 2022 Debian project leader (DPL) election. One is Jonathan Carter, who is now in his second term as DPL, while the other two are Felix Lechner and Hideki Yamane. As is the norm, the candidates self-nominated during the nomination period and are now in the campaigning phase until April 1. The vote commences April 2 and runs for two weeks; the results will be announced shortly thereafter and the new DPL term will start on April 21. The candidates have put out platforms and are fielding questions from the voters, Debian developers, thus it seems like a good time to look in on the election.
jake

Guidelines for research on the kernel community

3 év 4 hónap óta
As part of the response to last year's UMN fiasco, Kees Cook and a group of collaborators have put together a set of guidelines for researchers who are studying how the kernel-development community (or any development community, really) works. That document has just been merged into the mainline as part of the 5.18 merge window.

This document seeks to clarify what the Linux kernel community considers acceptable and non-acceptable practices when conducting such research. At the very least, such research and related activities should follow standard research ethics rules.

corbet

The Open Source Initiative elects a new board

3 év 4 hónap óta
The Open Source Initiative has announced the results of its 2022 board election.

Congratulations to the elected directors: Pamela Chestek, Carlo Piana, Josh Berkus and Amanda Brock. Pamela Chestek has been confirmed and is joined by Carlo Piana as the directors elected by the Affiliate organizations. Josh Berkus and Amanda Brock collected the votes of the Individual members.

corbet

Activists are targeting Russians with open-source "protestware" (Technology Review)

3 év 4 hónap óta
MIT Technology Review has taken a brief look at open-source projects that have added changes protesting the war in Ukraine and drawn some questionable conclusions:

No tech firm has gone that far, but around two dozen open-source software projects have been spotted adding code protesting the war, according to observers tracking the protestware movement. Open-source software is software that anyone can modify and inspect, making it more transparent—and, in this case at least, more open to sabotage.

corbet

Security updates for Tuesday

3 év 4 hónap óta
Security updates have been issued by Debian (apache2 and thunderbird), Fedora (abcm2ps, containerd, dotnet6.0, expat, ghc-cmark-gfm, moodle, openssl, and zabbix), Mageia (389-ds-base, apache, bind, chromium-browser-stable, nodejs-tar, python-django/python-asgiref, and stunnel), openSUSE (icingaweb2, lapack, SUSE:SLE-15-SP4:Update (security), and thunderbird), Oracle (openssl), Slackware (bind), SUSE (apache2, bind, glibc, kernel-firmware, lapack, net-snmp, and thunderbird), and Ubuntu (binutils, linux, linux-aws, linux-aws-5.13, linux-gcp, linux-hwe-5.13, linux-kvm, linux-raspi, linux, linux-aws, linux-aws-5.4, linux-azure, linux-azure-5.4, linux-gke, linux-gkeop, linux-hwe-5.4, linux-ibm, linux-ibm-5.4, linux-kvm, linux-oracle, linux-oracle-5.4, and linux, linux-aws, linux-aws-hwe, linux-azure, linux-azure-4.15, linux-dell300x, linux-hwe, linux-gcp-4.15, linux-kvm, linux-oracle, linux-snapdragon).
corbet

Free Software Awards winners announced: SecuRepairs, Protesilaos Stavrou, Paul Eggert

3 év 4 hónap óta
The just-completed, online LibrePlanet conference was the venue for awarding this year's Free Software Awards: SecuRepairs was this year's winner of the Award for Projects of Social Benefit, which is presented to a project or team responsible for applying free software, or the ideas of the free software movement, to intentionally and significantly benefit society. This award stresses the use of free software in service to humanity. SecuRepairs is an association of professionals working in the information security industry, who have the common cause of supporting the "right to repair" devices and software.

[...] The 2021 Award for Outstanding New Free Software Contributor went to Protesilaos "Prot" Stavrou, who in a few short years has become a mainstay of the GNU Emacs community through his blog posts, livestreams, conference talks, and code contributions.

[...] Paul Eggert was this year's honoree for the Award for the Advancement of Free Software, an award given to an individual who has made a great contribution to the progress and development of free software through activities that accord with the spirit of free software. Eggert has been a contributor to the GNU operating system for over thirty years, including contributions to components like GNU Compiler Collection (GCC), and is the current maintainer of the Time Zone Database (tz), which provides accurate information on the world's time zones.

jake

[$] A look at some 5.17 development statistics

3 év 5 hónap óta
At the conclusion of the 5.17 development cycle, 13038 non-merge changesets had found their way into the mainline repository. That is a lower level of activity than was seen for 5.16 (14,190 changesets) but well above 5.15 (12,337). In other words, this was a fairly typical kernel release. That is true in terms of where the work that made up the release came from as well.
corbet

Beingessner: Rust's Unsafe Pointer Types Need An Overhaul

3 év 5 hónap óta
Aria Beingessner points out a set of problems with Rust's conception of unsafe pointers and proposes some fixes in this highly detailed post.

Rust currently says this code is totally cool and fine:

// Masking off a tag someone packed into a pointer: let mut addr = my_ptr as usize; addr = addr & !0x1; let new_ptr = addr as *mut T; *new_ptr += 10;

This is some pretty bog-standard code for messing with tagged pointers, what’s wrong with that? [...]

For this to possibly work with Pointer Provenance and Alias Analysis, that stuff must pervasively infect all integers on the assumption that they might be pointers. This is a huge pain in the neck for people who are trying to actually formally define Rust’s memory model, and for people who are trying to build sanitizers for Rust that catch UB. And I assure you it’s just as much a headache for all the LLVM and C(++) people too.

corbet

Security updates for Monday

3 év 5 hónap óta
Security updates have been issued by Debian (bind9, chromium, libgit2, libpano13, paramiko, usbredir, and wordpress), Fedora (expat, kernel, openexr, thunderbird, and wordpress), openSUSE (chromium, frr, and weechat), Red Hat (java-1.7.1-ibm and java-1.8.0-ibm), SUSE (frr), and Ubuntu (imagemagick).
jake

The 5.17 kernel has been released

3 év 5 hónap óta
Linus has released the 5.17 kernel.

So we had an extra week of at the end of this release cycle, and I'm happy to report that it was very calm indeed. We could probably have skipped it with not a lot of downside, but we did get a few last-minute reverts and fixes in and avoid some brown-paper bugs that would otherwise have been stable fodder, so it's all good

Some of the significant features in this release include KCSAN support for the arm64 architecture, the bpf_loop() helper, improved ID-mapped filesystem mounts, the reference-count tracking infrastructure, a switch to BLAKE2s for the random-number generator, a rewritten network filesystem caching layer, straight-line speculation mitigation, and more. See the LWN merge-window summaries (part 1, part 2) and the KernelNewbies 5.17 page for more details.

corbet

OpenBSD/arm64 on Apple M1 systems

3 év 5 hónap óta

In a message to tech@ (and arm64@), Mark Kettenis (kettenis@) wrote:

It has taken a while, but I'm pleased to announce that OpenBSD/arm64 works well enough on Apple M1 systems for some wider testing. A major milestone was reached with the release of the Asahi Linux installer: https://asahilinux.org/2022/03/asahi-linux-alpha-release/ This provides an easy way to add UEFI "firmware" to your Apple M1 machine which is required to boot OpenBSD/arm64. The basic steps are: […]

Read more…