Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp255576ybh; Tue, 21 Jul 2020 23:03:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGs6nhec7FvK6NaEkEy6ZUhV7gG0zsb0AtbyZhBywPYR6EojC5UOzNMtAQlx80TjLGIa5x X-Received: by 2002:a05:6402:13d0:: with SMTP id a16mr29021182edx.269.1595397796745; Tue, 21 Jul 2020 23:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595397796; cv=none; d=google.com; s=arc-20160816; b=qiaPZ1/QSV5m8XFD/WG8WJrN92ur3Ege/4E1Tn5R/+BNhhymjmEc1Xzdn9lCxgNxCx wbU2xHaRz+6nGjgv/+rG6JpU5WZoGzAPCFtHLpnB9KxUf8SCq5IvV31MaGYmoAvFmnYx /NNFO3fXV/wfZMVdroMO+oIupP6jj7dkO6RjhE8lSrDVR41dBuLOVhyBVz2x175H3W+C 42Bd7SYtjkHluuKVK48GXr6anBN28yhl8lZkwYfVkdvLHYGBA1NqZ1AptGEGWAxnHNca abziez5VoLZSAW6R/v6lZvi/TFcznMXCQxOLV8FSZd5FMR+hyXHh0VvGLSHrC03kbQOH Hb1g== 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=Fxzk0G8AIqGpshSdtwQaJWsAfcmGkoMXp0o1l6Vb0T8=; b=W0Z3Go5bjwrFO3fEfFA7WMT2Vo3KZKvrh8XpBbVOxJYLEf9HaXdj2W1/rBtw8PX19D 0Tj+b3a8FrXTCxrwCpXVYD9605O61t/TKEDo+8LfZXahpRWhrpXNerHfAsb5wGwjyZWz 2xn5DHNtn5lmfbxg675vzCMt9dUI+HGeneJZrFpd4pH7y6+qX9FK/3oY8S+ie1RrmewX exOG4GiKWLU3cymOaE+KfO78nu6zBVegY5vh7+i4Jf02I0iPqlrDY8WjgzwZM2+I7DWl +ZaPBTeSxGsui55v9TqxgBnNep74uXGFy0iSbvdYuSNuVHtKNfisuZpwFxsg3xyKDNUC gttQ== 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 u17si13966795edd.139.2020.07.21.23.02.53; Tue, 21 Jul 2020 23:03:16 -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 S1728008AbgGVGCl (ORCPT + 99 others); Wed, 22 Jul 2020 02:02:41 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:3090 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbgGVGCk (ORCPT ); Wed, 22 Jul 2020 02:02:40 -0400 X-IronPort-AV: E=Sophos;i="5.75,381,1589234400"; d="scan'208";a="354990745" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2020 08:02:37 +0200 Date: Wed, 22 Jul 2020 08:02:37 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Denis Efremov , Coccinelle , Gilles Muller , Masahiro Yamada , Michal Marek , Nicolas Palix , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user() In-Reply-To: <0b326e2b-723c-3482-c0ef-5d6592a9c6cb@web.de> Message-ID: References: <0b326e2b-723c-3482-c0ef-5d6592a9c6cb@web.de> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-416411769-1595397758=:2918" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-416411769-1595397758=:2918 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Wed, 22 Jul 2020, Markus Elfring wrote: > >>> +@depends on patch@ > >>> +expression from,to,size; > >>> +identifier l1,l2; > >>> +@@ > >>> + > >>> +- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); > >>> ++ to = vmemdup_user(from,size); > >> > >> I propose to combine the desired adjustment with the previous SmPL rule > >> by using another disjunction. > > How do you think about to check run time characteristics for > the following SmPL script sketches? > > A) > @R1@ > @@ > // Change something > > @R2@ > @@ > // Change another thing > > > B) > @Replacement_with_disjunction@ > @@ > ( > // R1: Change something > | > // R2: Change another thing > ) Markus, you are welcome to try this since you are concerned about it. But it doesn't matter. julia > > > >>> +@rv depends on !patch@ > >>> +expression from,to,size; > >>> +position p; > >>> +statement S1,S2; > >>> +@@ > >>> + > >>> +* to = \(kvmalloc@p\|kvzalloc@p\)(size,\(GFP_KERNEL\|GFP_USER\)); > >>> + if (to==NULL || ...) S1 > >>> + if (copy_from_user(to, from, size) != 0) > >>> + S2 > >> > >> * Can it be helpful to omit the SmPL asterisk functionality from > >> the operation modes “org” and “report”? > >> > >> * Should the operation mode “context” work without an extra position metavariable? > > > > This is fine as is in all three aspects. > > Is every technique from the Coccinelle software required for > each operation mode in such data processing approaches? > > Regards, > Markus > --8323329-416411769-1595397758=:2918--