Bug 115934 - shmget with IPC_NOWAIT returning EPERM
shmget with IPC_NOWAIT returning EPERM
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-17 04:20 EST by Gabriele Turchi
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-07-10 12:37:47 EDT
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 Gabriele Turchi 2004-02-17 04:20:55 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.4.1)
Gecko/20031114 Galeon/1.3.10

Description of problem:
Under 2.6 kernel, this C function call:

shmget(1866194712, 209715200, IPC_CREAT|IPC_EXCL|IPC_NOWAIT|0600);

will fail with EPERM (errno=1) if run as a normal user, with ENOMEM
(errno=12) if run as root (but it fails even trying to allocate 8KB...).

Removing the IPC_NOWAIT flag, everything runs ok. Under 2.4 kernel
there are no problem with or without the IPC_NOWAIT flag.

Reading /usr/src/linux-2.6/ipc/shm.c I was not able to find even
something returning EPERM...

Also, I cannot remove the flag because the failing program is the
Oracle database (version 10g).


P.S.: I'm sorry, my english is alpha version.

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

How reproducible:
Always

Steps to Reproduce:
1. create a C program calling shmget with IPC_NOWAIT flag
2. compile it
3. run it
    

Actual Results:  The program fail with EPERM

Expected Results:  An allocated shared memory segment

Additional info:
Comment 1 Arjan van de Ven 2004-02-17 04:36:33 EST
do you have selinux or anything related installed ?
Comment 2 Gabriele Turchi 2004-02-17 04:42:49 EST
Mine is a standard fedora core 1 (updated) with development 2.6.1
kernel. Sorry, but how the security can affect the result only with
IPC_NOWAIT flag set?
Comment 3 Alan Cox 2004-05-03 15:50:32 EDT
Works by 2.6.3 253 with selinux permissive.
Comment 4 Gabriele Turchi 2004-07-02 10:19:35 EDT
The problem still persist on standard Fedora Core 2 (kernel
2.6.6-1.435.2.1) with default selinux configuration (SELINUX=disabled)
and with selinux=0 on boot too.
Comment 5 Alan Cox 2004-07-10 10:55:55 EDT
Ok I can duplicate this with the 2.6.6 tree.

Large values as non root correctly get -EINVAL
Small values with IPC_NOWAIT return -EPERM
Without IPC_NOWAIT performs correctly.

Doesn't seem ot be an SELinux bug but a general 2.6 bug in our tree.
Reassigning to the kernel owner

Comment 6 Alan Cox 2004-07-10 12:37:47 EDT
The flag in question isn't IPC_NOWAIT (IPC_NOWAIT is not valid for
this call, but SHM_HUGETLB). Once you realise that it becomes obvious
its not actually a bug. Oracle requires hugetlbfs/permissions
configuration

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