Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581458 - USB printer not recognized by CUPS due to hardened kernel option
Summary: USB printer not recognized by CUPS due to hardened kernel option
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-28 17:22 UTC by Daniel Kenzelmann
Modified: 2016-04-29 20:21 UTC (History)
0 users

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 Daniel Kenzelmann 2016-04-28 17:22:13 UTC
USB Printer Samsung SL-M2026
with CUPS 2.1.3
on Gentoo Linux (amd64, no multilib)
WITHOUT systemd (-systemd)

At first, everything looks fine:

lsusb:
Bus 001 Device 003: ID 04e8:3321 Samsung Electronics Co., Ltd 

# ls -la /dev/bus/usb/001/003 
crw-rw-r-- 1 root lp 189, 2 27. Apr 22:08 /dev/bus/usb/001/003

running the backend as root seems to detect the printer

# /usr/libexec/cups/backend/usb 
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 77 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=12
DEBUG2: Printer found with device ID: MFG:Samsung;CMD:SPL,URF,FWV,PIC,EXT;MDL:M2020 Series;CLS:PRINTER;CID:SA_SPLV3_BW;MODE:SPL3,R000105;STATUS:BUSY; Device URI: usb://Samsung/M2020%20Series?serial=08HVB8GGCF013HK
direct usb://Samsung/M2020%20Series?serial=08HVB8GGCF013HK "Samsung M2020 Series" "Samsung M2020 Series" "MFG:Samsung;CMD:SPL,URF,FWV,PIC,EXT;MDL:M2020 Series;CLS:PRINTER;CID:SA_SPLV3_BW;MODE:SPL3,R000105;STATUS:BUSY;" ""

However, no printer is detected in the Interface and also not with lpinfo:

# lpinfo -v
network beh
network ipp
network lpd
network socket
network ipps
network https
network http

and running the backend as user lp does not show any printer:

# sudo -u lp /usr/libexec/cups/backend/usb 
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 77 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=0


------------
The same printer is detected in cups on my Gentoo gnome desktop with systemd as soon as it is plugged in.
Also on the Desktop this seems to work for user lp:

# sudo -u lp /usr/libexec/cups/backend/usb
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 77 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=12
DEBUG2: Printer found with device ID: MFG:Samsung;CMD:SPL,URF,FWV,PIC,EXT;MDL:M2020 Series;CLS:PRINTER;CID:SA_SPLV3_BW;MODE:SPL3,R000105;STATUS:BUSY; Device URI: usb://Samsung/M2020%20Series?serial=08HVB8GGCF013HK
direct usb://Samsung/M2020%20Series?serial=08HVB8GGCF013HK "Samsung M2020 Series" "Samsung M2020 Series" "MFG:Samsung;CMD:SPL,URF,FWV,PIC,EXT;MDL:M2020 Series;CLS:PRINTER;CID:SA_SPLV3_BW;MODE:SPL3,R000105;STATUS:BUSY;" ""

Is this caused by eudev(-systemd) / udev (systemd)?
How can I debug this (without installing systemd on my server?)


------------------------------
 # emerge --info
Portage 2.2.28 (python 3.4.3-final-0, hardened/linux/amd64/no-multilib, gcc-5.3.0, glibc-2.23-r2, 4.4.8-hardened-r1 x86_64)
=================================================================
System uname: Linux-4.4.8-hardened-r1-x86_64-AMD_E-350_Processor-with-gentoo-2.2
KiB Mem:    15998488 total,  14257868 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 28 Apr 2016 07:00:01 +0000
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r2::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.3-r7::gentoo
dev-util/cmake:           3.5.2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.20.5::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=btver1 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=btver1 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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="acl amd64 bzip2 caps cli cracklib crypt cups cxx dri gdbm gnutls hardened iconv idn iproute2 ipv6 justify lzma maildir mmx mmxext modules ncurses nls nptl offensive opengl pam pax_kernel pcre pie png popcnt readline seccomp session speex spice sse sse2 sse3 sse4a ssl ssp ssse3 syslog tcpd udev unicode urandom usb vhosts vorbis xattr xtpax zlib" ABI_X86="64" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 sse4a ssse3" CURL_SSL="gnutls" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de de_DE en en_GB en_US zh zh_CN" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="radeon" 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"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Reproducible: Always
Comment 1 Daniel Kenzelmann 2016-04-28 20:38:55 UTC
maybe it is related to eudev or usbutils?
lsusb seems to show a similar behaviour

# sudo -u lp lsusb

this just returns nothing at all (no error, just nothing) on the eudev system
while it returns all connected devices on the systemd/udev desktop
Comment 2 Alex Xu (Hello71) 2016-04-29 14:39:30 UTC
you may need to manually add the printer.

also, ensure that the "usblp" module is not loaded (or compiled into kernel).
Comment 3 Daniel Kenzelmann 2016-04-29 14:51:00 UTC
1. USB_PRINTER kernel config is disabled
2. Even then, this is outdated information and no longer an issue, see 
https://bugs.gentoo.org/show_bug.cgi?id=501122
3. Even IF that were an issue, the usblp module caused issues with the backend (causing it to not being able to access the printer) however the backend IS recognizing the printer (when run as root). Also it works fine on the systemd desktop.
4. I also tried to add the usb://Samsung/M2020%20Series?serial=08HVB8GGCF013HK
 uri manually, this will not work, the printer is not working.
Comment 4 Daniel Kenzelmann 2016-04-29 20:21:37 UTC
Issue was caused by the hardened kernel option:

CONFIG_GRKERNSEC_SYSFS_RESTRICT

Closing as invalid
(sorry for the noise ... :-)