Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 366019 - sys-kernel/hardened-sources-2.6.37-r7 Kconfig conflict
Summary: sys-kernel/hardened-sources-2.6.37-r7 Kconfig conflict
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: The Gentoo Linux Hardened Kernel Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-04 23:10 UTC by Dillon
Modified: 2011-07-30 22:05 UTC (History)
3 users (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 Dillon 2011-05-04 23:10:32 UTC
CONFIG_GRKERNSEC_HARDENED_WORKSTATION selects GRKERNSEC_PROC_USERGROUP.

CONFIG_GRKERNSEC_PROC_USERGROUP depends on (among other things) !GRKERNSEC_PROC_USER.

Reproducible: Always

Steps to Reproduce:
1. Select CONFIG_GRKERNSEC_HARDENED_WORKSTATION
2. Select GRKERNSEC_PROC_USER
3. Compile
Actual Results:  
You get a warning about unsatisfied dependencies. This bug does not occur under CONFIG_GRKERNSEC_CUSTOM

Kernel compiles, the GID you selected is assigned to /proc entries, but has no permission (mode 500).

Manually deselecting the conflicting option allows the kernel to operate correctly.

Expected Results:  
You are prevented from selecting conflicting options.

ThunderFox linux # emerge --info hardened-sources
Portage 2.1.9.42 (hardened/linux/x86, gcc-4.4.5, libc-0-r0, 2.6.37-hardened-r7 i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.37-hardened-r7-i686-Genuine_Intel-R-_CPU_T2250_@_1.73GHz-with-gentoo-1.12.14
Timestamp of tree: Sat, 30 Apr 2011 07:00:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.9.6-r3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
sys-kernel/linux-headers: 2.6.36.1
sys-libs/glibc:      2.11.3
virtual/os-headers:  0
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs candy distlocks fixlafiles fixpackages news nostrip parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.mcs.anl.gov/pub/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/ http://mirror.datapipe.net/gentoo rsync://rsync.gtlib.gatech.edu/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl alsa avahi berkdb bzip2 caps cdr cli consolekit cracklib crypt cups cvs cxx dbus dri dvd extras gdbm git gpm hardened iconv ipv6 java joystick kde mercurial mmx mng modules mp3 mplayer mudflap mysql ncurses networkmanager nls nptl nptlonly nsplugin opengl openmp pam pcre perl pic png policykit pppd pulseaudio python qt3support qt4 readline samba semantic-desktop session sql sse sse2 sse3 ssl static-libs subversion svg sysfs tcpd udev urandom webkit x264 x86 xorg zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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" 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 joystick 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, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

=================================================================
                        Package Settings
=================================================================

sys-kernel/hardened-sources-2.6.37-r7 was built with the following:
USE="-build -deblob -symlink"
CFLAGS="-O2 -march=prescott -pipe -ggdb"
CXXFLAGS="-O2 -march=prescott -pipe -ggdb"
Comment 1 Anthony Basile gentoo-dev 2011-05-12 19:49:31 UTC
Sorry, slowly getting around to this.  I am aware of the issue.
Comment 2 Anthony Basile gentoo-dev 2011-06-26 14:14:19 UTC
This is actually an upstream problem, since it happens even without the Gentoo predefined CONFIG_GRKERNSEC_HARDENED_{SERVER,WORKSTATION,VIRTUALIZATION}.  It has to do with a (potentially) circular dependency between GRKERNSEC_PROC_USER and GRKERNSEC_PROC_USERGROUP.  These are mutally exclusive and currently that exclusivity is expressed as:

config GRKERNSEC_PROC_USER
        depends on GRKERNSEC_PROC

config GRKERNSEC_PROC_USERGROUP
        depends on GRKERNSEC_PROC && !GRKERNSEC_PROC_USER


You can't do this:

config GRKERNSEC_PROC_USER
        depends on GRKERNSEC_PROC && !GRKERNSEC_PROC_USERGROUP

config GRKERNSEC_PROC_USERGROUP
        depends on GRKERNSEC_PROC && !GRKERNSEC_PROC_USER

because that leads to

grsecurity/Kconfig:416:error: recursive dependency detected!
grsecurity/Kconfig:416:	symbol GRKERNSEC_PROC_USER depends on GRKERNSEC_PROC_USERGROUP
grsecurity/Kconfig:424:	symbol GRKERNSEC_PROC_USERGROUP depends on GRKERNSEC_PROC_USER


The solution I would propose is to try 

config GRKERNSEC_PROC_USER
        depends on GRKERNSEC_PROC && !GRKERNSEC_PROC_USERGROUP

config GRKERNSEC_PROC_USERGROUP
        depends on GRKERNSEC_PROC

although this may lead to other problems
Comment 3 Anthony Basile gentoo-dev 2011-06-29 16:57:02 UTC
I've added the above fix to

    hardened-sources-2.6.32-r54
    hardened-sources-2.6.39-r4

@Dillon, can you please test.  Its working for me.
Comment 4 Anthony Basile gentoo-dev 2011-07-26 19:37:22 UTC
(In reply to comment #3)
> I've added the above fix to
> 
>     hardened-sources-2.6.32-r54
>     hardened-sources-2.6.39-r4
> 
> @Dillon, can you please test.  Its working for me.

Okay nearly 1 month no response from reporter.  I'll give it 1 more week.  At least for the Gentoo predefined grsec/pax profiles, I am no longer hitting this problem.

Anyone still having problems with this?