Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 554740 - lazy /dev files creation on ecryptfs module load prevents ecryptfsd daemon to start
lazy /dev files creation on ecryptfs module load prevents ecryptfsd daemon to...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ecryptfs-utils (Show other bugs)
5.5
All Linux
low Severity medium
: rc
: ---
Assigned To: Michal Hlavinka
Lukas Zachar
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-12 09:32 EST by Jan Tluka
Modified: 2013-04-12 16:34 EDT (History)
3 users (show)

See Also:
Fixed In Version: ecryptfs-utils-75-8.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-11-29 11:20:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to fix this (1.62 KB, patch)
2010-04-20 04:40 EDT, Michal Hlavinka
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1503 normal SHIPPED_LIVE ecryptfs-utils bug fix update 2011-11-29 16:19:56 EST

  None (edit)
Description Jan Tluka 2010-01-12 09:32:48 EST
Description of problem:
It seems that on ecryptfs module load (modprobe ecryptfs) the module
creates files under /dev /dev/misc for userspace communication with
ecryptfsd. However if you start ecryptfsd fast enough it could not find
these files (because they're not created yet).

I've come to the following test case:

killall ecryptfsd
lsmod | grep ecryptfs && rmmod ecryptfs
modprobe ecryptfs
# echo 'sleep'; sleep 3
ecryptfsd
killall ecryptfsd

If you uncomment the 'sleep' line you will get following messages in
/var/log/messages and ecryptfsd will fail to start.

ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open [/dev/ecryptfs]; errno msg = [No such file or directory]
ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open [/dev/misc/ecryptfs]; errno msg = [No such file or directory]
ecryptfsd[29732]: main: Failed to initialize messaging; rc = [-5]
ecryptfsd[29732]: Failed to send eCryptfs miscdev message; errno msg = [Bad file descriptor]
ecryptfsd[29732]: ecryptfs_send_message: Failed to register miscdev daemon with the eCryptfs kernel module; rc = [-5]
ecryptfsd[29732]: ecryptfsd_exit: Error attempting to send quit message to kernel; rc = [-5]
ecryptfsd[29732]: ecryptfsd_exit: Closing eCryptfs userspace daemon


I've also noticed that if you have ecryptfs module unloaded and start
ecryptfsd it will leave ecryptfs loaded but itself dies because of
unavailable files under /dev. If the ecryptfsd daemon tries to load the
required module why it does not wait (or somehow handle) to succesfully
connect to /dev?


Version-Release number of selected component (if applicable):
RHEL5.5-Server-20091227.0
kernel-2.6.18-183.el5
ecryptfs-utils-75-5.el5

How reproducible:
100%

Steps to Reproduce:

killall ecryptfsd
lsmod | grep ecryptfs && rmmod ecryptfs
modprobe ecryptfs
# echo 'sleep'; sleep 3
ecryptfsd
killall ecryptfsd

Actual results:
errors displayed in /var/log/messages and ecryptfsd could not start

Expected results:
ecryptfsd started successfuly

Additional info:
Comment 1 Jan Tluka 2010-01-13 05:03:10 EST
(In reply to comment #0)
> killall ecryptfsd
> lsmod | grep ecryptfs && rmmod ecryptfs
> modprobe ecryptfs
> # echo 'sleep'; sleep 3
> ecryptfsd
> killall ecryptfsd
> 
> If you uncomment the 'sleep' line you will get following messages in
> /var/log/messages and ecryptfsd will fail to start.

That should read:
"If you keep the 'sleep' line commented out you will get ..."
In case you uncomment this line all is working fine.

> 
> ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open
> [/dev/ecryptfs]; errno msg = [No such file or directory]
> ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open
> [/dev/misc/ecryptfs]; errno msg = [No such file or directory]
> ecryptfsd[29732]: main: Failed to initialize messaging; rc = [-5]
> ecryptfsd[29732]: Failed to send eCryptfs miscdev message; errno msg = [Bad
> file descriptor]
> ecryptfsd[29732]: ecryptfs_send_message: Failed to register miscdev daemon with
> the eCryptfs kernel module; rc = [-5]
> ecryptfsd[29732]: ecryptfsd_exit: Error attempting to send quit message to
> kernel; rc = [-5]
> ecryptfsd[29732]: ecryptfsd_exit: Closing eCryptfs userspace daemon
Comment 3 Michal Hlavinka 2010-04-20 04:40:34 EDT
Created attachment 407763 [details]
patch to fix this
Comment 13 errata-xmlrpc 2011-11-29 11:20:55 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1503.html

Note You need to log in before you can comment on or make changes to this bug.