Bug 24850 - prctl return value type is int but it is long in kernel
Summary: prctl return value type is int but it is long in kernel
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.31
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-25 07:49 UTC by xuyang
Modified: 2019-07-25 08:57 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xuyang 2019-07-25 07:49:29 UTC
Hi

in glic, prctl function defined in sysdeps/unix/sysv/linux/sys/prctl as below:

#ifndef _SYS_PRCTL_H
#define _SYS_PRCTL_H    1

#include <features.h>
#include <linux/prctl.h>  /*  The magic values come from here  */

__BEGIN_DECLS

/* Control process execution.  */
extern int prctl (int __option, ...) __THROW;

__END_DECLS

#endif  /* sys/prctl.h */
~

When we calling prctl(PR_SET_TIMERSLACK, ULONG_MAX) and then calling prctl(PR_GET_TIMERSLACK), the value will be truncated into INT_MAX(or convered into unsinged,it is UINT_MAX) on 64bit machine. Or, this is a 
glibc limitation for prctl interfaces?