From: Cyrill Gorcunov <gorcunov@gmail.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Jonathan de Boyne Pollard
<J.deBoynePollard-newsgroups@NTLWorld.COM>,
Andrey Vagin <avagin@openvz.org>,
Andrew Morton <akpm@linuxfoundation.org>,
Michael Kerrisk <mtk.manpages@gmail.com>,
Yang Shi <yang.shi@linux.alibaba.com>,
Michal Hocko <mhocko@kernel.org>,
Cyrill Gorcunov <gorcunov@gmail.com>
Subject: [rfc linux-next 1/3] [RFC] prctl: prctl_set_mm -- Move PR_SET_MM_MAP_SIZE out of prctl_set_mm_map
Date: Mon, 07 May 2018 10:52:14 +0300 [thread overview]
Message-ID: <20180507075606.692875939@gmail.com> (raw)
[-- Attachment #1: prctl-move-PR_SET_MM_MAP_SIZE --]
[-- Type: text/plain, Size: 1597 bytes --]
It is a preparatory patch so next we will make prctl_set_mm_map
to accept struct prctl_mm_map as an argument and the only
thing prctl_set_mm_map will do is to setup new memory map,
not handling any other operations.
CC: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.COM>
CC: Andrey Vagin <avagin@openvz.org>
CC: Andrew Morton <akpm@linuxfoundation.org>
CC: Michael Kerrisk <mtk.manpages@gmail.com>
CC: Yang Shi <yang.shi@linux.alibaba.com>
CC: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
kernel/sys.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux-ml.git/kernel/sys.c
===================================================================
--- linux-ml.git.orig/kernel/sys.c
+++ linux-ml.git/kernel/sys.c
@@ -1979,10 +1979,6 @@ static int prctl_set_mm_map(int opt, con
BUILD_BUG_ON(sizeof(user_auxv) != sizeof(mm->saved_auxv));
BUILD_BUG_ON(sizeof(struct prctl_mm_map) > 256);
- if (opt == PR_SET_MM_MAP_SIZE)
- return put_user((unsigned int)sizeof(prctl_map),
- (unsigned int __user *)addr);
-
if (data_size != sizeof(prctl_map))
return -EINVAL;
@@ -2063,7 +2059,11 @@ static int prctl_set_mm(int opt, unsigne
unsigned long arg4, unsigned long arg5)
{
#ifdef CONFIG_CHECKPOINT_RESTORE
- if (opt == PR_SET_MM_MAP || opt == PR_SET_MM_MAP_SIZE)
+ if (opt == PR_SET_MM_MAP_SIZE)
+ return put_user((unsigned int)sizeof(struct prctl_mm_map),
+ (unsigned int __user *)addr);
+
+ if (opt == PR_SET_MM_MAP)
return prctl_set_mm_map(opt, (const void __user *)addr, arg4);
#endif
reply other threads:[~2018-05-07 7:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180507075606.692875939@gmail.com \
--to=gorcunov@gmail.com \
--cc=J.deBoynePollard-newsgroups@NTLWorld.COM \
--cc=akpm@linuxfoundation.org \
--cc=avagin@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=yang.shi@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).