Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1295010ybg; Tue, 2 Jun 2020 06:27:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEO3CMtOhaC8WnftZSUoBa3PXRRerL3f4HGSisxe1x7edMeEbDoR1OOJicCnUnDwfKgXGQ X-Received: by 2002:a17:906:27c2:: with SMTP id k2mr23028775ejc.239.1591104440602; Tue, 02 Jun 2020 06:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591104440; cv=none; d=google.com; s=arc-20160816; b=BJfX/w2e0QcdH6VQSIDtiv0UoRMguCOE/wQ2l+59zO0moNvgIgz/C+DtOEPuxcUcEN hV7GqDa6KmuSWIYf+itWOExKho69ON5JwlivpghZ/LM4Iao2PqmmzVBBiaeteDNaH3ba Kf7GzwTVH9rTTSdxkHjC+aAg/vXwRmV1pcDmoy/U5nQ+McYA6k1odSyNTbtOrXA1rzny 2bhWVUv32ufTEGVnvLB8UlWcoQ7E0Ocd/8Jk5fkzQyFsMAd2NVesbhjUlK/azdlLDNYU 0eKIgeLMqt4zqS6nCyrIC03tBWrAGfO/5MUZpru6Qj6pdgr6g9Aqhzp31kjyMw3+q02L E1/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=Gzf1GnNqOGpa3ErZc9SMuTXmaRE4kTtqo/SQtJGrdUw=; b=VbZ8fg6rXZzxtAaN0fgUuhmvBxcXCrF+Ep2GZaR/MsRHY6cPbF6FZa0SDn6fDyb2Gc al12uRJjn68ZzomECC7qp6flqhkOChnC7lWWkmcNrEWZz8z/eyHwzCsyHXbGjBrK3UVf dghbUGpaKXjRjxibKSpptY+6VbKR5VSo89RFaLvV/Bfs75S8Gi1zyxvI8BRA51eMuG2q 4+kQnbQzZKqmodknh+0ka6lDIweuKhMji4yNskiLfq5so7k42vaJy7NTprZa9eE8p7Yz rirHHj1bv0zRYApK2rC1ZDhM98/eCGR9HRaUr/6a4wM6m3X4GK1nhDEU3aLd6Zh56AYn Zf9A== 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 y18si1503773ejc.318.2020.06.02.06.26.56; Tue, 02 Jun 2020 06:27:20 -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 S1726647AbgFBNYh (ORCPT + 99 others); Tue, 2 Jun 2020 09:24:37 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:34921 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgFBNYh (ORCPT ); Tue, 2 Jun 2020 09:24:37 -0400 X-IronPort-AV: E=Sophos;i="5.73,464,1583190000"; d="scan'208";a="452548787" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 15:24:35 +0200 Date: Tue, 2 Jun 2020 15:24:35 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Denis Efremov cc: Joe Perches , linux-kernel@vger.kernel.org Subject: Re: [Cocci] [PATCH 1/2] Coccinelle: extend memdup_user transformation with GFP_USER In-Reply-To: <20200530205348.5812-2-efremov@linux.com> Message-ID: References: <20200530205348.5812-1-efremov@linux.com> <20200530205348.5812-2-efremov@linux.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Thanks for the patch series. I will test them and try to push them to Linus shortly. julia > > Signed-off-by: Denis Efremov > --- > scripts/coccinelle/api/memdup_user.cocci | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/coccinelle/api/memdup_user.cocci b/scripts/coccinelle/api/memdup_user.cocci > index c809ab10bbce..49f487e6a5c8 100644 > --- a/scripts/coccinelle/api/memdup_user.cocci > +++ b/scripts/coccinelle/api/memdup_user.cocci > @@ -20,7 +20,7 @@ expression from,to,size; > identifier l1,l2; > @@ > > -- to = \(kmalloc\|kzalloc\)(size,GFP_KERNEL); > +- to = \(kmalloc\|kzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); > + to = memdup_user(from,size); > if ( > - to==NULL > @@ -43,7 +43,7 @@ position p; > statement S1,S2; > @@ > > -* to = \(kmalloc@p\|kzalloc@p\)(size,GFP_KERNEL); > +* to = \(kmalloc@p\|kzalloc@p\)(size,\(GFP_KERNEL\|GFP_USER\)); > if (to==NULL || ...) S1 > if (copy_from_user(to, from, size) != 0) > S2 > -- > 2.26.2 > > _______________________________________________ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci >