Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 232190 - app-crypt/trousers-0.3.1: tcsd fails to start, because of insufficient right for /dev/tpm0
Summary: app-crypt/trousers-0.3.1: tcsd fails to start, because of insufficient right ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-18 11:45 UTC by Andrzej Soiński
Modified: 2010-08-06 01:23 UTC (History)
0 users

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


Attachments
patch for tcsd init script (tcsd.patch,395 bytes, patch)
2008-07-18 11:52 UTC, Andrzej Soiński
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrzej Soiński 2008-07-18 11:45:46 UTC
tcsd daemon fails to start up, becuase its init script tries to change user to tss and this user doesn't have sufficient right to operate tpm0.



Reproducible: Always

Steps to Reproduce:
1. Load tpm_tis module
2. Start up tcsd daemon by calling: /etc/init.d/tcsd start
3.

Actual Results:  
tcsd fails to start up with the fllowing error message: "TrouSerS ERROR: Could not find a device to open!"

Expected Results:  
tcsd should start up.

tpm0 device (/dev/tpm0) is owned by root:root with 660 rights, and tcsd daemon run under tss user doesn't have sufficient rights to operate that device. So one of the solutions would be to run tcsd as root.
Current version:
start-stop-daemon --start --chuid tss --exec /usr/sbin/tcsd
Way to fix:
start-stop-daemon --start --exec /usr/sbin/tcsd
Using the aboveline line resolves the issue.
Comment 1 Andrzej Soiński 2008-07-18 11:52:09 UTC
Created attachment 160712 [details, diff]
patch for tcsd init script
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2008-07-18 15:41:52 UTC
You could of course also write a udev rule to set the user/group for /dev/tpm* instead of running tcsd as root...
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-09-21 10:43:44 UTC
Here's the rule from tpm-emulator.
We should install it for trousers as well I think.

/etc/udev/rules.d/60-tpm-emulator.rules:KERNEL=="tpm", NAME="%k", SYMLINK+="tpm0", GROUP="tss", MODE="0660"
Comment 4 Alexandre Ghisoli 2009-09-30 14:10:30 UTC
Well, the udev rule is not working for a real TPM device.

/etc/udev/rules.d/45-tpm.rules :
KERNEL=="tpm[0-9]*", MODE="0600", OWNER="tss", GROUP="tss"

This is working pretty well on my Thinkpad.
Comment 5 Alexandre Ghisoli 2009-09-30 15:41:58 UTC
Also the ownership of the data file is wrong :
chmod tss:tss /var/lib/tpm/
chmod tss:tss /var/lib/tpm/system.data



Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-08-06 01:23:20 UTC
udev rules added in 0.3.6.