Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1565768ybg; Thu, 4 Jun 2020 13:02:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt+5sDL5RsNg3iP1kQ8efnIB6eIYnY4rfvD6HIxo88RuU4m3mTXZktzx4PxWrGPpvl7kdQ X-Received: by 2002:a17:906:3411:: with SMTP id c17mr5166526ejb.536.1591300933190; Thu, 04 Jun 2020 13:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591300933; cv=none; d=google.com; s=arc-20160816; b=Hu3LrEkTI79thDMrWi/VAVPg5O3QBPL0rOhLxDzLooZzE6ueZUafA5gXgc2LY7EffS ZsNeh5vI48yivBo3egFpTLHr7DmCk2AjVAuy7aHYRaWdJOKnpn1OyNrP7IP+4mH/xAUQ V2wNtv6ps25ilqYX6CbJ/VQV2xCKEP2wTLmgQwW7wBDU9vfL/+ID/18zxSVZIestD0ZB 3yqczeWjIHgnuqUMOhlsTIX8kuiaWnve+RlrgMPHD1AD+KnaTxLBdwdmoL67FQWH9IQQ Xz/3GOE1F7G9db7MWkZ8FykZSFvgXAHtxcAtaOWVguFXPeecDcViK5HqP6rn7oxJmtDn aNLw== 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=RNRUjxoiKmwHC3dyOF9BFvGpYmXMS4aKYIRix3m+P6I=; b=IVO+6MI7rgirYyYGVPMGI5lyhkRzaFBCM+SiCE1NPYhMr1z1BFeD0jG0nK1kFMQ26A DjWVVmb6438sFazl+zl9QtHgc8egQk2K1LqO5CuDSry2QRHpte3ybC1xmryxPj+vG4cL GTBlSeQSFUbJ8KT58suDUA1zjY4OnFsLhJqYSgVHoETE1h9okeLFIaHjV28gO46pj6m6 Fc8WY3HQuM9wib+Vvc+eZH68T2AG/GlxN5mhl1K1kuhxh4vMDXqIx7BePLx5vu78RLOH gluQmhZcTKLvvvOf1cdLN2LIOE1h1R9pS6jYp7A+HNvdXIIZuNR+884fB3eAbCFlV/uN mrBg== 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 dc20si2074583edb.75.2020.06.04.13.01.50; Thu, 04 Jun 2020 13:02:13 -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 S1730153AbgFDR21 (ORCPT + 99 others); Thu, 4 Jun 2020 13:28:27 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:30588 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730094AbgFDR21 (ORCPT ); Thu, 4 Jun 2020 13:28:27 -0400 X-IronPort-AV: E=Sophos;i="5.73,472,1583190000"; d="scan'208";a="453044118" 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; 04 Jun 2020 19:28:25 +0200 Date: Thu, 4 Jun 2020 19:28:25 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Denis Efremov cc: cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH] coccinelle: api: add kzfree script In-Reply-To: <65dee3e0-7df9-5b38-fe4c-5de3f70380a0@linux.com> Message-ID: References: <20200604140805.111613-1-efremov@linux.com> <65dee3e0-7df9-5b38-fe4c-5de3f70380a0@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 > After all it seems reasonable to me to add forall and memset_explicit rather > than handle all these false positives. Something like this for v2? > > @r depends on !patch && !(file in "lib/test_kasan.c") && !(file in "mm/slab_common.c") forall@ > expression *E; > position p; > @@ > > * \(memset\|memset_explicit\)(E, 0, ...); > ... when != E > * kfree(E)@p; > > Do I need to add "when strict" with forall or it's already enabled in this case? > Do I need to enable forall for pathing "-/+"? forall seems entirely reasonable. You don't need it in the -/+ case. I would put when strict in both cases. julia