Bug 418551 - Incorrect get_mempolicy prototype
Incorrect get_mempolicy prototype
Product: Fedora
Classification: Fedora
Component: numactl (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Neil Horman
Fedora Extras Quality Assurance
Depends On:
Blocks: 426369
  Show dependency treegraph
Reported: 2007-12-10 13:05 EST by Ulrich Drepper
Modified: 2008-06-27 00:32 EDT (History)
0 users

See Also:
Fixed In Version: 1.0.2-4.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-06-27 00:32:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ulrich Drepper 2007-12-10 13:05:03 EST
Description of problem:
The <numaif.h> header contains:

extern long get_mempolicy(int *policy, 
                          const unsigned long *nmask, unsigned long maxnode,
                          void *addr, int flags);

But the nmask pointer points to writable memory.  This problem is not noticed by
the compiler when compiling the package since this is a system call.  But it
might lead to bad problems when using the interface since the compiler can
assume the memory is not changed.

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

How reproducible:

Steps to Reproduce:
1.look at /usr/include/numaif.h
Actual results:
above prototype

Expected results:
const removed:
extern long get_mempolicy(int *policy, 
                          unsigned long *nmask, unsigned long maxnode,
                          void *addr, int flags);

Additional info:
This must also be fixed in RHEL versions.  Without this change incorrect code
might silently be generated.
Comment 1 Neil Horman 2007-12-20 10:27:35 EST
Fixeed in devel, bug cloned for RHEL.  Thanks Uli
Comment 2 Bug Zapper 2008-05-14 00:09:40 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Comment 3 Ulrich Drepper 2008-06-27 00:32:18 EDT
Has been fixed in F9.

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