Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7661863yba; Thu, 2 May 2019 13:58:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/Juyjr5tbF7377iSfY8kaKJTQ+hs0OZtpPOGSYguCgDXOUKDztr3CsFWvDhvl48f0wZRY X-Received: by 2002:a17:902:3064:: with SMTP id u91mr6068343plb.181.1556830727207; Thu, 02 May 2019 13:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556830727; cv=none; d=google.com; s=arc-20160816; b=LvnS61aWi/zLC/dVTz15QF9CeUOB6cbmpFLq47Yq3z+ivkanIkI2DG6p3Gu8V9JmvI nXNUxina5dwnQHfWKPPeO7LquU3gb5wgfyTnrfO1kxkHmO47sHO/3JiYPuYA1Qr1COav w3DKYdXek1ZdZU35K0EIKzTMqv0uLXIEEMk0KfKQialY62vs9TvOCSqbtuf9sUGHvYfj 6C16wdagZzHjjgcpMdKlTJ3mIRUQmhCaKVTI7t2Bry0Y/RTFl0LMagOGiW6sJr0qHdR1 B9wgww6zOojv1KQk72XxeSwxxw5kLW4BXwMbiui9EZRU9e7BAAmkuHOvpIq++zxsLM7t uzjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IM6gRPP9vGYAtrlAGvrZ2f9cRbqq+2XFYVZx5ounwgo=; b=ADvlLTi1ZWOnjbyxpdOpIjCddTG1HS92oXewJ2vpmapJ+Ra7kn5AkT4yFvbYGoqQdi YwCjk2lqSuAXNNHe4bMV2K6QL7dtSXTvsuyHcOYsPvRD4tN1ILzYVKhG+1PCh9SuWt2N msxgJS6/lnjwL0OYh5wP54oM4uB8kPnf0j0yMqA9zLXVNKz0Enf+1RJpo6tIvHjufSzl D7u91jcs5sSoyBBxknBnQZiHBJCzKfZ48U7U2ZJLrmM5DMeVb24wYlw/V+SVRuIVmVQu O8FVVG+XhjQ+XsiCWGnwAl3VcwgmitNg90YUrV8/yaJyjJmnMOnQ4EmVw8OMWSlPyc4v 9Qxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=faB2OjTU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si83001pgp.378.2019.05.02.13.58.32; Thu, 02 May 2019 13:58:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=faB2OjTU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbfEBU5N (ORCPT + 99 others); Thu, 2 May 2019 16:57:13 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46987 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfEBU5N (ORCPT ); Thu, 2 May 2019 16:57:13 -0400 Received: by mail-lj1-f196.google.com with SMTP id h21so3442878ljk.13 for ; Thu, 02 May 2019 13:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=IM6gRPP9vGYAtrlAGvrZ2f9cRbqq+2XFYVZx5ounwgo=; b=faB2OjTUqLUYYuLoMp7WpkRaNTZEgletqliLc0MZ4+/osrjMIZcLCcfxLJ8eZrgc+F pPhuKsTJfgrf8obzFfOQ9DBQswWwpy3rOilB/ZqgtZ6P7FAtpvwKlPGCcsEZiNfQYsGP sFT/rV14J7xZDOI0G93FUODYhEA2zSR6VoQx36G9kvuAdRt0XaRmiCNreHLM2HzGfI4T 3e9FrHEO6d1DITNJXERhocTux647SkuM3zhlBM7n5lgxHkHVHWyrFTMyBy0e5dwPzHs4 TLM3Hd9ZAhHg8Dpoasypghsr0LCvxn8F7uUpb05vRxf2ntvETOQUwmk7zJWZN6NrlsUv qr9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=IM6gRPP9vGYAtrlAGvrZ2f9cRbqq+2XFYVZx5ounwgo=; b=fqs68XeeXl0KvtQeFwdUqq5FrxZjxxNDmZBQsnPt+na4VI5PxXYAu/KaE/kOmRDh2w SzE5EvjnQ/c9fJBCV548ZpBk5oda2RdFgHPXpBhul/CsP+lACNJAF4MsZAW3ZnzzurAl TWX1XD1LRyMqcTZb9nYsJLqI5KJzyGw/oxlleZ67XfDej1b8SioXSEK8cImiidT7ucQM EvpnEx/6au4o58mRixHtRL7Bkqjmss4R/aEJFZEv95VgmqG44RMt62EwCTzMU55qjkHx xxqZrkZpV0sPeAYnoZSQswF4nYucSLuiv/0Tz5JOW+kfFW3I9rLppjvFW+PHfg5eF+dN MSyg== X-Gm-Message-State: APjAAAUBHBGtOJmjNo3sxf4sKRbq376zGkLQNxzGg3gl3JHm7M3YUBJr sOXk/WEDEs71m5vaToim9GY= X-Received: by 2002:a2e:81d0:: with SMTP id s16mr3098436ljg.145.1556830631022; Thu, 02 May 2019 13:57:11 -0700 (PDT) Received: from uranus.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id z16sm40915lfi.9.2019.05.02.13.57.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 13:57:09 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id 4AE3B4603CA; Thu, 2 May 2019 23:57:09 +0300 (MSK) Date: Thu, 2 May 2019 23:57:09 +0300 From: Cyrill Gorcunov To: Michal =?iso-8859-1?Q?Koutn=FD?= Cc: akpm@linux-foundation.org, arunks@codeaurora.org, brgl@bgdev.pl, geert+renesas@glider.be, ldufour@linux.ibm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mguzik@redhat.com, mhocko@kernel.org, rppt@linux.ibm.com, vbabka@suse.cz, ktkhai@virtuozzo.com Subject: Re: [PATCH v3 1/2] prctl_set_mm: Refactor checks from validate_prctl_map Message-ID: <20190502205709.GD2488@uranus.lan> References: <0a48e0a2-a282-159e-a56e-201fbc0faa91@virtuozzo.com> <20190502125203.24014-1-mkoutny@suse.com> <20190502125203.24014-2-mkoutny@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190502125203.24014-2-mkoutny@suse.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 02, 2019 at 02:52:02PM +0200, Michal Koutn? wrote: > Despite comment of validate_prctl_map claims there are no capability > checks, it is not completely true since commit 4d28df6152aa ("prctl: > Allow local CAP_SYS_ADMIN changing exe_file"). Extract the check out of > the function and make the function perform purely arithmetic checks. > > This patch should not change any behavior, it is mere refactoring for > following patch. > > v1, v2: --- > v3: Remove unused mm variable from validate_prctl_map_addr > > CC: Kirill Tkhai > CC: Cyrill Gorcunov > Signed-off-by: Michal Koutn? > Reviewed-by: Kirill Tkhai Reviewed-by: Cyrill Gorcunov