Bug 176350 - Default namespace can only be created by root
Summary: Default namespace can only be created by root
Alias: None
Product: Red Hat Cluster Suite
Classification: Retired
Component: dlm (Show other bugs)
(Show other bugs)
Version: 4
Hardware: x86_64 Linux
Target Milestone: ---
Assignee: Christine Caulfield
QA Contact: Cluster QE
Depends On:
Blocks: 180185
TreeView+ depends on / blocked
Reported: 2005-12-21 17:24 UTC by Matthew Booth
Modified: 2018-10-19 20:46 UTC (History)
5 users (show)

Fixed In Version: RHBA-2006-0555
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-10 21:29:28 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0555 normal SHIPPED_LIVE dlm bug fix update 2006-08-10 04:00:00 UTC

Description Matthew Booth 2005-12-21 17:24:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8) Gecko/20051107 Firefox/1.5

Description of problem:
dlm_get_fd() and dlm_pthread_init() both call open_default_lockspace(),
which tries to open the default lockspace, and creates it if it doesn't
already exist. This means that a non-root dlm process will only work if
any root dlm process is running when it starts, which is bizarre.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Ensure no root processes are using dlm
2. In a non-root process, execute dlm_get_fd()

Actual Results:  EPERM

Expected Results:  Get a fd for dlm

Additional info:

Comment 1 Christine Caulfield 2005-12-22 13:22:32 UTC
Checked in some code to -rSTABLE for people to have a go with. I have tested it
briefly and it's fairly innocuous (I think).

You'll need Udev running with the rules file shown below and also build the dlm
library with ./confgure --have_udev.

Checking in dlm-kernel/src/device.c;
/cvs/cluster/cluster/dlm-kernel/src/device.c,v  <--  device.c
new revision:; previous revision:
Checking in dlm-kernel/src/dlm_device.h;
/cvs/cluster/cluster/dlm-kernel/src/dlm_device.h,v  <--  dlm_device.h
new revision:; previous revision: 1.4
Checking in dlm/configure;
/cvs/cluster/cluster/dlm/configure,v  <--  configure
new revision:; previous revision: 1.4
Checking in dlm/lib/libdlm.c;
/cvs/cluster/cluster/dlm/lib/libdlm.c,v  <--  libdlm.c
new revision:; previous revision:
Checking in dlm/make/defines.mk.input;
/cvs/cluster/cluster/dlm/make/defines.mk.input,v  <--  defines.mk.input
new revision:; previous revision: 1.1

udev rules file:

KERNEL=="dlm-control", NAME="misc/dlm-control"
KERNEL=="dlm_default", NAME="misc/dlm_default" MODE="0666"
KERNEL=="dlm_*", NAME="misc/%k" MODE="0660"

Comment 2 Christine Caulfield 2006-01-05 11:13:09 UTC
Here's a udev rules file that actually works on RHEL4. put it in

KERNEL="dlm-control", NAME="misc/dlm-control", MODE="0666"
KERNEL="dlm_default", NAME="misc/dlm_default", MODE="0666"
KERNEL="dlm_*", NAME="misc/%k", MODE="0660"

Comment 3 Christine Caulfield 2006-01-06 15:14:20 UTC
and checked into RHEL4 for U4

Checking in dlm/lib/51-udev-dlm.rules;
/cvs/cluster/cluster/dlm/lib/Attic/51-udev-dlm.rules,v  <--  51-udev-dlm.rules
new revision:; previous revision: 1.1
Checking in dlm/lib/libdlm.c;
/cvs/cluster/cluster/dlm/lib/libdlm.c,v  <--  libdlm.c
new revision:; previous revision:
Checking in dlm-kernel/src/device.c;
/cvs/cluster/cluster/dlm-kernel/src/device.c,v  <--  device.c
new revision:; previous revision:
Checking in dlm-kernel/src/dlm_device.h;
/cvs/cluster/cluster/dlm-kernel/src/dlm_device.h,v  <--  dlm_device.h
new revision:; previous revision: 1.4

Comment 4 Jan Semmelink 2006-01-09 12:36:58 UTC
Tried this, but problem remains for normal users.
The /dev/misc directory is created with rx permission for other users, and if 
this is changed manually to include write-permission, the problem is solved.

Comment 5 Christine Caulfield 2006-01-09 13:14:53 UTC
Normal users don't need to be able to write into /dev/misc - that's Udev's job.

Did you add the udev rules file into /etc/udev/rules.d ?

Comment 6 Jan Semmelink 2006-01-10 11:18:44 UTC
I did add the udev rules, and it made a difference:
  Before, the /dev/dlm* files had no rwx on any users other than root.
  After, the /dev/misc/dlm* files had r-x on others and group.

When I tested and it failed, I looked at permission on /dev/misc:
drwxr-xr-x 2 root root 60 Jan  9 12:32   /dev/misc

This made me think that pds_manager(my user in its own group also called 
pds_manager) (or who ever makes the dlm_default device) probably has no 
permission to add dlm_default to the /dev/misc directory, so I did:
  chmod a+w /dev/misc
When I re-run the test, it works.

But this is not the right solution - /dev/misc is created when the system boots 
and starts the dlm daemon and must therefore be created with other permissions, 
or something else must change to allow dlm_default to be created in /dev/misc.

Comment 7 Christine Caulfield 2006-01-10 11:44:36 UTC
drwxr-xr-x  is a perfectly correct permission for /dev/misc. It's not the user
that creates the /dev/misc/dlm* files - it's Udev. So the user only needs
permission to read from the directory. Udev runs privileged.

Users need to be able to read/write the dlm-default and dlm_control files in
there though - the udev rules file I wrote sets the permissions on those files
to 0666.

If the dlm-* files that are being created have r-x permission for users then either
a) udev is not creating the device at all, libdlm is still creating them as a
fallback or
b) the rules file is wrong or being ignored.

Be careful with the rules file, RHEL4 has an older udev and needs the last of
the rules file mentioned in this bugzilla (comment #2) or from the RHEL4 brtanch
of CVS.

The rules file in comment#1 only works on later versions of udev and also needs
a MODE=0666 adding to the dlm_contorl line. (this is fixed in STABLE CVS).

Comment 8 Christine Caulfield 2006-01-10 11:46:51 UTC
Also, make sure you have the matching libdlm. The old libdlm always creates the
files. The new libdlm will wait for a while to give udev a chance to create them.

Comment 9 Jan Semmelink 2006-01-10 12:08:45 UTC
Rebuilt with --have_udev and the problem is solved!
Thank you for your patience.

Comment 18 Red Hat Bugzilla 2006-08-10 21:29:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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