47fd7fa6c6
Jamie Bainbridge found an issue where glib's g_get_user_database_entry() may crash after doing: ``` error = getpwnam_r (logname, &pwd, buffer, bufsize, &pw); // ... pw->pw_name[0] = g_ascii_toupper (pw->pw_name[0]); ``` in order to uppercase the first letter of the user's real name. This is a glib bug, because there is a different codepath that gets the pwd from vanilla getpwnam instead of getpwnam_r as shown here. When the pwd struct is returned by getpwnam, its fields point to static data owned by glibc/NSS, and so it must not be modified by the caller. After much debugging, Jamie Bainbridge has fixed this in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2244 by making a copy of the data before modifying it, and that resolves all problems for glib. Yay! However, glib is crashing even when getpwnam_r is used instead of getpwnam! According to getpwnam_r(3), the strings in the pwd struct are supposed to be pointers into the buffer passed by the caller, so glib should be able to safely edit it directly in this case, so long as it doesn't try to increase the size of any of the strings. Problem is various functions throughout nss-systemd.c return synthesized records declared at the top of the file. These records are returned directly and so contain pointers to static strings owned by libsystemd-nss. systemd must instead copy all the strings into the provided buffer. This crash is reproducible if nss-systemd is listed first on the passwd line in /etc/nsswitch.conf, and the application looks up one of the synthesized user accounts "root" or "nobody", and finally the application attempts to edit one of the strings in the returned struct. All our synthesized records for the other struct types have the same problem, so this commit fixes them all at once. Fixes #20679 |
||
---|---|---|
.github | ||
.lgtm/cpp-queries | ||
.semaphore | ||
catalog | ||
coccinelle | ||
docs | ||
factory/etc | ||
hwdb.d | ||
man | ||
mkosi.default.d | ||
modprobe.d | ||
network | ||
po | ||
presets | ||
rules.d | ||
shell-completion | ||
src | ||
sysctl.d | ||
sysusers.d | ||
test | ||
tmpfiles.d | ||
tools | ||
units | ||
xorg | ||
.clang-format | ||
.ctags | ||
.dir-locals.el | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.mailmap | ||
.packit.yml | ||
.vimrc | ||
.ycm_extra_conf.py | ||
configure | ||
LICENSE.GPL2 | ||
LICENSE.LGPL2.1 | ||
Makefile | ||
meson_options.txt | ||
meson.build | ||
mkosi.build | ||
NEWS | ||
README | ||
README.md | ||
TODO |
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.