Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18305 - gkrellmd runs as root by default
Summary: gkrellmd runs as root by default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Seemant Kulleen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-27 12:27 UTC by Jeekay
Modified: 2003-04-03 16:52 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 Jeekay 2003-03-27 12:27:50 UTC
The /etc/init.d/gkrellmd script that comes with the gkrellm-2.1.7a ebuild runs 
as root by default. There are gkrellmd options to switch the effective 
user/group when it starts, which would prevent a possible daemon exploit from 
giving remote root privileges.

The gkrellmd switches are --user <user> and --group <group>.

Maybe the ebuild should add a gkrellm user/group and the init script use the 
switches to ensure that the daemon runs only with those privs?

This will unfortunately break gkrellmd on systems running kernels with 
restricted /proc access, ala grsec. Maybe the gkrellm user needs adding to the 
`can access /proc unrestricted' group for such kernels?
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2003-03-28 01:47:37 UTC
you know, I remembered reading that in the README when I updated the package, and then forgot about it at some point before putting it into portage.  I'll take a look at this now.
Comment 2 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-01 04:59:22 UTC
method -- comments on the grsec thingy?
Comment 3 Jeekay 2003-04-01 09:12:31 UTC
In the GRSecurity configuration in the kernel config:
Filesystem Protections
->Proc Restrictions

If proc restrictions are enabled, then:
->->Allow special group
->->->GID for special group

Make sure that gkrellmd runs as a user who is in the GID specified.
Having a quick look at my .config, the following options appear to be relevant:
CONFIG_GRKERNSEC=y (enabled grsec)
CONFIG_GRKERNSEC_PROC=y (enable proc restrictions)
CONFIG_GRKERNSEC_PROC_USERGROUP=y
CONFIG_GRKERNSEC_PROC_GID=<GID>

Checking /usr/src/linux/.config (or preferably /proc/config if present) for _PROC=y, then recommend adding _USERGROUP and _GID if not already enabled. If they are enabled, recommend adding the gkrellmd to the specified group.

This should get around the grsec problem, providing people are willing to trust gkrellmd with this information. Seeing as the other alternative is running is as root though... :)
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-03 16:52:22 UTC
well, all you gotta do is edit your /etc/gkrellmd.conf file and uncomment the appropriate lines. In other words, it works with 2.1.8a; not sure what else you would want me to do with it.