Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp566752ybt; Fri, 26 Jun 2020 06:24:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy11rBljCvChH++o6rnNry1I8gwhahDQFHUCCs0ASnZm2jKTWMq3dN6zqUxfAeNtk7FxI/q X-Received: by 2002:a17:906:9244:: with SMTP id c4mr2510974ejx.60.1593177857165; Fri, 26 Jun 2020 06:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593177857; cv=none; d=google.com; s=arc-20160816; b=p4Ef0bJCJtOj7+6FXXrxbbzR6FhZQWyCNyUwgph8P4PIojTRARey3R8+cGPsP9JQol pxcTl1thAKVJOk4Xg980e0gJOH6EEfwTxEU+rEnVMVL0oPJXVzsau06g5bEjQGMGmW87 QSKs1InR63s1zIfOPwg0V9shP7tJy+oAnx9NRHO9nMIgoeGwWXbR24b9OWsaanoujL4f fgr9oZn3IkYGyNaNjKh3GQ/XeAMp92Z/zYH6giXnkc6rjmBf39c+G/m/jyRlQyeh1U02 YRDnkQz/w5cMfqsurxKPABkic7KyLltaLsjj9x29jBxriWKzCFZHs5hMbcOyVqfmjR1k I5IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=tjoxSQWjytk5PnjXa46BXRfkKzFN75tkC7pTAZu4Kk0=; b=vdqw5Qgk8Cu1xlh+oSBkiNxix6pyE2wu161CWvi3SuUVwYzaKBoib30lAtzGeT//83 a2Dym++pr0zjIFsb11lNO6sSCjS/JozJhBjsmX1CFdXsm+PSxPLRGmxhkgv4ZUSWhstu P4INAqJ3ptWXmuRLtTEpWasG2FBykMHRSv9zaCsE1L9CuAwE9oZG56eMzqaUuehZ2U2l GVDqLLeFuixibYwPcTserfFHKXatoY096ySYFyvzhX+B15bsuTwkUtr//wb4mrMPWdY2 zgzaqSUdgxmGhfDxjAzVc8hYIf9PzGPy3PXywagx7VKV4p5RBaOFgPSQ6fvMEaaqfx57 98cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aruba.it header.s=a1 header.b=K7j7VQvW; 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 pj20si16073091ejb.158.2020.06.26.06.23.54; Fri, 26 Jun 2020 06:24:17 -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; dkim=pass header.i=@aruba.it header.s=a1 header.b=K7j7VQvW; 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 S1727914AbgFZNXF (ORCPT + 99 others); Fri, 26 Jun 2020 09:23:05 -0400 Received: from smtpcmd02101.aruba.it ([62.149.158.101]:45381 "EHLO smtpcmd02101.aruba.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgFZNXE (ORCPT ); Fri, 26 Jun 2020 09:23:04 -0400 X-Greylist: delayed 430 seconds by postgrey-1.27 at vger.kernel.org; Fri, 26 Jun 2020 09:23:03 EDT Received: from [192.168.1.129] ([93.146.66.165]) by smtpcmd02.ad.aruba.it with bizsmtp id vpFk2200D3Zw7e501pFldb; Fri, 26 Jun 2020 15:15:51 +0200 Subject: Re: [PATCH 01/10] misc: c2port: core: Ensure source size does not equal destination size in strncpy() To: Lee Jones , arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rodolfo Giometti , "Eurotech S.p.A" References: <20200626130525.389469-1-lee.jones@linaro.org> <20200626130525.389469-2-lee.jones@linaro.org> From: Rodolfo Giometti Message-ID: <7d8996e9-74d3-ca47-cae8-a457c9a4baab@enneenne.com> Date: Fri, 26 Jun 2020 15:15:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200626130525.389469-2-lee.jones@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1593177351; bh=tjoxSQWjytk5PnjXa46BXRfkKzFN75tkC7pTAZu4Kk0=; h=Subject:To:From:Date:MIME-Version:Content-Type; b=K7j7VQvWWR4cwXC2jbkjy/WF6kq1IwGqR4gre2cjOj66WtuBXYtjkMLNBTkrG88+N TYDHKVZsKlNlx17RZtR1kZzJUd2F89URbl2Pm7rS3f9zAR995MDVKD2kdpYVf0pAk0 JAsSZoY8piIbjdbvf3mXUoMHetCdoPdDAa+HLJBnFkUzL3B1SzK23rx64IW+y+2gxa iF3NyxkP7WSzHtIfE7XoUtwLsNHzhilNwJrz6xHMXxiaMc5hh2saSWdVWAZCNLIS5G JqCZIwr/WHsz7gUQz/PsIw4g1QK5d0XwFPjYzzLq77Y9fCmc0Fdlj4gDD2VT4Jtjdf Ku1We2atPoaog== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/06/2020 15:05, Lee Jones wrote: > We need to ensure there's a place for the NULL terminator. > > Fixes the following W=1 warning(s): > > In file included from include/linux/bitmap.h:9, > from include/linux/nodemask.h:95, > from include/linux/mmzone.h:17, > from include/linux/gfp.h:6, > from include/linux/umh.h:4, > from include/linux/kmod.h:9, > from include/linux/module.h:16, > from drivers/misc/c2port/core.c:9: > In function ‘strncpy’, > inlined from ‘c2port_device_register’ at drivers/misc/c2port/core.c:926:2: > include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] > 297 | #define __underlying_strncpy __builtin_strncpy > | ^ > include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’ > 307 | return __underlying_strncpy(p, q, size); > | ^~~~~~~~~~~~~~~~~~~~ > > Cc: Rodolfo Giometti > Cc: "Eurotech S.p.A" > Signed-off-by: Lee Jones > --- > drivers/misc/c2port/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c > index 33bba18022892..80d87e8a0bea9 100644 > --- a/drivers/misc/c2port/core.c > +++ b/drivers/misc/c2port/core.c > @@ -923,7 +923,7 @@ struct c2port_device *c2port_device_register(char *name, > } > dev_set_drvdata(c2dev->dev, c2dev); > > - strncpy(c2dev->name, name, C2PORT_NAME_LEN); > + strncpy(c2dev->name, name, C2PORT_NAME_LEN - 1); > c2dev->ops = ops; > mutex_init(&c2dev->mutex); > Acked-by: Rodolfo Giometti Note that giometti@linux.it is just an alias. My main e-mail address is giometti@enneenne.com Rodolfo Giometti -- GNU/Linux Solutions e-mail: giometti@enneenne.com Linux Device Driver giometti@linux.it Embedded Systems phone: +39 349 2432127 UNIX programming skype: rodolfo.giometti