Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp2195964ybm; Sun, 31 May 2020 11:48:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuuGlZ15lKknWo29XuClw7AMBLlhUiGF+eXQaCHN3fUJbV3ofiIPGY0eND1q4QhOfEXzwD X-Received: by 2002:a17:906:d93c:: with SMTP id rn28mr4108708ejb.190.1590950925043; Sun, 31 May 2020 11:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590950925; cv=none; d=google.com; s=arc-20160816; b=RjE3uwrvTCBVpqn9j1eIAw0K1F/RC8gJ4OFZntyDh8xDgl4qBaXpRCaXdCQ/4w0YX5 Os+9bJePE8AMjLnaVZPJmi9TY/2ups8JuhQ23LeSUUvYA8Kh1L3B4qq4Gx7HG93Tbssj qDmc8m+4k2wePAZaQjROkpSyGPKpT2EJMgnldLefvDPCCK5KTuh13WF+F/58SOtPj9YB kxaV/Qu5rb+0qmN53iVXhLjYbXRmsZHemhxJ7POsmfwelPJbWwFeAgpazsf542DEsZKs dDzkHmxJ/PVEkPldhCywwrE1xDdFSsoOxaVgfnZ18dEkigdFQ+L4pw6qP3pmhIvXyMdV DOgw== 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:mime-version:user-agent:date:message-id:autocrypt :to:from:subject:cc:dkim-signature; bh=wJF5RxAIPr1Z085ztQEKIMj1ufqEqOGCzATfbjt7x70=; b=i4mYM0vlQVRYcn7BoDG5KmuAqlbA98bdJ6cdFyWGVuDsv5CmI/VY8BA28sL8arwF6P iv3cvS77nomjO3jtSNzh+ZgA239FS5pXlUETScJj93dyjiJuXRIQlUgqlvXWdmyYOeML iqfJPmOjgeendWDRgdjUrCCVmszDwa4MRrJNSYE+9r6jnO1lST55DCakRfKC0bRT7Kll fKIhLPuRNGCUDqVCf8GRzndW/tMmbjQXNd7TiWCcFsoPnNHqd2g0rkNl6FhrBzGp84tx 10JYDpdkjaT9rnUBk+zjzVNwvqL2XwYvjE4UCtO1CoOIo9uwP+RRE8Mpk18Nj1f3vcoB BP1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=nkkvEjv9; 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 v7si9530072edr.33.2020.05.31.11.48.19; Sun, 31 May 2020 11:48:45 -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; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=nkkvEjv9; 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 S1728241AbgEaSoA (ORCPT + 99 others); Sun, 31 May 2020 14:44:00 -0400 Received: from mout.web.de ([212.227.15.4]:36893 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbgEaSn7 (ORCPT ); Sun, 31 May 2020 14:43:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1590950625; bh=VHY2Rd27hP91ua6OJp8r+J35CrPjbKOZrxeujjkIEzQ=; h=X-UI-Sender-Class:Cc:Subject:From:To:Date; b=nkkvEjv9xMMwB7er1DQZR3gTNRaOmJEoXvZDrlll6iOputEIB2Q9Fb6aiBnAHqFpm fL17W0Tei5vGwCcsWk4FI8bwHUC7f1603IiK+dT/rLii583TgODcz8OePJk2+QDw/t t1AEBZiyBr9dTJ66U4Us4DZVWqad6AwhUFKBaWww= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([93.131.19.10]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LwHmQ-1ivYNj2pgM-0182bc; Sun, 31 May 2020 20:43:45 +0200 Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Joe Perches Subject: Re: [PATCH 2/2] Coccinelle: extend memdup_user rule with vmemdup_user() From: Markus Elfring To: Denis Efremov , Gilles Muller , Julia Lawall , Masahiro Yamada , Michal Marek , Nicolas Palix , Coccinelle Autocrypt: addr=Markus.Elfring@web.de; prefer-encrypt=mutual; keydata= mQINBFg2+xABEADBJW2hoUoFXVFWTeKbqqif8VjszdMkriilx90WB5c0ddWQX14h6w5bT/A8 +v43YoGpDNyhgA0w9CEhuwfZrE91GocMtjLO67TAc2i2nxMc/FJRDI0OemO4VJ9RwID6ltwt mpVJgXGKkNJ1ey+QOXouzlErVvE2fRh+KXXN1Q7fSmTJlAW9XJYHS3BDHb0uRpymRSX3O+E2 lA87C7R8qAigPDZi6Z7UmwIA83ZMKXQ5stA0lhPyYgQcM7fh7V4ZYhnR0I5/qkUoxKpqaYLp YHBczVP+Zx/zHOM0KQphOMbU7X3c1pmMruoe6ti9uZzqZSLsF+NKXFEPBS665tQr66HJvZvY GMDlntZFAZ6xQvCC1r3MGoxEC1tuEa24vPCC9RZ9wk2sY5Csbva0WwYv3WKRZZBv8eIhGMxs rcpeGShRFyZ/0BYO53wZAPV1pEhGLLxd8eLN/nEWjJE0ejakPC1H/mt5F+yQBJAzz9JzbToU 5jKLu0SugNI18MspJut8AiA1M44CIWrNHXvWsQ+nnBKHDHHYZu7MoXlOmB32ndsfPthR3GSv jN7YD4Ad724H8fhRijmC1+RpuSce7w2JLj5cYj4MlccmNb8YUxsE8brY2WkXQYS8Ivse39MX BE66MQN0r5DQ6oqgoJ4gHIVBUv/ZwgcmUNS5gQkNCFA0dWXznQARAQABtCZNYXJrdXMgRWxm cmluZyA8TWFya3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/5IBDfUqSANC8cWzHpWaHmSuU3JSAMB/N+yQjIad2ztTckZY pwT6oxng29LzZspTYUEzMz3wK2jQHw+U66qBFk8whA7B2uAU1QdGyPgahLYSOa4XAEGb6wbI FEE= Message-ID: <02c75f13-ec79-f4c0-f28a-8a354ea1f6f0@web.de> Date: Sun, 31 May 2020 20:43:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:TpXkXF2JRPr/W4FZQbSUnmsB4UqSMKn8QfSUcB7criwa2KXKJHd RfYV2avDv1tIOHerQI6RRF20lXGqcrSSi/07+7GXyQu8Z0GLO5rPzRQIC5lU8j03WzJsfLB iE5wJvg5I3uCj4jClh53t4QhuKTqjZsNznfIL3jdZFUSMckpXfhbtFGVYaoE8N0zEh+XfyE jQ5AWUmj4Wc63vDJtGGeA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:hmG6TNuFzTk=:GKrHRyaq9cAEbboiNb7vRi hagXSaIsLsPgHShb6diOepAnL+JECJVtgsXrZ41R4MgM7ZLyj4KjGamoJpEo32Y23dxxc4R1B qie7oDnV2z3RNDpw2KAK747sWegeglLZqPMiJ+Yh6hxsQLLhNFeYAexqTM7dNKVEvSo/8GXF1 PyzFB0YK4tspcu4l9GUEtRo5/V7MAIehzhkbomy1ep1mGUtmpBoHNF0a4ZcUl+r3kzfSLSJAF OC6g1riCT4NKXDM9LE0S+RLnY2uGxs4pqjMg95dK7SZrH/zqX4SA1UN6+28B+pEKX7p5sKwju lBTVuwkN7WST0YczANe3GJLqSIpgjSr+1YhgA23//LG+jAAOziWihk0P5R5/QAfEMCdi4grNF QjajmsbLHN+Ni5n0fGBaPim3s1kglfKzNx6SLQ8wCR8tfl2UR6snlQw6Zabl0HAeI39pWXJrd yiMhULRdL/F3k0UQK9ZOtLw8+kL+T0cAeCX420gDugviTopceNKwn/J7v/oo44tFfV7m2+Fes 8r9rEcyp1SQCj902Q/1cvv5mUPuxvrXLx7VrggdvxUAyArZSM1Qp0rfoBLDwml/XSrn2d56Yv hs865SVRzVtwMKJYDgcs3xlw7EKvOv68OVnyU2zag4lR/b1wSNAF5C9F7iVSK12zKk24KZYDh PvB928HRY3IyM5EdzxXfYkImKauAIdagcT89Z/kFgeVouFnQdy6DWlWy2IHJNz98rzDJAOLZI V5U+S/smpawoHHMwwTdyKmuxrFcXGJaBXrQ36Zra9vtTGrQqTxXdJw9spmo28nfOC5VlIGgPl IwX+3RzVNgafsKzoj1tvhF/l/YxGH2cA8dvRcftyKXGYKz/fdfJb64Ksn5XqIWprpXxTf5WQX pqXWxulQlvjqA9p5o/gRgSa3qNSazp1OX96dpU7/6m/7nnK3burMMtZaTLZR9H2zUtExGhb76 MS98fxxBc/6Z4Tm5KLnVgt3YxhUMd7bV8/jzotvGov+IpjhHGKk+HdIIECmZHE1mqSQk39Rkr Vq410rNbw6HS9nqjLncD38hR1OtMttgJF5q/bevNSWekTRNeM4ucZZPBQyvgoaTVVO2E5TbUg a6itx0X6bo8Hv0+F19/heToq53ViqkyWroMUYFb4EjYauWdx20BF/kM5OUUpQ+kn4oHaWMUP1 hnR8vcl0zTMmPd7lcKWcMi7frteS2yLVUg51rOh6sI4ND40fwXALx+Dk7wTv5rs7WhEirC/My yD7KXjw80E0zim8RQ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Add vmemdup_user() transformations to the memdup_user.cocci rule. > Commit 50fd2f298bef ("new primitive: vmemdup_user()") introduced > vmemdup_user(). The function uses kvmalloc with GPF_USER flag. Such a software evolution is also interesting. > +@depends on patch@ > +- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); > ++ to = vmemdup_user(from,size); How do you think about to achieve the desired data processing by the application of a SmPL disjunction like the following? to = ( - \( kmalloc \| kzalloc \) (size, \( GFP_KERNEL \| GFP_USER \)) + memdup_user(from, size) | - \( kvmalloc \| kvzalloc \) (size, \( GFP_KERNEL \| GFP_USER \)) + vmemdup_user(from, size) ) ; Unfortunately, the Coccinelle software does not like the following SmPL code variant so far. to = ( - \( kmalloc \| kzalloc \) + memdup_user | - \( kvmalloc \| kvzalloc \) + vmemdup_user ) ( - size, \( GFP_KERNEL \| GFP_USER \) + from, size ); Message: 25: no available token to attach to Regards, Markus