Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp899296imu; Tue, 11 Dec 2018 09:15:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/VvhPSUiC7c8FpC94ige3sZY+raJc1tJqQJpfn84xCgwqcU0eUy5nLr7mH5p7AJpXv+OFyF X-Received: by 2002:a17:902:9a41:: with SMTP id x1mr16627805plv.126.1544548524198; Tue, 11 Dec 2018 09:15:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548524; cv=none; d=google.com; s=arc-20160816; b=BTqsX1Y/J5m1N4bTqyE9Ce36GYcckVcnJJxdLJYfxHK1OejND+HCT0ffK4AXjl2l0i JdbXeN7fk4x0mHsPGdrVGaE9VUkykJ+pfpPm/QlyMtiBDcHP+g3s10uKz0jjZ8Nq8jSJ VVmQu1qFpH0YGlAvWfEXOE+jXh1Jubcfl41ZkP/bVpiLakUYeCGvxeRi57f66M05nUBX 07L+NQqF0gDk5GraCGlAZVELuqCS9rRU3hmtxixKF9Ki70lvIuptvuYXNzUN/iZjTHor O+qNt4dn8ksK3v+vZrOyhfmhCTalP9oRIhoouCgab+m/Uz0YKB7kLMU7dsrQRO4hsvs9 nayQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h0XOaDlBqmdNN43cbIOiR9UPoXYD0hW/rAaJPCQRLgQ=; b=NMhZHMCvre/rLAV/CiglCjVBikU2gOmy27Ws623L1MZsuCv7DYiKNemS8fhFteboBn U1iy3x5LldOUMjOieUnHquf1crsv0P4FXCA7bxlrnt/xzRxcNZvXA7Ol9TU7zmTqwpko JUdtTaH0dJ+Tl6pwrNjUnrvq32u+YAOx4SWXizMQv5qpdJ34uWN2ry8/RqugaTkvnvX3 6Zb+ukxOs775eR/z7dsOMudc3HpKKWokbqmoWtjcXQrel7V91+Kt1Ej69EQeeYtywqHb M55MPg/M7rO1JaaugddnhDWbAEwV9gt6W329g2eZIRDL9AjV5bpeP+NHdrKO/oUX6J5D reUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=au6YKcRE; 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 e17si12242298pgj.142.2018.12.11.09.15.09; Tue, 11 Dec 2018 09:15:24 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=au6YKcRE; 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 S1727366AbeLKPmy (ORCPT + 99 others); Tue, 11 Dec 2018 10:42:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:59280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbeLKPmw (ORCPT ); Tue, 11 Dec 2018 10:42:52 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1826E20855; Tue, 11 Dec 2018 15:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544542971; bh=s8RZ+tBxpqEJoDpXJ3685k50fBfjDhFaEVSFFBvMKp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=au6YKcRE2yv5wBRaH+bi7pThupd1u+KYKm0LWif/ht7qMysbMxlXn+lYc4Ji0RAPa 159GALkxUXSbavz66Tay/4IVHkQm88OahyZxuFFLejNoGbzOokofhEGu6R0xwEjaAn QZfuf9RxdH9+EeMejL5ZuLo74+AVndWQRCaTMS8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sultan Alsawaf , "David S. Miller" Subject: [PATCH 3.18 18/54] ip_tunnel: Fix name string concatenate in __ip_tunnel_create() Date: Tue, 11 Dec 2018 16:41:06 +0100 Message-Id: <20181211151547.004615385@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151546.010073210@linuxfoundation.org> References: <20181211151546.010073210@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sultan Alsawaf commit 000ade8016400d93b4d7c89970d96b8c14773d45 upstream. By passing a limit of 2 bytes to strncat, strncat is limited to writing fewer bytes than what it's supposed to append to the name here. Since the bounds are checked on the line above this, just remove the string bounds checks entirely since they're unneeded. Signed-off-by: Sultan Alsawaf Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_tunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -310,8 +310,8 @@ static struct net_device *__ip_tunnel_cr } else { if (strlen(ops->kind) > (IFNAMSIZ - 3)) goto failed; - strlcpy(name, ops->kind, IFNAMSIZ); - strncat(name, "%d", 2); + strcpy(name, ops->kind); + strcat(name, "%d"); } ASSERT_RTNL();