Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2509698imm; Thu, 19 Jul 2018 23:13:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdio23SWHawozEuRK9Xrdcfli8jjzdYkJFWX74fZTdwkWqPQ76CL3k/2ATYNabmxuaHTQQw X-Received: by 2002:a62:df82:: with SMTP id d2-v6mr812495pfl.189.1532067181114; Thu, 19 Jul 2018 23:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532067181; cv=none; d=google.com; s=arc-20160816; b=By8Tlkhc98ksmyyhHSgi/T6TsejiG/Oh8yjiY4BVvZYWA9/oLdWT1KWRe8NX1Z3G0h PZjy4hkys7CFDUb6bS+gEgfmfjOXVcScixOlGfEh47n1MEaPPC94QwDsH+gaItkxJzPX hImraThRlP4C41/fODNbsp/CM5BhGCzqe2zqKmMWLsnPs7WYIFIhPHXi8oE3enQ8n5VQ L08+mtnbF4Css9zjIWLENsBeTzj2l7tpls4F31buC82RHC1YNaVGL3t/PB3KwfwXm/dP b75qvtO8USkyfn3xNihM7dtpM61b89rGZoHB0odbwGVHquZ7UC8p4s5nIzfQqe2cevMR Rmbg== 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 :arc-authentication-results; bh=3i+WGDJIkZRWxaUuDrDn9YGJVtRIcXDAB3KnxUpUCxo=; b=ctItkzwNcQGncVvOKeHr7uGOvpWGCn49mBdhGjjqQEzYxhjIYNAHZ/8suyQIrFBHp3 bgV3q68XfLFa2xr5T5sQ01yltav78JAp+GUVbdl6aSE++Y5JvC1SZ8EG2mKxcXLv5pUd PCBbCVAz+3pD5krh7AzqiBtpPo47QK5mizPqeGErMreIAjr8d8MUf0NI4LxgJkRt1tsq MuOtdBUVJhxfu27vfiOzpOaa9kRKC31zetlBMiXNx5KoD0tUhCR+gdOJnWk1dzVxDbYf F9W9wrv0wL6NbJSd3TSBHLVcR/t3/l8VfEETbBN2vpgnaiuJwnguGSidxIp98i6nns3p LVyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si1121953pge.114.2018.07.19.23.12.45; Thu, 19 Jul 2018 23:13:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727529AbeGTG6r (ORCPT + 99 others); Fri, 20 Jul 2018 02:58:47 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:29553 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727364AbeGTG6q (ORCPT ); Fri, 20 Jul 2018 02:58:46 -0400 X-IronPort-AV: E=Sophos;i="5.51,377,1526335200"; d="scan'208";a="273562945" Received: from abo-214-111-68.mrs.modulonet.fr (HELO [192.168.0.15]) ([85.68.111.214]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2018 08:03:35 +0200 Date: Fri, 20 Jul 2018 08:03:35 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Dominique Martinet cc: Masahiro Yamada , =?ISO-8859-15?Q?Ville_Syrj=E4l=E4?= , Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] coccinelle: suggest replacing strncpy+truncation by strscpy In-Reply-To: <20180720055705.GA2810@nautica> Message-ID: References: <1531555951-9627-1-git-send-email-asmadeus@codewreck.org> <1532047018-23754-1-git-send-email-asmadeus@codewreck.org> <20180720054050.GA32233@nautica> <20180720055705.GA2810@nautica> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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 Fri, 20 Jul 2018, Dominique Martinet wrote: > Julia Lawall wrote on Fri, Jul 20, 2018: > > On Fri, 20 Jul 2018, Dominique Martinet wrote: > > > I guess there is no value in the script landing first by itself, I'll > > > just remove the script path from the commit messages and resend the > > > first few this weekend. > > > > It's not that there is no value to the script. The problem is that I > > don't know if the script is correct - I'm not familiar with these string > > functions. Once the script is in the kernel, it stays there beyond your > > patches, so I would prefer to know that it is correct up front, rather > > than having to remove it afterwards. > > I understand, I didn't say there is no value in the script ("landing > first by itself" doesn't mean it should/can not be taken later) > > I'll bump this thread again in a couple of weeks after having resent > most of the other patches Thanks. The rule is also not so efficient in the patch case, because you have the rule r that matches the pattern, and then the ok rule at the end that matches the same pattern. It would be better to put depends on org || report in the rule r, and let the patch rule be freestanding, ie just declare dest, src, and sz, not r.dest, etc. If you like, you can also add the context case by just putting a * in front of the strncpy call in the r rule. That highlights the change in diff-like output, which can in general be useful to see the context in which the issue occurs. julia