mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sys_personality: Streamline code in sys_personality()
@ 2019-11-26  9:40 Wang ShaoBo
  2019-11-26 11:28 ` Mark Rutland
  2019-11-27  9:43 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Wang ShaoBo @ 2019-11-26  9:40 UTC (permalink / raw)
  To: cj.chengjian, bobo.shaobowang, mark.rutland, huawei.libin,
	guohanjun, xiexiuqi, wcohen, linux-kernel, mtk.manpages, wezhang

SYSCALL_DEFINE1 in kernel/exec_domain.c looks like verbose,
ksys_personality() can make it more concise.

Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
---
 kernel/exec_domain.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
index 33f07c5f2515..f7a0512ddc23 100644
--- 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);
 }
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sys_personality: Streamline code in sys_personality()
  2019-11-26  9:40 [PATCH] sys_personality: Streamline code in sys_personality() Wang ShaoBo
@ 2019-11-26 11:28 ` Mark Rutland
  2019-11-27  9:43 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Rutland @ 2019-11-26 11:28 UTC (permalink / raw)
  To: Wang ShaoBo
  Cc: cj.chengjian, huawei.libin, guohanjun, xiexiuqi, wcohen,
	linux-kernel, mtk.manpages, wezhang, Christoph Hellwig

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.
> 
> Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>

FWIW, this looks fine to me:

Acked-by: Mark Rutland <mark.rutland@arm.com>

I'm not sure why I didn't do this initially; adding Christoph in case he
has any comments.

Mark.

> ---
>  kernel/exec_domain.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
> index 33f07c5f2515..f7a0512ddc23 100644
> --- 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);
>  }
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sys_personality: Streamline code in sys_personality()
  2019-11-26  9:40 [PATCH] sys_personality: Streamline code in sys_personality() Wang ShaoBo
  2019-11-26 11:28 ` Mark Rutland
@ 2019-11-27  9:43 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2019-11-27  9:43 UTC (permalink / raw)
  To: Wang ShaoBo
  Cc: cj.chengjian, mark.rutland, huawei.libin, guohanjun, xiexiuqi,
	wcohen, linux-kernel, mtk.manpages, wezhang

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-27  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26  9:40 [PATCH] sys_personality: Streamline code in sys_personality() Wang ShaoBo
2019-11-26 11:28 ` Mark Rutland
2019-11-27  9:43 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®