From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] qed: Fix copying 2 strings Date: Tue, 24 Apr 2018 14:00:07 -0400 (EDT) Message-ID: <20180424.140007.4712978535021934.davem@davemloft.net> References: <20180424123253.2333-1-denis.bolotin@cavium.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, ariel.elior@cavium.com To: denis.bolotin@cavium.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:38088 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbeDXSAJ (ORCPT ); Tue, 24 Apr 2018 14:00:09 -0400 In-Reply-To: <20180424123253.2333-1-denis.bolotin@cavium.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Denis Bolotin Date: Tue, 24 Apr 2018 15:32:53 +0300 > The strscpy() was a recent fix (net: qed: use correct strncpy() size) to > prevent passing the length of the source buffer to strncpy() and guarantee > null termination. > It misses the goal of overwriting only the first 3 characters in > "???_BIG_RAM" and "???_RAM" while keeping the rest of the string. > Use strncpy() with the length of 3, without null termination. > > Signed-off-by: Denis Bolotin > Signed-off-by: Ariel Elior Applied, thank you.