Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp808680ybt; Wed, 17 Jun 2020 14:44:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+pDY6PFu85eJKDqRcNOsPddwz0xP975guWtc2Hd/1u+UAkBZ2Ybf2PjVUbhqxog2kzuYM X-Received: by 2002:a05:6402:3106:: with SMTP id dc6mr1069021edb.375.1592430293360; Wed, 17 Jun 2020 14:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430293; cv=none; d=google.com; s=arc-20160816; b=iAd2uG1gE75Jhvg6GsYI9g4ZbHkeLZp2w87YYmsq8eXcgbGLCXY50BIyIaRtE7SKkM 6Y+NpiwzDKX3gCV0i7OZ/iShvCmkme359Gbu36RsdrMa+/Sw3QCU6O0F3EBkw9g0J5tZ mZuf0hpcjZ+XnabAmwlpApLaPtpAYs1EJ9tYbKh7acqDxroPr6mdGBQ3qXXA4ANDzEU5 hSnfoZk8ebjomEdVfwYhCYIeocqtfa6t66V73iJAlST5LppasPyNqdtDQ6xW8IseNTUv LEbT0KyRt6IvyiDC1B/OL9TwiymLMi20wqomem9I3eKudWbOT3AUoYIOPF9ZS6HsPO+t KmwQ== 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=kNH2cxY4KDrC9kt0EU9vsV9hFe1zPGyyBSCC5XdOrc4=; b=bJ5PD3oJSwGolyY/cwYwllB9+fOWHsVzBsCfP8/uGYdRJdBZTjwjnmseLm7NixDi1v hUZH39KDVBt9lKpz7Sz2Y9t/f0T+jR3oZFuKl9+5Z2wQRatATJfM3A/dzd85KADtHFu0 AMUtitcXKi9tOgL03vU75ps1rTFGZl5EtpwOtsI9018dkm7iWNPEkIvnijrNGCa25HD+ jrcOK/FWGnEWwj5/b8Sz/CnvU7bUBOABBy966FDlVRRRzDD99bBSIFVBfmh6D4olCh/m iqIhXcg+FS9VQOGwX8ZNS8KADONFLt11peKlOIbpJBkPFDDtwHfQ5Z6gGwoCfqmjCEUs Gt9w== 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 bc22si745104edb.368.2020.06.17.14.44.31; Wed, 17 Jun 2020 14:44:53 -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 S1726920AbgFQVml (ORCPT + 99 others); Wed, 17 Jun 2020 17:42:41 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:35113 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbgFQVmk (ORCPT ); Wed, 17 Jun 2020 17:42:40 -0400 Received: by mail-lf1-f67.google.com with SMTP id t74so2245836lff.2 for ; Wed, 17 Jun 2020 14:42:37 -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=kNH2cxY4KDrC9kt0EU9vsV9hFe1zPGyyBSCC5XdOrc4=; b=GzPeL1TqX/N8lHDd3bSEac7ZUIFe4Ksp9+nV06NVUGHHfNH2tE4KM1ZR2/60ujxUHk XsPYbp9WSVEzdWkoZV4//+mrXZ7ZBdAXpoQzffiQT7glN+YfG+9LVkk3AJ7a5KU8+N9E 8mlebzx/0BfkTwUo+FmdDyAlNQVEkst7Hy0z9/PsAgdlgyzNmjh5KI3odAW8tnkLCOhs 9q0bPe0BnsA1nl89Yb4+uRjpTIznD8B0l9lttGajP+5xs2SsYI4KJG8RJxCKxKfhdcGe 16eE4Or8pJQ2C0npO5ozGxBPpqmcWjvLRbQMMTLW4xswUTRo7a+CRu9NXih0mLtgvD7F dniQ== X-Gm-Message-State: AOAM5324OGie6yBd4fzXAm4kjDY83CxrwAosyK/G963apz1EFDxJSiE6 t+EG3gQ8A2xdaBYYapaIlcJoxIDL3x4= X-Received: by 2002:ac2:5e6c:: with SMTP id a12mr501765lfr.35.1592430156447; Wed, 17 Jun 2020 14:42:36 -0700 (PDT) Received: from [192.168.1.8] ([213.87.137.195]) by smtp.gmail.com with ESMTPSA id r11sm223288lfc.29.2020.06.17.14.42.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 14:42:35 -0700 (PDT) To: Julia Lawall Cc: cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org References: <20200604140805.111613-1-efremov@linux.com> <20200614215414.40034-1-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+hNMKnIlZ2eJGQp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gPa0Adlp6Do+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 v3] coccinelle: api: add kzfree script Message-ID: Date: Thu, 18 Jun 2020 00:42:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.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 >> +@rp_memset depends on patch@ >> +expression E, size; >> +position p : script:python() { relevant(p) }; >> +type T; >> +@@ >> + >> +- memset((T)E, size)@p; > > This is missing a 0 argument. > Thanks, I will send v4. > > >> + ... when != E >> + when strict >> +( >> +- kfree(E); >> ++ kzfree(E); >> +| >> +- \(vfree\|kvfree\)(E); >> ++ kvfree_sensitive(E, size); >> +) > > I'm not sure why you want kzfree in the first case, but kvfree_sensitive > in the second case. > As for now in kernel: memset(E,0,...) && kfree(E) is kzfree() There are no vzfree or kvzfree functions. Thus, we use kvfree_sensitive(). Maybe it's worth to wait for this patchset: https://lkml.org/lkml/2020/6/16/1163 With it the rule will use: ( - kfree(E); + kfree_sensitive(E); | - \(vfree\|kvfree\)(E); + kvfree_sensitive(E, size); ) Thanks, Denis