From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52784 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964999AbeFSPpq (ORCPT ); Tue, 19 Jun 2018 11:45:46 -0400 Date: Tue, 19 Jun 2018 16:45:41 +0100 From: Catalin Marinas To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, marc.zyngier@arm.com, linux@dominikbrodowski.net, hch@infradead.org, james.morse@arm.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, dave.martin@arm.com Subject: Re: [PATCHv3 13/19] kernel: add ksys_personality() Message-ID: <20180619154541.7uugqiquxzkcpfwj@armageddon.cambridge.arm.com> References: <20180618120310.39527-1-mark.rutland@arm.com> <20180618120310.39527-14-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180618120310.39527-14-mark.rutland@arm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jun 18, 2018 at 01:03:04PM +0100, Mark Rutland wrote: > diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h > index 73810808cdf2..14312d334345 100644 > --- a/include/linux/syscalls.h > +++ b/include/linux/syscalls.h > @@ -80,6 +80,7 @@ union bpf_attr; > #include > #include > #include > +#include > #include > > #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER > @@ -1277,4 +1278,14 @@ static inline long ksys_truncate(const char __user *pathname, loff_t length) > return do_sys_truncate(pathname, length); > } > > +static inline unsigned int ksys_personality(unsigned int personality) > +{ > + unsigned int old = current->personality; > + > + if (personality != 0xffffffff) > + set_personality(personality); > + > + return old; > +} > + > #endif It looks like this is identical to sys_personality() in kernel/exec_domain.c. Should you call ksys_personality() from there directly (a few lines saved)? -- Catalin