Bug 115934 - shmget with IPC_NOWAIT returning EPERM
Summary: shmget with IPC_NOWAIT returning EPERM
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-02-17 09:20 UTC by Gabriele Turchi
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-07-10 16:37:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Gabriele Turchi 2004-02-17 09:20:55 UTC
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 09:36:33 UTC
do you have selinux or anything related installed ?

Comment 2 Gabriele Turchi 2004-02-17 09:42:49 UTC
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 19:50:32 UTC
Works by 2.6.3 253 with selinux permissive.


Comment 4 Gabriele Turchi 2004-07-02 14:19:35 UTC
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 14:55:55 UTC
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 16:37:47 UTC
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.