From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] dev: Correctly get length of alias string in dev_set_alias(),Re: [PATCH net-next] dev: Correctly get length of alias string in dev_set_alias() Date: Wed, 20 Dec 2017 14:55:04 -0500 (EST) Message-ID: <20171220.145504.1817759866134770247.davem@davemloft.net> References: <1513633115-16940-1-git-send-email-serhe.popovych@gmail.com> <20171220.110529.947130105820119272.davem@davemloft.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: serhe.popovych@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:43244 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755534AbdLTTzG (ORCPT ); Wed, 20 Dec 2017 14:55:06 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Serhey Popovich Date: Wed, 20 Dec 2017 21:44:46 +0200 > Sorry but I do not mean larger. I mean shorter. When nla_len() > > strlen() we allocate extra space up to IFALIASZ - 1. But the user typically does not do that. > This is definitely fix nothing: we never get above the bounds, but > in case if NULL terminator is in the middle of string with nla_len() > we might allocate unused extra space. See above, not worth optimizing for.