Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7173604imm; Tue, 24 Jul 2018 09:33:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdReOIGfMMVWITkmUPOee4h02LkofricmNIYXVqYCQEqRjEQmnxCiskAJnGIfrLTeJJ1vRu X-Received: by 2002:a63:704f:: with SMTP id a15-v6mr16979641pgn.443.1532450002354; Tue, 24 Jul 2018 09:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532450002; cv=none; d=google.com; s=arc-20160816; b=savQykqJoJIEdOGf43wV9qRZGgkKyQuxqENPtTdTmleNtvhJBv6uKteFau3byLES+0 +A3MLC6eZhuQMjlLISHfRFFE1Fh837sMRsUCsMi/ORWaI8vhwBboYxXJs4cIxqKa+Uai MXNN67ihmAQ80+cXNDO8uwYauD6Fbvc5WaxyZF6ljRVOJ/CNgq/U9obpEKuZHxJseMyT HKwVmSUmjUNUccnNIUdhzEQqdoWooFDPsB4y1r+6E8UH0ZvQM8sCAbk572MN1HY4BpOE kFtEcc6gMBuSJBVZv6PH/D8YE+FCbVh/JF3NqR/ljVBQdeE7v61uKk/D/FZz0IJ3HjoD 8+Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=DrEYNyypY+IxK7HORCF2R4zGxymWBYWL0/pSFzpVUSA=; b=qVhPTiuFH4EzMS/3UOpCZ6N4heC0XFvBYy3gzDamq9Umne8P583x6GbaNFYJpdnjxa Lv0DMLDvzVHbtrba7twj9EHhy8aIVLlTLd4SzyEPE2xf4UYq+xZwTclnb+ocYDSUtDUQ lWjO867+tb+h4a0i3GT4NxIjrzCN+DolRpcFNfC/8YCmDr7QGcLFshyCxTVenystTTeI 9LbGT0ToPdWIk4GmncalXmI/zVny5T0JH2rLtxyVJsakUXglrNK4z7GNe/P9PFHVPpth 9ohFCbIn0cgMWEC8IhE720Cgl3W9+WBUYQ1GFBc00USFP+KxRFGO0oKv++4rQPhCVqrm umPA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 79-v6si11811968pfs.40.2018.07.24.09.33.07; Tue, 24 Jul 2018 09:33:22 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388443AbeGXRiq (ORCPT + 99 others); Tue, 24 Jul 2018 13:38:46 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:45563 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388409AbeGXRiq (ORCPT ); Tue, 24 Jul 2018 13:38:46 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id CB075217DD; Tue, 24 Jul 2018 16:31:29 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pRdQxoJtIQX9; Tue, 24 Jul 2018 16:31:29 +0000 (UTC) Received: from [192.168.1.87] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id EA214216AA; Tue, 24 Jul 2018 16:31:21 +0000 (UTC) Subject: Re: [PATCH 18/18] cpupower: change strncpy+truncation to strlcpy To: Dominique Martinet Cc: Thomas Renninger , Colin Ian King , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> <1531445169-19912-1-git-send-email-asmadeus@codewreck.org> From: Shuah Khan Message-ID: <2d421d32-ab85-1d4e-0aaf-7f221e0110b0@kernel.org> Date: Tue, 24 Jul 2018 10:31:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1531445169-19912-1-git-send-email-asmadeus@codewreck.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/12/2018 07:26 PM, Dominique Martinet wrote: > Generated by scripts/coccinelle/misc/strncpy_truncation.cocci > > Signed-off-by: Dominique Martinet > --- > > Please see https://marc.info/?l=linux-kernel&m=153144450722324&w=2 (the > first patch of the serie) for the motivation behind this patch > > tools/power/cpupower/bench/parse.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/power/cpupower/bench/parse.c b/tools/power/cpupower/bench/parse.c > index 9ba8a44ad2a7..1566b89989b2 100644 > --- a/tools/power/cpupower/bench/parse.c > +++ b/tools/power/cpupower/bench/parse.c > @@ -221,9 +221,8 @@ int prepare_config(const char *path, struct config *config) > sscanf(val, "%u", &config->cpu); > > else if (strcmp("governor", opt) == 0) { > - strncpy(config->governor, val, > + strlcpy(config->governor, val, > sizeof(config->governor)); > - config->governor[sizeof(config->governor) - 1] = '\0'; > } > > else if (strcmp("priority", opt) == 0) { > Thanks for the patch. I will pull this in for 4.19-rc1 -- Shuah