* Re: PATCH: Add sys/personality (Re: Personality)
[not found] ` <3D347120.B9CAFF75@mips.com>
@ 2002-07-17 2:08 ` H. J. Lu
2002-07-17 7:14 ` Carsten Langgaard
0 siblings, 1 reply; 2+ messages in thread
From: H. J. Lu @ 2002-07-17 2:08 UTC (permalink / raw)
To: Carsten Langgaard; +Cc: Ralf Baechle, GNU C Library, linux-mips, linux kernel
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?
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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: Add sys/personality (Re: Personality)
2002-07-17 2:08 ` PATCH: Add sys/personality (Re: Personality) H. J. Lu
@ 2002-07-17 7:14 ` Carsten Langgaard
0 siblings, 0 replies; 2+ 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] 2+ messages in thread
end of thread, other threads:[~2002-07-17 7:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <3D33DAB2.353A4399@mips.com>
[not found] ` <20020716123632.B17038@dea.linux-mips.net>
[not found] ` <20020716090728.A22128@lucon.org>
[not found] ` <3D347120.B9CAFF75@mips.com>
2002-07-17 2:08 ` PATCH: Add sys/personality (Re: Personality) H. J. Lu
2002-07-17 7:14 ` Carsten Langgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox