From patchwork Mon May 7 07:52:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyrill Gorcunov X-Patchwork-Id: 10383389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 08E5160159 for ; Mon, 7 May 2018 07:56:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F18F828B10 for ; Mon, 7 May 2018 07:56:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E445B28B1B; Mon, 7 May 2018 07:56:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3685B28B10 for ; Mon, 7 May 2018 07:56:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 571506B0266; Mon, 7 May 2018 03:56:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 520C56B0269; Mon, 7 May 2018 03:56:21 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 410156B026A; Mon, 7 May 2018 03:56:21 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-lf0-f72.google.com (mail-lf0-f72.google.com [209.85.215.72]) by kanga.kvack.org (Postfix) with ESMTP id C7B676B0266 for ; Mon, 7 May 2018 03:56:20 -0400 (EDT) Received: by mail-lf0-f72.google.com with SMTP id m18-v6so8686991lfj.1 for ; Mon, 07 May 2018 00:56:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:message-id:user-agent:date:from :to:cc:subject:mime-version:content-disposition; bh=kbX2ihNbGk1lOhAJgfSMC5GmuA94ClLnAwYA0NPa9Fw=; b=BgIOMaEuBqwqqKjocz1o97r6RHLa13vv67uX6hgtjzII/4zyZezS1RECXo9zFDfEhP Z5TcBMIUGX0ez8yYdFTRyy0+E/Hkg7LAcLdyI95yzdPER6aCsnRWlxWytMv6y2j9lSoq AIzj3jAaqTfCCH0JBmjGxY5Hs7+PjfDdItsvzJyIq8QfizZ9Rw8qpIN7qRETDRDzp8lq BOZ9iSknIl+Q0+e2wyJ1zeKXWJL/S3N0OvzshF3JSFa1bczPQ9xhzl0qiEZX9jgqcbgR gmBRfMGBQS0nmU1VeEBWtjVxjU0RJgGAB62V0JbLJUS/7gBLsh+N31WNzqETaEsy049T 7hpw== X-Gm-Message-State: ALQs6tAArY23pkUITk/26SSMol66Hza0nN3nJEH2cr1qe8OonjNystJu f7Sc9nOLOADpN7R8TuoOF6dbzLe5LAZX38Z4xoVLT+k854glIhWLhDdO3+TF/by5AIlctWB1xFS hY7agvbH+vrO5LG8dCcOT+HdmodGxF80lk6eDIJBDmQAnEF6V9bT79qNIaawpWxXog6C327KV7k ZhqJJRH/9P+VUr44NPTG/fDNoI3FQnYPtT/LI3A8WWn6MctwjBnMKAwMl7htrzirUqP8wPcH8Du cWpONJmx7449rlCxCWKRhF0bZqNWtjOO0tku94tcC/g3dz5t1I0XFrX0BF+lWQWqnAaKzJ+sRep /4A2eioCYNNDJ1oGYNOusQhDAn+Sw7evN4GLH2re9zt35q0ZnmeR0Bk49RBAqqIRHa1OWlWM3La N X-Received: by 2002:a2e:944d:: with SMTP id o13-v6mr6209409ljh.65.1525679780290; Mon, 07 May 2018 00:56:20 -0700 (PDT) X-Received: by 2002:a2e:944d:: with SMTP id o13-v6mr6209384ljh.65.1525679779695; Mon, 07 May 2018 00:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525679779; cv=none; d=google.com; s=arc-20160816; b=lLVIJRLqexW5teZKHuYRyjBR3v0EVtSGMnIH4fagnmW3KmaHLpIux47OPugOALZu1W VvkBlE4j1ZgcFhKK1sdllmb3ppy3NhxtTAO3jEwm79XNr37sN3FwX2bjxZDtAspFeG2Z DKaSM5OYWMY7WdGcsGMN7v9Z0q1EGPI4fSIqTe9i9P7M1mV6poesJvwTfFAaOpEf7trR 5+cmDYD2QkisVuw6/4eJ0/jQGu9DzzXw/6EPr0PLSYdUmP6rWXP/1k3Zb8kHUI7hgNkU NL1ARhJKLKvLUMjG0qsajX04dI00Ey/k1uhZrT1HLIEYYsZ225St7lBG2SeKjRhYV6yZ LMWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:subject:cc:to:from:date:user-agent :message-id:dkim-signature:arc-authentication-results; bh=kbX2ihNbGk1lOhAJgfSMC5GmuA94ClLnAwYA0NPa9Fw=; b=ovp8qqOfhHbeusLTWq6bhEbl6AfOhOCYuRZm4S+I8NsWyZNPWqta8IQRgjodkUdQGb dUXxV+5m2MwveFbKTL6TivxKFe5l5jjMsxucn69hapltYYv9FRKKevIqbJJBHxVD8vea Mv4kPN0keMg7gbaqiMpKUeJLzOLJkMpxlqIo1r5RYJnmlxWJG5fHS3iZqZGMJ0MNl5Ey ELmj8SDzdREJUldIBbfjHlklMjIAwi6+CKDRFor5Qm46g4oCnCzlpYzxqCSy2/9bBNNz Urqwd3EuVlzJIZGewBDWAWgW/9Gxz/3ZaruJwuWVAkwQpjG58l8dmIta9KumfdCJ0wtu e/fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CqN0cDX+; spf=pass (google.com: domain of gorcunov@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=gorcunov@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c9-v6sor731583lfb.54.2018.05.07.00.56.19 for (Google Transport Security); Mon, 07 May 2018 00:56:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gorcunov@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CqN0cDX+; spf=pass (google.com: domain of gorcunov@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=gorcunov@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:user-agent:date:from:to:cc:subject:mime-version :content-disposition; bh=kbX2ihNbGk1lOhAJgfSMC5GmuA94ClLnAwYA0NPa9Fw=; b=CqN0cDX+K9jy+/1BLH2Y9aqSMjdggZY6U8eeIHDNgSZ1e7rCOVqpGkXGizMJH8Z1sx JREnsGVVucYxu0lgk+/2VYGJlSt4527Y/khACsYvZqxCvopEXXtpVwsZGwhlVlu5wgje Pmer+XacDpTQ3fP0MviSTOS44mleuoXpr5p4qo0S+FJeB1rCoX8jKC1m07xW50jFXX6j RMmGTQlZqQd9sSi/8N66cWGUscaORQDoAKgtW/97VoL7qhL4Zg09G9WuWd+NV3m2lUR2 l+S4aJWSy69elnLRf1/VzJKVlkdMb4ujMR4YCuSkKSzax5HEua9cPT0IUxEwJBjrosXd 37WA== X-Google-Smtp-Source: AB8JxZojotv2VF064ndZh4g2pXqDkCHHwK3xi8IsuUfFWVgntgfSixBFRsiVVzPs2igOtb1Su3l7uA== X-Received: by 2002:a19:c184:: with SMTP id r126-v6mr23821563lff.116.1525679779357; Mon, 07 May 2018 00:56:19 -0700 (PDT) Received: from uranus.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id p88-v6sm4196828lja.0.2018.05.07.00.56.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 00:56:18 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id BC88946075A; Mon, 7 May 2018 10:56:06 +0300 (MSK) Message-Id: <20180507075606.692875939@gmail.com> User-Agent: quilt/0.65 Date: Mon, 07 May 2018 10:52:14 +0300 From: Cyrill Gorcunov To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Jonathan de Boyne Pollard , Andrey Vagin , Andrew Morton , Michael Kerrisk , Yang Shi , Michal Hocko , Cyrill Gorcunov Subject: [rfc linux-next 1/3] [RFC] prctl: prctl_set_mm -- Move PR_SET_MM_MAP_SIZE out of prctl_set_mm_map MIME-Version: 1.0 Content-Disposition: inline; filename=prctl-move-PR_SET_MM_MAP_SIZE X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 CC: Andrey Vagin CC: Andrew Morton CC: Michael Kerrisk CC: Yang Shi CC: Michal Hocko Signed-off-by: Cyrill Gorcunov --- 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