* Personality
@ 2002-07-16 8:34 Carsten Langgaard
2002-07-16 10:36 ` Personality Ralf Baechle
2002-07-16 13:40 ` Personality Daniel Jacobowitz
0 siblings, 2 replies; 6+ messages in thread
From: Carsten Langgaard @ 2002-07-16 8:34 UTC (permalink / raw)
To: Ralf Baechle, H. J. Lu, linux-mips
The include/linux/personality.h file has changed between the 2.4.3 and
the 2.4.18 kernel.
Now there is a define of personality (#define personality(pers) (pers &
PER_MASK), but that breaks things for the users, if they include this
file.
The user wishes to call the glibc personality function (which do the
syscall), and not use the above definition.
So I guess we need a "#ifdef __KERNEL__" around some of the code in
include/linux/personality.h (at least around the define of personality),
which then has to go into the glibc kernel header files.
Any comments ?
/Carsten
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Personality 2002-07-16 8:34 Personality Carsten Langgaard @ 2002-07-16 10:36 ` Ralf Baechle [not found] ` <20020716090728.A22128@lucon.org> 2002-07-16 13:40 ` Personality Daniel Jacobowitz 1 sibling, 1 reply; 6+ messages in thread From: Ralf Baechle @ 2002-07-16 10:36 UTC (permalink / raw) To: Carsten Langgaard; +Cc: H. J. Lu, linux-mips On Tue, Jul 16, 2002 at 10:34:58AM +0200, Carsten Langgaard wrote: > The include/linux/personality.h file has changed between the 2.4.3 and > the 2.4.18 kernel. > Now there is a define of personality (#define personality(pers) (pers & > PER_MASK), but that breaks things for the users, if they include this > file. > The user wishes to call the glibc personality function (which do the > syscall), and not use the above definition. > > So I guess we need a "#ifdef __KERNEL__" around some of the code in > include/linux/personality.h (at least around the define of personality), > which then has to go into the glibc kernel header files. The general policy about such problems is to not use kernel include files from user applications directly. Hjl - maybe time for <sys/personality.h>? Ralf ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20020716090728.A22128@lucon.org>]
* Re: PATCH: Add sys/personality (Re: Personality) [not found] ` <20020716090728.A22128@lucon.org> @ 2002-07-16 19:16 ` Carsten Langgaard [not found] ` <20020716190814.A31309@lucon.org> 0 siblings, 1 reply; 6+ messages in thread From: Carsten Langgaard @ 2002-07-16 19:16 UTC (permalink / raw) To: H. J. Lu; +Cc: Ralf Baechle, GNU C Library, linux-mips Thanks. Now that we are at it, what should personality return in case it's called with a value, which isn't defined in the personality.h file. Should it return -EINVAL ? I don't think, that is the case at the moment, I believe you can set personality to anything. /Carsten "H. J. Lu" wrote: > On Tue, Jul 16, 2002 at 12:36:32PM +0200, Ralf Baechle wrote: > > On Tue, Jul 16, 2002 at 10:34:58AM +0200, Carsten Langgaard wrote: > > > > > The include/linux/personality.h file has changed between the 2.4.3 and > > > the 2.4.18 kernel. > > > Now there is a define of personality (#define personality(pers) (pers & > > > PER_MASK), but that breaks things for the users, if they include this > > > file. > > > The user wishes to call the glibc personality function (which do the > > > syscall), and not use the above definition. > > > > > > So I guess we need a "#ifdef __KERNEL__" around some of the code in > > > include/linux/personality.h (at least around the define of personality), > > > which then has to go into the glibc kernel header files. > > > > The general policy about such problems is to not use kernel include files > > from user applications directly. Hjl - maybe time for <sys/personality.h>? > > > > Here is a patch. > > H.J. > > ------------------------------------------------------------------------ > > glibc-personality.patchName: glibc-personality.patch > Type: Plain Text (text/plain) ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20020716190814.A31309@lucon.org>]
* Re: PATCH: Add sys/personality (Re: Personality) [not found] ` <20020716190814.A31309@lucon.org> @ 2002-07-17 7:14 ` Carsten Langgaard 0 siblings, 0 replies; 6+ messages in thread From: Carsten Langgaard @ 2002-07-17 7:14 UTC (permalink / raw) To: H. J. Lu; +Cc: Ralf Baechle, GNU C Library, linux-mips, linux kernel "H. J. Lu" wrote: > On Tue, Jul 16, 2002 at 09:16:48PM +0200, Carsten Langgaard wrote: > > Thanks. > > Now that we are at it, what should personality return in case it's called with a > > value, which isn't defined in the personality.h file. > > Should it return -EINVAL ? > > I don't think, that is the case at the moment, I believe you can set personality > > to anything. > > > > Like this? > No, I don't think the patch is correct. I don't know how this actually should work, maybe someone who do know can help out here. But it look like the idea is, that we have a default execution domain (linux), which have pers_low = 0 (PER_LINUX) and pers_high = 0. If one want other execution domains, one much call the register_exec_domain to register the execution domain and personality. So if personality is call with a value that isn't register, it then accept the personality and sets the execution domain to the default settings (which is linux). So the question is should personality, return -EINVAL, if it got a personality value which hasn't been registered or should it accept the personality, but set the execution domain to the default setting ? If the later is true, should it also accept values outside the values defined in the personality.h file ? So what should the following user calls return, if not registered in the kernel? personality(PER_BSD): personality(0x47): Could someone with a better understand than I, please comment this. > > H.J. > --- > --- kernel/exec_domain.c.per Mon Jun 10 10:05:27 2002 > +++ kernel/exec_domain.c Tue Jul 16 19:06:13 2002 > @@ -223,7 +223,8 @@ sys_personality(u_long personality) > > if (personality != 0xffffffff) { > set_personality(personality); > - if (current->personality != personality) > + if (personality < current->exec_domain->pers_low > + || personality > current->exec_domain->pers_high) > return -EINVAL; > } > -- _ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com |\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527 | \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555 TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556 Denmark http://www.mips.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Personality 2002-07-16 8:34 Personality Carsten Langgaard 2002-07-16 10:36 ` Personality Ralf Baechle @ 2002-07-16 13:40 ` Daniel Jacobowitz 2002-07-16 13:57 ` Personality Carsten Langgaard 1 sibling, 1 reply; 6+ messages in thread From: Daniel Jacobowitz @ 2002-07-16 13:40 UTC (permalink / raw) To: Carsten Langgaard; +Cc: Ralf Baechle, H. J. Lu, linux-mips On Tue, Jul 16, 2002 at 10:34:58AM +0200, Carsten Langgaard wrote: > The include/linux/personality.h file has changed between the 2.4.3 and > the 2.4.18 kernel. > Now there is a define of personality (#define personality(pers) (pers & > PER_MASK), but that breaks things for the users, if they include this > file. > The user wishes to call the glibc personality function (which do the > syscall), and not use the above definition. > > So I guess we need a "#ifdef __KERNEL__" around some of the code in > include/linux/personality.h (at least around the define of personality), > which then has to go into the glibc kernel header files. > > Any comments ? Why is the user program including <linux/personality.h> in the first place? The right thing to do here is to provide the necessary bits in a glibc header, probably in bits/personality.h or so. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Personality 2002-07-16 13:40 ` Personality Daniel Jacobowitz @ 2002-07-16 13:57 ` Carsten Langgaard 0 siblings, 0 replies; 6+ messages in thread From: Carsten Langgaard @ 2002-07-16 13:57 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: Ralf Baechle, H. J. Lu, linux-mips Daniel Jacobowitz wrote: > On Tue, Jul 16, 2002 at 10:34:58AM +0200, Carsten Langgaard wrote: > > The include/linux/personality.h file has changed between the 2.4.3 and > > the 2.4.18 kernel. > > Now there is a define of personality (#define personality(pers) (pers & > > PER_MASK), but that breaks things for the users, if they include this > > file. > > The user wishes to call the glibc personality function (which do the > > syscall), and not use the above definition. > > > > So I guess we need a "#ifdef __KERNEL__" around some of the code in > > include/linux/personality.h (at least around the define of personality), > > which then has to go into the glibc kernel header files. > > > > Any comments ? > > Why is the user program including <linux/personality.h> in the first > place? > It need some personality type defines. > > The right thing to do here is to provide the necessary bits in a glibc > header, probably in bits/personality.h or so. > Agree, that is probably the right way to do it. > > -- > Daniel Jacobowitz Carnegie Mellon University > MontaVista Software Debian GNU/Linux Developer -- _ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com |\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527 | \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555 TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556 Denmark http://www.mips.com ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-07-17 7:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-16 8:34 Personality Carsten Langgaard
2002-07-16 10:36 ` Personality Ralf Baechle
[not found] ` <20020716090728.A22128@lucon.org>
2002-07-16 19:16 ` PATCH: Add sys/personality (Re: Personality) Carsten Langgaard
[not found] ` <20020716190814.A31309@lucon.org>
2002-07-17 7:14 ` Carsten Langgaard
2002-07-16 13:40 ` Personality Daniel Jacobowitz
2002-07-16 13:57 ` Personality Carsten Langgaard
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox