Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp517904imm; Sat, 14 Jul 2018 06:09:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfDkSPC3X7M09CaQs33RGP796t9V+XowlfSqXfyDgRF8gm7ULRyVLmQx7cH7bsu4t8W2AJq X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr10070128plk.35.1531573746945; Sat, 14 Jul 2018 06:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531573746; cv=none; d=google.com; s=arc-20160816; b=RhP5DcutzlYraHWyBMe4MIyjUR1iF0t4NTBFv3DtPxoyjSJkPOCxdR5JHnJ4F9pkq/ MbVv6W1cudIOL51qixCOC1ogHZnvYa3wqP9p3YKzztF/fataMd0iTXFd/CVkUV8RwuhX cffRlQxKHaSoDafm82Lx1VDDt6f1jxEKSlDrSVf/ehlT4uRX+qDTClICaUCEslJXiEaY xEWQC1MuED+B8WACkxfRU+DJKXGwkqgWTyM9Lc+N/GXPiTVTUNrUdPHE6n/G2tiOz6pR Pavv1Exh472//NTnoU0UhFc0R4rh82YcZAFmz+YYg7YJ1fKT29BzG0iDL71rWvbbZG76 x3tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=I9EZpOK4BH++0sja3ZB4szbqIg7mblLZ9jtVzja1R6A=; b=w37DA0MboWlQNAeEUv8L1+vLlguvVd0C8iyg21OmRqDXf6rEXzX0wBJ8/tNdusw+/Q vSat9i1lxVESRG6YMhMOvZdQjiMgLVTpp0wOb3qaXxkVOz/FlUqLt74/j6kNRVg0Wo9m ngSqacE+WUhM7cOY2ruan4HawH+QXFipt5rVUGunkr6dEQwfr/WbYnNtOZpwRgF2JjT0 xvkYK/xNGE9HLnWhxZMN3rm4//BmtLfKjwHXhcr77daACwPEEQhqoigQPjTeV3/iA6hb 776Uwcnim986T6iLw3rWj4bxhJybJIuKH/erZW/hzslc+T4FOR7Wu9wEZ37Mj4Y22Hqx UOCw== 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 x3-v6si25881247plb.478.2018.07.14.06.08.51; Sat, 14 Jul 2018 06:09:06 -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 S1727349AbeGNN1U (ORCPT + 99 others); Sat, 14 Jul 2018 09:27:20 -0400 Received: from nautica.notk.org ([91.121.71.147]:42516 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbeGNN1T (ORCPT ); Sat, 14 Jul 2018 09:27:19 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id E2698C009; Sat, 14 Jul 2018 15:08:15 +0200 (CEST) Date: Sat, 14 Jul 2018 15:08:00 +0200 From: Dominique Martinet To: Julia Lawall Cc: Masahiro Yamada , Ville =?utf-8?B?U3lyasOkbMOk?= , 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 Message-ID: <20180714130800.GA15334@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) 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. > > +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. > 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. 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? 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