Skip to contentSkip to conversation

shmget with SHM_HUGETLB flag: Operation not permitted

DISCUSSION Jochen Roemling 3 participants 3 messages Feb 26, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

I'm using stock kernel 2.6.2. I have HUGETLB support compiled in.

CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y

When issuing this command in a C pgm

shmid =shmget(IPC_PRIVATE, SOMESIZE, SHM_HUGETLB|IPC_CREAT|SHM_R|SHM_W)

I get "Operation not Permitted" when running it as a normal user. It works for root. Without the SHM_HUGETLB flag it works fine for all users.

How can I grant the permission to use HUGETLB to ordinary users?

Jochen

#1 lore raw
Quoted 9 lines · Jochen Roemling

Hi,
I'm using stock kernel 2.6.2. I have HUGETLB support compiled in. CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
When issuing this command in a C pgm
shmid =shmget(IPC_PRIVATE, SOMESIZE, SHM_HUGETLB|IPC_CREAT|SHM_R|SHM_W) I get "Operation not Permitted" when running it as a normal user. It works for root. Without the SHM_HUGETLB flag it works fine for all users. How can I grant the permission to use HUGETLB to ordinary users?

(a) use the fs which uses fs permissions to grant users permission to fiddle with hugetlb
(b) man 2 capset
(c) proxy daemon for shmget()

-- wli

#2 lore raw
Quoted 6 lines · * William Lee Irwin III ([email protected]) wrote:
Quoted 1 line · Jochen Roemling

How can I grant the permission to use HUGETLB to ordinary users?

(a) use the fs which uses fs permissions to grant users permission to fiddle with hugetlb
(b) man 2 capset

In case that part wasn't clear, it would be CAP_IPC_LOCK capability.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net