Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3191428ybg; Sat, 6 Jun 2020 13:41:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFuLb98vn9j7eAo6Ix3efhktuayABvOBfpLMTcYAf0o08BOCJKFfbOb5YNiA2x+vqzzcEH X-Received: by 2002:a17:906:528b:: with SMTP id c11mr14179186ejm.407.1591476085618; Sat, 06 Jun 2020 13:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591476085; cv=none; d=google.com; s=arc-20160816; b=XC2jo/XZ/x74T1Fu55LQOENpwmdWcAcWocSPIKodh8i15FT1/bihMI8Dw5W47anZQ3 Zj1P1LrdWsbznZkN1L8c9cSRtnmvwigrQxcdM0/exHUi1Xe0Q5S69A+bW6nYurM8Lvyl gNgXPUVTAgzFaJmVsl79tFcHmRHIjX3tthjViN0dhr9SZjQat4GctkpCqbwvIqZov/vO Q2EBSk5Vtyj1XCPDInLVqzGuYoidaZHoU/ibbSBy4mstmlO6MY4h1KXXJ7nWkWtAc9pA vzjLJdkj+iKAb3EWPrADatnyUoJBGIFnnkxyFCNWQ1HU7s03RH26KaIlJGqe9L/CoWPw BDxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:from:references:cc:to; bh=KSrWQwJjmAJNEonfa4tdj1uvKH8e2xUx3X/pNwRDYBI=; b=fYSBgIfzegqbClvCNj9zezJ6jr5QVfqrJVTbdPRiFRVnQbfRMn+i8Xgi7biY3bwLuR 84cB0j2pbLLbN3IYFTTQp+3azrdjP1QuqElzpgbFFJtFFSr85xu+UKLt/nLL1P99V8yX XW6JcGKic+t/j6pZ3GfH40Ir8ED4tcuGB1jCEvZCYFKBpKEN/jvW/AZAD4RUARgH+tVN PL+fdPH5XhtzeEgm+3jfmk5SFm8UkzHQKVBKfAkIbyiXdL8FE6ORy2iu3RSbtw0xOSne FrTOmR7mVRDomosADSjSc3LocK26Xn7dX3hCiZedIJcKjiwkL7lSPbId5u1ME06MyFIg j67A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si2984710edv.186.2020.06.06.13.40.47; Sat, 06 Jun 2020 13:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728865AbgFFUge (ORCPT + 99 others); Sat, 6 Jun 2020 16:36:34 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41594 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727957AbgFFUgd (ORCPT ); Sat, 6 Jun 2020 16:36:33 -0400 Received: by mail-lj1-f196.google.com with SMTP id 9so15863949ljc.8 for ; Sat, 06 Jun 2020 13:36:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:autocrypt:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KSrWQwJjmAJNEonfa4tdj1uvKH8e2xUx3X/pNwRDYBI=; b=QwEXQ28W32EJh9LZZX6qxOiVCuwFOyuWVjAhA3J6kVMr023pZisnuTdNsQlx+aif4D BbIgCRN8O9hZdvTs4S2h32ODM5GCps3uOA4YcVjLqAyz2jSbrPWB1btTDVkoWZ1rfJN1 JxNd3rOLoOhPAms/XWfy9xJ/w93uYjQE40EgTxA3CDgLJYm4wAqISG+BF5vQHkunyLal lzvfvBcB2JznAav6ym6Oi913T/Oj+qZ7xvDG6zlxvlQ7QJkyqHmtKcOQK4rvBS4D/S2B 0v302csKh8v+eHTFqFiqoWr4SjScQIfFyc4trOYJ1VNNfGYoBH4HMlI4rKbUuGh9Zkc4 qbZA== X-Gm-Message-State: AOAM5320QNHj9JIo0dyQIwwEMToN/3TjM3q5fX0rgiCsPwDc0mfy2WJm Y5LrUh2u1WqModoZuGkVz8TtlDCd31Q= X-Received: by 2002:a2e:a58a:: with SMTP id m10mr7399980ljp.346.1591475791000; Sat, 06 Jun 2020 13:36:31 -0700 (PDT) Received: from [192.168.1.8] ([213.87.137.116]) by smtp.gmail.com with ESMTPSA id y130sm2553195lfc.22.2020.06.06.13.36.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Jun 2020 13:36:30 -0700 (PDT) To: Julia Lawall Cc: Joe Perches , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org References: <20200530205348.5812-1-efremov@linux.com> <20200530205348.5812-2-efremov@linux.com> From: Denis Efremov Autocrypt: addr=efremov@linux.com; keydata= mQINBFsJUXwBEADDnzbOGE/X5ZdHqpK/kNmR7AY39b/rR+2Wm/VbQHV+jpGk8ZL07iOWnVe1 ZInSp3Ze+scB4ZK+y48z0YDvKUU3L85Nb31UASB2bgWIV+8tmW4kV8a2PosqIc4wp4/Qa2A/ Ip6q+bWurxOOjyJkfzt51p6Th4FTUsuoxINKRMjHrs/0y5oEc7Wt/1qk2ljmnSocg3fMxo8+ y6IxmXt5tYvt+FfBqx/1XwXuOSd0WOku+/jscYmBPwyrLdk/pMSnnld6a2Fp1zxWIKz+4VJm QEIlCTe5SO3h5sozpXeWS916VwwCuf8oov6706yC4MlmAqsQpBdoihQEA7zgh+pk10sCvviX FYM4gIcoMkKRex/NSqmeh3VmvQunEv6P+hNMKnIlZ2eJGQpz/ezwqN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p6Do+pRsOO1YNNO78SYABhMi3fEa7X37 WxL31TrNCPnIauTgZtf/KCFQJpKaakC3ffEkPhyTjEl7oOE9xccNjccZraadi+2uHV0ULA1m ycHhb817A03n1I00QwLf2wOkckdqTqRbFFI/ik69hF9hemK/BmAHpShI+z1JsYT9cSs8D7wb aF/jQVy4URensgAPkgXsRiboqOj/rTz9F5mpd/gPU/IOUPFEMoo4TInt/+dEVECHioU3RRrW EahrGMfRngbdp/mKs9aBR56ECMfFFUPyI3VJsNbgpcIJjV/0N+JdJKQpJ/4uQ2zNm0wH/RU8 CRJvEwtKemX6fp/zLI36Gvz8zJIjSBIEqCb7vdgvWarksrhmi6/Jay5zRZ03+k6YwiqgX8t7 ANwvYa1h1dQ36OiTqm1cIxRCGl4wrypOVGx3OjCar7sBLD+NkwO4RaqFvdv0xuuy4x01VnOF Subject: Re: [Cocci] [PATCH 1/2] Coccinelle: extend memdup_user transformation with GFP_USER Message-ID: Date: Sat, 6 Jun 2020 23:36:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/6/20 11:24 AM, Julia Lawall wrote: > > > On Sat, 30 May 2020, Denis Efremov wrote: > >> Match GFP_USER allocations with memdup_user.cocci rule. >> Commit 6c2c97a24f09 ("memdup_user(): switch to GFP_USER") switched >> memdup_user() from GFP_KERNEL to GFP_USER. In most cases it is still >> a good idea to use memdup_user() for GFP_KERNEL allocations. The >> motivation behind altering memdup_user() to GFP_USER is here: >> https://lkml.org/lkml/2018/1/6/333 > > Should the rule somehow document the cases in which memdup_user should now > not be used? As for now, I can't provide a counterexample. GPF_USER is more permissive than GFP_KERNEL. It's completely ok to use GPF_USER with copy_from_user. Given that memdup_user() was "silently" switched to GPF_USER from GPF_KERNEL with no callside fixes, I think it's ok to recommend to use memdup_user for GPF_KERNEL matches with no additional restrictions. Thanks, Denis