Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 390459 - sys-auth/pam_mount-2.12 + app-admin/sudo-1.8.3_p1 - does not work occasionally: modify_pm_count: Assertion `user != ((void *)0)' failed.
Summary: sys-auth/pam_mount-2.12 + app-admin/sudo-1.8.3_p1 - does not work occasionall...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Hanno Böck
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-13 23:14 UTC by infobox.oleg
Modified: 2013-10-20 14:57 UTC (History)
5 users (show)

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


Attachments
emerge-info (emerge-info.txt,4.99 KB, text/plain)
2011-11-13 23:14 UTC, infobox.oleg
Details
(upstream) Patch to fix the issue (lp927828-fix-abort-in-pam-modules-when-timestamp-valid.patch,2.95 KB, patch)
2012-05-05 09:42 UTC, poletti.marco
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description infobox.oleg 2011-11-13 23:14:28 UTC
Created attachment 292439 [details]
emerge-info

After upgrading system (~amd64) approx 2 weeks ago sudo stopped working in certain situations.

I use pam_mount to mount certain filesystems on login and unmount them on logout.

If I run command sudo drop_caches I get error as below. If I downgrade to sudo to 1.8.2-r1, the error goes away. Errors occurs with other programs using sudo.

Commands and results:
# bin/sudoDropCaches <=== calls drop_caches script, which is allowed like this:
   %wheel ALL = (root) NOPASSWD:/usr/local/sbin/drop_caches

Cleaning system caches
sudo: pam_mount.c:417: modify_pm_count: Assertion `user != ((void *)0)' failed.
bin/sudoDropCaches: line 2:  1776 Aborted                 sudo drop_caches


drop_caches script is in root's PATH and it contains:
#!/bin/bash
echo "Cleaning system caches"
sync
echo 3 > /proc/sys/vm/drop_caches
Comment 1 Martin Wegner 2011-11-17 16:51:49 UTC
I have a more general sudo config and I'm also using pam_mount and I'm getting the same error on every sudo command.

/etc/sudoers:

root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL

Only added line in /etc/security/pam_mount.conf.xml:

                <!-- Volume definitions -->

                <volume user="martin" fstype="fuse" path="encfs#/home/.encfs-martin" mountpoint="/home/martin" options="allow_other,nonempty" />

As martin just a
$ sudo echo test
gives:

