Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 765541 - acct-user/pcscd: not in group 'plugdev' for enough permission to handle Yubikey
Summary: acct-user/pcscd: not in group 'plugdev' for enough permission to handle Yubikey
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Mikle Kolyada (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-15 15:47 UTC by Ao Shen
Modified: 2021-02-25 14:36 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ao Shen 2021-01-15 15:47:32 UTC
Currently the user pcscd created by 'acct-user/pcscd' is in groups
pcscd,openct,usb by default. However, as per
'/lib/udev/rules.d/70-libfido2-u2f.rules', Yubikeys are put into the 'plugdev'
group, which renders pcscd daemon cannot access them.

This breaks the openpgp and piv functionality of app-crypt/yubikey-manager and
sys-auth/yubikey-personalization-gui as they rely on pcscd to access the key.


Reproducible: Always

Steps to Reproduce:
On an OpenRC system: (afaik, systemd uses acl to control dev node access, so it should be fine)
1. Install pcsc-lite, pcsc-tools, yubikey-personalization-gui
2. Start the pcscd daemon by 'rc-service pcscd start'
3. Insert a Yubikey into the system
4. try pcsc_scan and yubikey-personalization-gui
Actual Results:  
pcsc_scan cannot find the key
yubikey-personalization-gui reports 'unknown error'

Expected Results:  
Yubikey shows in pcsc_scan results and can be programmed by yubikey-personalization-gui

Manually adding user 'pcscd' into group 'plugdev' workarounds this issue.

'emerge --info' is as following:

Portage 3.0.12 (python 3.8.7-final-0, default/linux/amd64/17.1/no-multilib, gcc-10.2.0, glibc-2.32-r5, 5.9.15-gentoo-Satori x86_64)
=================================================================
System uname: Linux-5.9.15-gentoo-Satori-x86_64-AMD_Ryzen_9_5900X_12-Core_Processor-with-glibc2.2.5
KiB Mem:    32871092 total,  28968888 free
KiB Swap:    7110656 total,   7110656 free
Timestamp of repository gentoo: Thu, 14 Jan 2021 13:45:01 +0000
Head commit of repository gentoo: fbb20e7a76c59e64d4d1373bb9e5033825d01db6
Timestamp of repository gentoo-zh: Tue, 12 Jan 2021 18:35:10 +0000
Head commit of repository gentoo-zh: f30f54086bef2bea5dce5dc12e8ab12e3a24cc49

Timestamp of repository guru: Thu, 14 Jan 2021 14:06:46 +0000
Head commit of repository guru: 42da0d3f7d2729b8b80b08e652af1a6538995680

Timestamp of repository lto-overlay: Tue, 12 Jan 2021 10:38:15 +0000
Head commit of repository lto-overlay: a3acc51130448fdeee44dfc81611c023feac3071

Timestamp of repository mv: Tue, 12 Jan 2021 10:37:45 +0000
Head commit of repository mv: ba1192b485584ad96b9c2a4c81f7709ef5939ef3

Timestamp of repository nix-guix: Tue, 12 Jan 2021 10:38:31 +0000
Head commit of repository nix-guix: f7a622feffa10e1d862caf14192d8b6834f75a1e

Timestamp of repository pentoo: Thu, 14 Jan 2021 10:35:04 +0000
Head commit of repository pentoo: b92a2fa937205a603aa7ccf2b799cb820540c0e3

sh dash 0.5.11.3-r1
ld GNU ld (Gentoo 2.34 p6) 2.34.0
ccache version 4.1 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          3.8.7-r1::lto-overlay, 3.9.1-r1::lto-overlay
dev-util/ccache:          4.1::gentoo
dev-util/cmake:           3.17.4-r1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.34-r2::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://mirrors.tuna.tsinghua.edu.cn/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:

gentoo-zh
    location: /var/db/repos/gentoo-zh
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo-zh.git
    masters: gentoo

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

lto-overlay
    location: /var/db/repos/lto-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/lto-overlay.git
    masters: gentoo mv

mv
    location: /var/db/repos/mv
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/mv.git
    masters: gentoo

nix-guix
    location: /var/db/repos/nix-guix
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/nix-guix.git
    masters: gentoo

pentoo
    location: /var/db/repos/pentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/pentoo.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -flto=auto -fgraphite-identity -floop-nest-optimize -fipa-pta -fuse-linker-plugin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -flto=auto -fgraphite-identity -floop-nest-optimize -fipa-pta -fuse-linker-plugin"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=3 --load-average=24.0"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -flto=auto -fgraphite-identity -floop-nest-optimize -fipa-pta -fuse-linker-plugin"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox 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 -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -flto=auto -fgraphite-identity -floop-nest-optimize -fipa-pta -fuse-linker-plugin"
GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j24"
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"
USE="X acl alsa amd64 berkdb bzip2 cairo cdda cli crypt dri fontconfig fortran gdbm gif iconv ipv6 jpeg libglvnd libtirpc ncurses nls nptl openmp pam pcre png readline seccomp split-usr ssl tcpd unicode vaapi vdpau vim-syntax vulkan webp xattr zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en zh zh-CN" 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="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python2_7 python3_8" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2021-01-24 23:08:44 UTC
Hello,

So far I do not understand how you've deduced connection between plugdev and the pcscd user, here are some quick facts:

1.) The udev rule you are referring to belongs to the dev-libs/libfido2, it has nothing to do with opensc and co.
2.) pcsc_scan works actually fine if you had started pcscd and installed the ccid smartcard driver (I have just checked with my yubikey).
Comment 2 Ao Shen 2021-02-25 14:36:00 UTC
I have removed my 'workaround' and retested this. Yes, pcsc_scan now works fine with the original group configuration.

I now think I messed up my configuration when I tried to setup my yubikey for the first time. Sorry for the noise!