Bug 218933 - non-root dlm creation doesn't work
non-root dlm creation doesn't work
Status: CLOSED NOTABUG
Product: Red Hat Cluster Suite
Classification: Red Hat
Component: dlm (Show other bugs)
4
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: David Teigland
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-08 10:41 EST by Jerry Uanino
Modified: 2009-04-16 16:31 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-11 05:28:47 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)

  None (edit)
Description Jerry Uanino 2006-12-08 10:41:04 EST
Description of problem:
I can't create a lockspace as non-root.
This appears to have been fixed in bugzilla 176350 and associated advisory 
here:
http://rhn.redhat.com/errata/RHBA-2006-0555.html


Version-Release number of selected component (if applicable):
Here is rpm -qa |grep dlm
dlm-kernel-2.6.9-37.7
dlm-1.0.1-1
dlm-kernel-2.6.9-44.3
dlm-kernel-smp-2.6.9-41.7.2
dlm-kernel-2.6.9-41.7
dlm-kernel-smp-2.6.9-42.13
dlm-kernel-smp-2.6.9-37.7
dlm-kernel-smp-2.6.9-44.3
dlm-kernel-2.6.9-42.13
dlm-kernel-2.6.9-41.7.2
dlm-devel-1.0.1-1
dlm-kernel-smp-2.6.9-41.7


How reproducible:
As non-root run this cpp program:
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>

extern "C" {
  #include <libdlm.h>
}
#include <pthread.h>

main(int argc, char **argv)
{
  printf("hello world\n");
  char lockName[] = "foobar" ;

  dlm_lshandle_t *lockspace=0;
  lockspace=(dlm_lshandle_t*)dlm_create_lockspace
("EEJ_TESTING_LOCKSPACE",0777);
  printf("lockspace result: %X\n",lockspace);
}

Steps to reproduce:
1. compile above
2. run strace against it
  
Actual results:


open("/proc/misc", O_RDONLY)            = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x2a95558000
read(3, " 61 dlm_clvmd\n 62 dlm-control\n18"..., 1024) = 81
close(3)                                = 0
munmap(0x2a95558000, 4096)              = 0
open("/dev/misc/dlm-control", O_RDWR)   = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
write(3, "\3\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\0\0\0\0EEJ_TE"..., 157) = -
1 EPERM (Operation not permitted)
write(1, "lockspace result: 0\n", 20lockspace result: 0
)   = 20
exit_group(0)                           = ?


Expected results:
A valid lockspace

Additional info:
Comment 1 Jerry Uanino 2006-12-08 10:41:36 EST
Also note, redhat support ticket number 1157166 called in to match this.
Comment 2 Christine Caulfield 2006-12-11 05:28:47 EST
That's correct. Creating a lockspace as an unprivileged user is not allowed.
Only the default lockspace can be created by such a user which is what the
Advisory you mention is all about.

If you need to have your own lockspace used by unprivileged users you need to
create it as root and then set permissions on the /proc/misc/dlm_<lockspace>
special file so that they can access it.

There are no plans to allow non-privileged users to create lockspaces.

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