Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 919749 - >=sys-apps/systemd-255[homed]: failure to login to homed users (because of usr-merge)
Summary: >=sys-apps/systemd-255[homed]: failure to login to homed users (because of us...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: usrmerge, usrmerge-fixes
  Show dependency tree
 
Reported: 2023-12-12 06:48 UTC by Jani Valkonen
Modified: 2024-02-21 16:10 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Diff of image dir between good and bad commit. (image-dir-diff.txt,2.17 KB, text/plain)
2024-02-20 07:32 UTC, regalcamel
Details
/usr/lib64/libnss_systemd.so.2 from commit b0d3095 (libnss_systemd.so.2.bad,418.05 KB, application/x-sharedlib)
2024-02-20 07:33 UTC, regalcamel
Details
/usr/lib64/libnss_systemd.so.2 from commit 1108285 (libnss_systemd.so.2.good,418.05 KB, application/x-sharedlib)
2024-02-20 07:34 UTC, regalcamel
Details
Bad login from commit b0d3095 (login-journal-bad-b0d3095.txt,152.92 KB, text/plain)
2024-02-20 13:39 UTC, regalcamel
Details
Good login from commit 1108285 (login-journal-good-1108285.txt,402.61 KB, text/plain)
2024-02-20 13:41 UTC, regalcamel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jani Valkonen 2023-12-12 06:48:52 UTC
When upgrading to systemd-255, I am unable to log in as a user when using homed. Downgrading to systemd-254.7 resolves the login issue.

Reproducible: Always

Steps to Reproduce:
1. Upgrade system using homed to systemd-255
2. Try to login
Actual Results:  
Login failed.

Expected Results:  
Login succeeds.

Portage 3.0.57 (python 3.11.7-final-0, default/linux/amd64/17.1/desktop/plasma/systemd/merged-usr, gcc-13, glibc-2.38-r7, 6.6.5-gentoo-dist x86_64)
=================================================================
System uname: Linux-6.6.5-gentoo-dist-x86_64-Intel-R-_Core-TM-_i7-6820HQ_CPU_@_2.70GHz-with-glibc2.38
KiB Mem:    32757460 total,  12447132 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Tue, 12 Dec 2023 05:30:01 +0000
Head commit of repository gentoo: 551eb4516b16fb0cf9bacd46741836be9128daa9
sh bash 5.2_p21-r1
ld GNU ld (Gentoo 2.41 p2) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p21-r1::gentoo
dev-lang/perl:             5.38.2::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1::gentoo
dev-lang/rust-bin:         1.74.1::gentoo
dev-util/cmake:            3.28.0::gentoo
dev-util/meson:            1.3.0-r2::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          254.7::gentoo
sys-devel/autoconf:        2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20231014::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.6::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://gentoo.osuosl.org/releases/amd64/binpackages/17.1/x86-64

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr encode exif flac fortran gdbm gif gpm gtk gui iconv icu ipv6 jpeg kde kwallet lcms libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt5 readline screencast sdl seccomp semantic-desktop sound spell ssl startup-notification svg systemd test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wayland widgets wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Alexandra Parker 2023-12-14 05:45:07 UTC
Possibly related?

https://github.com/systemd/systemd/issues/26722
Comment 2 regalcamel 2024-02-19 06:24:07 UTC
This bug is still present on 255.3

homed login stops working after this commit.
https://github.com/systemd/systemd/commit/b0d3095fd6cc1791a38f57a1982116b4475244ba

`su -l user` works.
`login user` decrypts and mounts everything correctly, then fails with "login[14774]: FAILED LOGIN (1) on '/dev/tty1' FOR 'user', Authentication failure".

Replacing libnss_systemd.so.2 with one compiled from the previous commit allows me to log in again.

The issue Alexandra linked appears to be a different, older bug.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-19 06:44:59 UTC
(In reply to regalcamel from comment #2)
> This bug is still present on 255.3
> 
> homed login stops working after this commit.
> https://github.com/systemd/systemd/commit/
> b0d3095fd6cc1791a38f57a1982116b4475244ba

Thanks for the hint. So far, I've been staring at it, and I can't for the life of me see yet what part is causing it though.

> 
> `su -l user` works.
> `login user` decrypts and mounts everything correctly, then fails with
> "login[14774]: FAILED LOGIN (1) on '/dev/tty1' FOR 'user', Authentication
> failure".
> 
> Replacing libnss_systemd.so.2 with one compiled from the previous commit
> allows me to log in again.
> 

Could you clarify precisely what you replaced with what? (the one in /usr/lib64 *and* /usr/lib, or just one, or ...)?

This makes little sense to me so far. The commit linked shouldn't even change much code in libnss_shared.so.2, should it? It only touches some of shared/.

> The issue Alexandra linked appears to be a different, older bug.

You're right - somehow I'd missed it was 253...
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-19 06:47:43 UTC
It would also be helpful if you could perhaps upload the bad/good libnss_systemd.so and `lddtree` on both.
Comment 5 nop 2024-02-19 06:54:04 UTC
Turning on systemd.log_level=debug via the kernel command line may give a better picture on what is happening. I believe the output will go to journald especially if it's a dlopen error in homed.
Comment 6 regalcamel 2024-02-20 07:32:30 UTC
Created attachment 885483 [details]
Diff of image dir between good and bad commit.

>Could you clarify precisely what you replaced with what?
/usr/lib64/libnss_systemd.so.2 was one of the only relevant files in the image directory that changed between the two commits, so I tried just swapping that out.
And it starts working when you install the older commit without needing to reboot, so I suspected there was nothing wrong with the core of systemd.
Comment 7 regalcamel 2024-02-20 07:33:04 UTC
Created attachment 885484 [details]
/usr/lib64/libnss_systemd.so.2 from commit b0d3095
Comment 8 regalcamel 2024-02-20 07:34:53 UTC
Created attachment 885485 [details]
/usr/lib64/libnss_systemd.so.2 from commit 1108285
Comment 9 regalcamel 2024-02-20 13:39:39 UTC
Created attachment 885522 [details]
Bad login from commit b0d3095
Comment 10 regalcamel 2024-02-20 13:41:30 UTC
Created attachment 885523 [details]
Good login from commit 1108285
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-21 02:49:47 UTC
floppym: I guess we need to revisit https://bugs.gentoo.org/910758#c5.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-21 02:53:19 UTC
(In reply to regalcamel from comment #8)
> Created attachment 885485 [details]
> /usr/lib64/libnss_systemd.so.2 from commit 1108285

I've diffed the two and the only differences are:

1) offsets like (good vs bad) 
-     lea    0x4cbc9(%rip),%rcx
+     lea    0x4cbb9(%rip),%rcx

and

2) a single string (good vs bad)

-/usr/bin/bash
+/bin/bash


so yeah, this is surely /etc/shells (thanks awilfox!), like bug 910758
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-21 02:53:46 UTC
(In reply to Sam James from comment #12)
uh bad vs good.
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-21 02:57:17 UTC
(In reply to regalcamel from comment #2)
> homed login stops working after this commit.
> https://github.com/systemd/systemd/commit/
> b0d3095fd6cc1791a38f57a1982116b4475244ba

-option('default-user-shell', type : 'string', value : '/bin/bash',
+option('default-user-shell', type : 'string', value : '/usr/bin/bash',
       description : 'default interactive shell')
Comment 15 Eli Schwartz 2024-02-21 03:25:15 UTC
(In reply to Alexandra Parker from comment #1)
> Possibly related?
> 
> https://github.com/systemd/systemd/issues/26722

It appears not, in the end.
Comment 16 Larry the Git Cow gentoo-dev 2024-02-21 16:10:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc2218c97fed493ded478538f5b64176b3149c3e

commit dc2218c97fed493ded478538f5b64176b3149c3e
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-02-21 16:07:33 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-02-21 16:07:33 +0000

    sys-apps/systemd: override debug-shell and default-user-shell
    
    We need to match /etc/shells to allow users to log in.
    
    Closes: https://bugs.gentoo.org/919749
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/systemd/{systemd-255.3.ebuild => systemd-255.3-r1.ebuild} | 3 +++
 sys-apps/systemd/systemd-9999.ebuild                               | 3 +++
 2 files changed, 6 insertions(+)