Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp801421imu; Tue, 11 Dec 2018 07:48:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/VAzYifL1pqIVWDQXtm5N8YFc233emcxMF8GxenG4Vf1dBZV060bfmnfHh9+kvE2ikxUw0R X-Received: by 2002:a17:902:2904:: with SMTP id g4mr16417891plb.39.1544543323469; Tue, 11 Dec 2018 07:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543323; cv=none; d=google.com; s=arc-20160816; b=j59ej14WXHLOsqWB4zT62UxnV/pDdUFNd2yzr7N2Vyw/Gq5gfiUYa/7rDjRF6ZUnRs eXT+6H5VNdNhsvq9B7nmJbo1Pe+6t4H6Vp6zdsjB/RoQER2Eo3OhR9056PpTsH9hOAxP 5G7+puZGGdZ1ZG+nhmuyrgX6rS8eJOFKNPdd3HjFTXLx7Bg8m0nH1RjSGtJUB75eRas0 oEMvGOdE12MxxBsNbj3JwP6C/jJ4gkbL7B7Z7tA6as8nZ90YY7HAlgIdzmQ7PV7zg0Dl KV2CMFhJ0B8qdaWQAV0VgB5xCkCyyDki+rzGaeD2yObNldHKfqJQsgksAOGtaqOrs2+q Wngg== 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=eUVquUhltqXS2Xh7OwVwmQoEm9NMpACNfoYH3n0WkII=; b=vRVih+6uagUb8laDLuoWoU2GIqpjhdFpp3LJ2Gl7PIJt/tmgPgUCRGkiVGqHyUKg0R LI4/CW3cpkYMw/Ca2ovkDFlx/E0VeOLMEAA3PYcmquZbEVUTHrbEKsDbjs+yAR24zITI xk3D4mejBo1b9S53RmNU6OZaBQ2sc+e+IiokMgmR1aDy1psW6YViKS+mOlRJjtB8aKaO m8iKFl09hkhkVLZao5cH0JL2cHbtPR97VHKIkENaNy+J17fKkBefMspAcXUb/Y7AEkA1 JMZQf1CmmBfVL+CTYaQkhEvUlBL+DUF7Y/mc0RFp5cnoI8MaH9E8tUnBTVujT9MTCRqE E1mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WaxtJi1V; 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 h5si13582202pfg.233.2018.12.11.07.48.28; Tue, 11 Dec 2018 07:48:43 -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=WaxtJi1V; 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 S1728153AbeLKPpi (ORCPT + 99 others); Tue, 11 Dec 2018 10:45:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:34042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728141AbeLKPpi (ORCPT ); Tue, 11 Dec 2018 10:45:38 -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 27DF720989; Tue, 11 Dec 2018 15:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543137; bh=X49m9QNSEAEbJcdS4ld6MNewctKNPv/cFe2RSr7NKok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WaxtJi1V9TEvsePa+XHseZzqnOdFakLMSO8MfwHHz4K+vQIuRr9Tosx+uIO/A+yvn nl4+noN9F50mCaZWyZw/4VoCJDc0EV+MLk758vlEEzgKW+FZwcjCT2YvwedQFh7eke AROepdAa8r+J6BAKFfQkLaNHnHjeXcJE/kDKW0mM= 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 4.4 27/91] ip_tunnel: Fix name string concatenate in __ip_tunnel_create() Date: Tue, 11 Dec 2018 16:40:46 +0100 Message-Id: <20181211151608.023682244@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@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 4.4-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 @@ -261,8 +261,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();