Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2713644ybt; Mon, 22 Jun 2020 05:21:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwwaqK+QeUG4DF3zCeDoSBpUTVhS4LM8AC5gXyvES3Qbgfk4TdMx0YMloqV26clSjJGiHM X-Received: by 2002:aa7:cb52:: with SMTP id w18mr16894500edt.1.1592828480241; Mon, 22 Jun 2020 05:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592828480; cv=none; d=google.com; s=arc-20160816; b=zyo/A2GDi/XOdubw3a7mFHqbkldGCqMw/0WcBgPR4BmM0cx7VLOyEHBbNaogtPKg61 xvDJK8u4g0o5Cj9GXOOQu1z0FgFanIuJJ9L8bwI/1YMLrnHQDpriq81Il3Q0bH/vWTPY 2uFfL7Fp21MEP7cGXQJXQ7ptookUH/QYr9jtKFWCn7tdyYMkbu0bxum2717wMw39jNNi D2pXKg3v/ymftQ26XRMYaDbx+XB2y7Fn/M4YRwl7JYLburVq6z8T7qRP64SzmekDG+o3 3ikXHSuZaU2kiKl0UgHvZJIH47MMrWnteRClOnrHySBHWaJFKtb6FoPDi4QU89V4TPsO Wzuw== 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=EcwBfPaCLHsjWL1Mxni898zBcF2mc04tvPMed4WwHZY=; b=olqdx5wFoWy3Iljp8YGqcpdDctrMR/ayfQxmdjosfwevnD2f85R2v8SgcLuHBBsCe4 xI6C5C9Pw2HWKJg5ypc88EPqKfWgOq1hh70Eh9j8l2mRJj3zQ1iXQfICyCZMd+tQ4Was eS3S3Foex+AqR/XfOMEIZVgEgDxtn8jZMHsEP/gqnTNzRZBQNM5HH1xwnKI+yCwRS2ug R3hjGWFibf9iSsJaMnxo87fvJidFT4pOyAO9sGlvtB4XCkgD101bM74Z0WoaR5c7NhsA 8nR2Wxomy9SAKhqLIP+CtOUSpbesH4bKhF2CQiyRz769jLSd/+PnSOTqEbRzgYurhEuq 2UHQ== 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 du12si12441745ejc.441.2020.06.22.05.20.56; Mon, 22 Jun 2020 05:21: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 S1728098AbgFVMTI (ORCPT + 99 others); Mon, 22 Jun 2020 08:19:08 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:47296 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727852AbgFVMTI (ORCPT ); Mon, 22 Jun 2020 08:19:08 -0400 X-IronPort-AV: E=Sophos;i="5.75,266,1589234400"; d="scan'208";a="352352552" 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 Jun 2020 14:19:06 +0200 Date: Mon, 22 Jun 2020 14:19:06 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Denis Efremov cc: Kees Cook , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [Cocci] [PATCH v3] coccinelle: misc: add array_size_dup script to detect missed overflow checks In-Reply-To: Message-ID: References: <20200615102045.4558-1-efremov@linux.com> <20200619131313.15468-1-efremov@linux.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) 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 Mon, 22 Jun 2020, Denis Efremov wrote: > What do you think about removing duplicates warning from the rule? > > I mean this kind of warnings: "WARNING: same array_size (line {p1[0].line})" > > As for now, I think it's better to not disturb developers with this kind > of things. I agree. I guess there is a small overhead for the test, but if the code is not performance critical, being simpler is probably better. julia > > Thanks, > Denis > > >> +@as_dup@ > >> +expression subE1 <= as.E1; > >> +expression subE2 <= as.E2; > >> +expression as.E1, as.E2, E3; > >> +assignment operator aop; > >> +position p1, p2; > >> +@@ > >> + > >> +* array_size(E1, E2)@p1 > >> + ... when != \(E1\|E2\|subE1\|subE2\) aop E3 > >> + when != &\(E1\|E2\|subE1\|subE2\) > >> +* array_size(E1, E2)@p2 > >> + > >> +@script:python depends on report@ > >> +p1 << as_dup.p1; > >> +p2 << as_dup.p2; > >> +@@ > >> + > >> +coccilib.report.print_report(p2[0], > >> +f"WARNING: same array_size (line {p1[0].line})") > >> + > >> +@script:python depends on org@ > >> +p1 << as_dup.p1; > >> +p2 << as_dup.p2; > >> +@@ > >> + > >> +coccilib.org.print_todo(p2[0], > >> +f"WARNING: same array_size (line {p1[0].line})") > >> + > >