Hírolvasó
Catchup 2021-11-03
Interesting developments (in -current) since OpenBSD 7.0 include:
- Wireless drivers iwm(4) and iwx(4) now support 40MHz channels - see commits. On tech@, Stefan Sperling (stsp@) has requested testing of a diff to add such support to iwn(4).
- A realpath(1) utility was added, largely for the benefit of porters.
- scp(1) has swapped back to using the SFTP protocol by default. See earlier report.
- The implementations of poll(2), select(2), ppoll(2), and pselect(2) were changed to be based on kqueue(2).
- httpd(8) has gained support for custom error pages.
- Syscall kevent(2) has been unlocked.
- Port net/vpnc-scripts has gained support for resolvd(8).
- Sysctl hw.perfpolicy is now set to auto by default at startup. See the commit message for the details.
- igc(4), a driver for Intel 2.5Gb Ethernet controllers, has been added.
- Mouse tracking is now disabled by default in xterm(1). Setting X resource allowMouseOps to true reinstates the earlier behaviour.
[$] Adding package information to ELF objects
Stable kernel updates
Firefox 94.0 and Firefox ESR 91.3.0
Firefox ESR 91.3 is also available, with various stability, functionality, and security fixes.
Security updates for Tuesday
Fedora 35 released
No matter what variant of Fedora you use, you’re getting the latest the open source world has to offer. Following our “First” foundation, we’ve updated key programming language and system library packages, including Python 3.10, Perl 5.34, and PHP 8.0. Fedora Linux 35 also includes the 1.0 release of firewalld, the modern firewall service.
Some more information can be found in this "what's new" article.
Folios merged for 5.16
Paul E. Mc Kenney: Stupid RCU Tricks: Waiting for Grace Periods From NMI Handlers
Before we start, let's dispense with a couple of silly options. First, we clearly are not going to invoke synchronize_rcu() from within an NMI handler. This function can sleep, and we cannot sleep even within non-threaded interrupt handlers, let alone within NMI handlers. Second, we are not going to invoke call_rcu() from within an NMI handler. This function disables interrupts to exclude concurrent invocations on a single CPU, and disabling interrupts does nothing to keep NMI handlers from running. Worse yet, when running on rcu_nocbs CPUs (which offload callback invocations to rcuo kthreads), call_rcu() acquires a lock. Therefore, invoking call_rcu() from within an NMI handler would at best result in deadlock, and might also result in corruption of RCU's lists of callbacks.
So what can we do?
One approach would be to use a self-spawning RCU callback, that is, a callback that invokes call_rcu() on itself. (Yes, this is perfectly legal, just as it is with timer handlers. See the function rcu_torture_fwd_prog_cb() in kernel/rcu/rcutorture.c of v5.14 of the Linux kernel for an example.) This callback could also increment a counter that could be checked by the NMI handler. When the NMI handler wished to defer a state transition until the end of a future RCU grace period, it could transition to an additional “waiting for RCU” state while recording the value of that counter. Later, when the counter had advanced sufficiently, a subsequent NMI handler could complete the transition to the desired state.
Of course, it is not sufficient to wait for the counter to advance just once. The reason is that the initial NMI might have occurred just before the RCU callback executed, and the next NMI might happen just afterwards. Yes, the counter has advanced, but almost no time has elapsed, much less a full RCU grace period. It is instead necessary to wait for the counter to advance by two, and also to have the needed memory barriers in place.
But there is a better way that makes use of RCU's existing counters and memory barriers. RCU provides these four functions for this purpose, two of which are usable from NMI handlers:
- get_state_synchronize_rcu(), which was first used in v4.10 in 2015, returns a “cookie” that can be checked later. SRCU provides a similar get_state_synchronize_srcu() API.
- start_poll_synchronize_rcu() returns a cookie as well, but also ensures that the needed RCU grace period gets scheduled. Unfortunately, this last requires locks to be acquired, which precludes its use in an NMI handler. SRCU provides a similar start_poll_synchronize_srcu() API, which was first used in v5.14 in 2021.
- poll_state_synchronize_rcu() takes a cookie from the first two functions and returns true if the corresponding RCU grace period has elapsed. SRCU provides a similar poll_state_synchronize_srcu() API, which was first used in v5.14 in 2021.
- cond_synchronize_rcu(), which was first used in v4.10 in 2015, also takes a cookie from the first two functions, but waits (if needed) until the corresponding RCU grace period has elapsed. Unfortunately, the possibility of waiting precludes this function's use in an NMI handler.
So the first NMI handler can invoke get_state_synchronize_rcu() to obtain a cookie, then transition to the additional state. Later NMI handlers residing in this additional state could pass that cookie to poll_state_synchronize_rcu(), completing the transition if this function returns true. On busy systems, RCU grace periods are being initiated by many other things, so that there is almost always a grace period in progress, but if this must work on quiet systems, the aforementioned self-spawning callback could be used to force the issue when needed.
Of course, RCU has made internal use of grace-period polling for a very long time, starting prior to the beginning of the Linux-kernel git repository in 2005.
In short, NMI handlers can now work with both RCU and SRCU grace periods without the need to invent counters or to worry about memory-ordering issues!
FSF: Free Software Awards nominations sought
[...] Maybe you've been inspired by the work of a particular member of the free software community, or have been impressed by the great strides made by a project that incorporates free software into their platform for social change.
[$] Some 5.15 development statistics
Windows domain telepítésre és kapcsolódó feladatokra szakember (1-2 hetes projektmunka)
Security updates for Monday
The "Trojan Source" vulnerability
The 5.15 kernel has been released
This release may have started out with some -Werror pain, but it calmed down fairly quickly and on the whole 5.15 was fair small and calm. Let's hope for more of the same - without Werror issues this time - for the upcoming merge window.
The code name for this release has been set to "Trick or Treat".
Significant features in this release include: the realtime preemption locking code, descriptorless files for io_uring, BPF timers, the removal of mandatory file-locking support, the ksmbd SMB filesystem server (but see this article), printk() indexing, the process_mrelease() system call, The DAMON memory-management optimization system, the ntfs3 filesystem implementation, and much more. See the KernelNewbies 5.15 page for more information.