test
sudo: pam_mount.c:417: modify_pm_count: Assertion `user != ((void *)0)' failed.
[1]    12802 abort      sudo echo test

I'll be happy to provide more information if requested.

$ emerge --info
Portage 2.1.10.34 (default/linux/amd64/10.0/desktop/gnome, gcc-4.5.3, glibc-2.13-r4, 3.1.0-gentoo-r1-odin x86_64)
=================================================================
System uname: Linux-3.1.0-gentoo-r1-odin-x86_64-Intel-R-_Core-TM-_i5_CPU_M_560_@_2.67GHz-with-gentoo-2.1
Timestamp of tree: Wed, 16 Nov 2011 14:15:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1-r1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo odin gnome systemd
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="ftp://91.121.124.139/gentoo-distfiles/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5 -l6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/gnome /var/lib/layman/systemd"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 amr avahi berkdb bluetooth branding bzip2 cairo cdda cli colord consolekit cracklib crypt cups cxx dbus dirac divx dri dts dvb emboss encode exif faac faad fam ffmpeg firefox flac fuse gdbm gdu gif gnome gnome-keyring gstreamer gtk gtk3 iconv idn inotify introspection ipv6 jpeg lame lcms libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses networkmanager nls nptl nptlonly ogg opengl openmp pam pango pcre pdf png policykit ppds pppd pulseaudio readline realmedia samba schroedinger sdl session spell sse sse2 ssl startup-notification svg sysfs syslog systemd tcpd theora tiff truetype udev unicode usb v4l v4l2 vim-syntax vorbis wmp x264 xcb xinerama xml xorg xulrunner xv xvid zlib zsh-completion" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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 ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

$ emerge -pv sudo pam_mount
[ebuild   R    ] sys-auth/pam_mount-2.12  USE="crypt ssl (-selinux)" 278 kB
[ebuild   R    ] app-admin/sudo-1.8.3_p1-r2  USE="pam -ldap -offensive (-selinux) -skey" 1,501 kB
Comment 2 Julien Sanchez archtester 2011-12-01 14:02:56 UTC
Same problem on my system:
- sudo-1.8.3_p1-r2
- pam_mount-2.12

I'm using pam_mount to mount an encfs filesystem.

This bug is also referenced at debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648698
Comment 3 infobox.oleg 2012-02-24 21:53:22 UTC
Problem persists on app-admin/sudo-1.8.4_p1
Comment 4 Krzysiek 2012-03-03 08:44:58 UTC
And app-admin/sudo-1.8.4_p2
Comment 5 Krzysiek 2012-03-03 09:18:09 UTC
I'm reverting back to app-admin/sudo-1.8.2-r1 an it works.
Comment 6 Joël 2012-04-17 09:02:46 UTC
Same here! I also tried upgrading to sys-auth/pam_mount-2.13 but it didn't help.

Why in the world did Gentoo remove app-admin/sudo-1.8.2-r1 from portage tree? We need it! This bug is UNRESOLVED so until Debian (or anyone else) manages to fix it, please put it back because we need it!

Sorry for the rant... it's just that I don't understand why we have 30 versions of gcc, yet we can't keep an older version of "sudo" around.
Comment 7 Martin Wegner 2012-04-18 10:11:39 UTC
(In reply to comment #6)
> [...]
> Why in the world did Gentoo remove app-admin/sudo-1.8.2-r1 from portage
> tree?

Because it had a serious vulnerability: http://www.sudo.ws/sudo/alerts/sudo_debug.html
Comment 8 Joël 2012-04-18 11:51:55 UTC
Thanks for your answer Martin, it totally makes sense given the seriousness of the vulnerability.

However the question remains: does anyone know how to make pam_mount work properly with these newer sudo versions? Is there a /etc/security configuration trick (or something else) that does the job?
Comment 9 infobox.oleg 2012-04-20 15:11:53 UTC
There is a fix for version 1.8.0-1.8.3 - http://www.sudo.ws/sudo/alerts/sudo_debug.html says:
"For sudo versions 1.8.0-1.8.3, the patch to sudo.c in sudo-1.8.3p2.patch.gz will also apply."
Comment 10 Joël 2012-04-20 22:05:24 UTC
Great news!

I would suggest to include a patched app-admin/sudo-1.8.2-r2 in the tree... that would resolve the problem for all affected users (which is pretty much everyone who uses pam-mount at the moment!).

I haven't really looked but I suppose some other distros have probably applied the same kind of patch, as few of them can afford to systematically upgrade packages like Gentoo does.
Comment 11 poletti.marco 2012-05-05 09:42:37 UTC
Created attachment 310851 [details, diff]
(upstream) Patch to fix the issue

I don't think that the sudo_debug page that was linked here is about the same issue, it seems something completely different to me.

I attach a patch that fixes the bug (I tried applying it and I get no more pam-mount-related errors).

This is the patch applied by Ubuntu to fix the same problem:
https://bugs.launchpad.net/ubuntu/precise/+source/sudo/+bug/927828

Can anyone commit this?
Comment 12 Matt Turner gentoo-dev 2013-08-12 05:37:45 UTC
Sudo 1.8.6 is stable now. Is it fixed in that version?
Comment 13 poletti.marco 2013-10-20 14:57:00 UTC
I'm using sudo 1.8.6_p7 (latest stable) and pam_mount 2.14 (unstable) and I have no problem. Since the fix was for sudo, I guess it should work even with a stable pam_mount, unless a workaround was added in pam_mount 2.14.