Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp824720imm; Sat, 14 Jul 2018 13:37:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfYH5YgBSqU1D1BNe8sgt/ajdW48Tu/a2nQd6HZe2L0Z0wGbY3jDZxeZWaOB1/BYTPZGqi2 X-Received: by 2002:a17:902:6b09:: with SMTP id o9-v6mr11044250plk.256.1531600656316; Sat, 14 Jul 2018 13:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531600656; cv=none; d=google.com; s=arc-20160816; b=FX7plI732RCtCPFLPh6CwtX+jjIjtBXjK5xc9ImmqfzCISxMfRIFZyqe9omdP5XclQ 7O5SCNXdteS3nxGulxByKkW6phFBSiM6OTtzjpARa/6w0HjqLsmkSEsYS57Y8j9mibus fYookFg8hDX0sC7PdIpymewA00ZH+cOs7bys7HlSM1lCZybGRANpnKaW345kJ7/50/b9 jO74KF0UIMJntmxB0LJstWbblP+c7SQq5TxLZGhyyl9lEzEPqHlyjeiQgkWdqUInl5yi 9c4ezEwPTHQQu7nPpYSVtrM2yS0tYq10/DhonUcvqRFZy1ZliSp8lc0UYj0qcNAhguy9 sZSQ== 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=4ugtkO7LHHeyzmJcZ2EF8qw3V0qqOw+0w1cjxA/oYZE=; b=k6u9ubxtagsWNI4JPy9hwIQlbhDf4h3SU/Gk/aMX/GM6b+ZEstp5nbaYyjjQyC7Epo YGp/N9vA6pyJoP+uHwiv/SO2/1LfMMBPl8GhLt2FD02YJtcPJtv3GNbc/hsSDq4JgIT1 /dWyftQJbPBEUlG7hj6nwO0zKSoHDJ7sovzWBqMvDnzRnCjOJbfiCQp2mtHMHRRKepSw 4qkO+6UqUojVI1B4l2lxT1D4El43lgIC91LLyzYp8Az0UVPMa/iKU38v0gGHK+BHah5G 36dYBKEsToOms5jMEj9lgmdkWk1JdxNTe0iDCBtr7xsOmHjI3rOp+OYAZ6uXL1omOojA Gygw== 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 23-v6si26803415pgx.323.2018.07.14.13.37.07; Sat, 14 Jul 2018 13:37:36 -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 S1731236AbeGNU4a (ORCPT + 99 others); Sat, 14 Jul 2018 16:56:30 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:45981 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbeGNU4a (ORCPT ); Sat, 14 Jul 2018 16:56:30 -0400 X-IronPort-AV: E=Sophos;i="5.51,353,1526335200"; d="scan'208";a="273004277" Received: from 76.8.75.174.nyc.electricfiber.net (HELO hadrien.local) ([76.8.75.174]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jul 2018 22:36:11 +0200 Date: Sat, 14 Jul 2018 16:36:09 -0400 (EDT) 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, fengguang.wu@intel.com Subject: Re: [PATCH v2] coccinelle: strncpy+truncation by strscpy In-Reply-To: <20180714130800.GA15334@nautica> Message-ID: References: <20180714130800.GA15334@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 Sat, 14 Jul 2018, Dominique Martinet wrote: > Julia Lawall wrote on Sat, Jul 14, 2018: > > Not a big deal, but actually the v2 goes below the --- > > I've seen both being done (if you look at the git log of the linux > kernel and search for 'v2' you will have some matches) I guess. Normally I would conseider that since the v1 is not in the git history, no one care about the delta between the v1 and v2. If there is important information it should just be in the commit message. > The list was a bit long in this case, but I think it's worth at least > mentioning that the previous version used strlcpy and why I changed in > the commit message. I guess, but you could say that strlcpy was not used for a certain reason, without making it historical information. > > > > +msg = "SUGGESTION: strncpy followed by truncation can be strscpy, if the destination buffer does not need to be fully overwritten" > > > +coccilib.report.print_report(p[0], msg) > > > > This is the first SUGGESTION. I don't know if anyone out there is relying > > on it always being WARNING or ERROR. > > Eh, I must have been really unlucky with the scripts I looked at, one > just happened to have SUGGESTION used like this (misc/warn.cocci), but > now you said that I can see it's the only one! > > I'm not sure on what to do here, if you think there could be scripts > relying on that then I'll change this to WARNING, but the wording feels > a bit strong and "suggestion" leaves more room for interpretation. I guess that if there is already one, then another won't hurt. > > > > Copyright stuff in the other sub-thread > > Replying here instead to limit the number of mails sent, > I think people would look at git blame/log if there is no name in the > file, but I can understand it is simpler if a name is present. One less command to type. > > Just a nitpick on format, all copyright comments on cocci scripts end > with the license; since that will be added as an SPDX tag instead do you > mind if I do not list it again there? I know nothing about SPDX tags. If something is added, I don't know how it is done. julia > > > Also just a head's up, I'll be AFK for the next ~48 hours; I'll post a > v3 of the patch with license/copyright added, possibly suggestion > changed, and whatever else comes up by then :) > > Thanks, > -- > Dominique Martinet >