Re: [PATCH] sys_personality: Streamline code in sys_personality()
From: Christoph Hellwig
Date: Wed Nov 27 2019 - 04:43:21 EST
On Tue, Nov 26, 2019 at 05:40:45PM +0800, Wang ShaoBo wrote:
> SYSCALL_DEFINE1 in kernel/exec_domain.c looks like verbose,
> ksys_personality() can make it more concise.
What do you try to say with this sentence? I can't really parse it.
> --- a/kernel/exec_domain.c
> +++ b/kernel/exec_domain.c
> @@ -37,10 +37,5 @@ module_init(proc_execdomains_init);
>
> SYSCALL_DEFINE1(personality, unsigned int, personality)
> {
> - unsigned int old = current->personality;
> -
> - if (personality != 0xffffffff)
> - set_personality(personality);
> -
> - return old;
> + return ksys_personality(personality);
This looks ok, but I'd much rather just kill ksys_personality and add
an optional arch hook to reject personality settings for the arm64
special case.