Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp752276ybl; Wed, 4 Dec 2019 10:15:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzlp0UUpemmlzPLoRl5clipPWpcqOFvguMZ6JHGRUKkGjmW8Tq6aViTaDGwIe2cnvtPK+oc X-Received: by 2002:a54:4807:: with SMTP id j7mr3841024oij.179.1575483349022; Wed, 04 Dec 2019 10:15:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483349; cv=none; d=google.com; s=arc-20160816; b=JMsSSIteJegFwsaviK0pQIL1H4A5lvbxxXnEVSpXO2aEYhW8gDxz/TFOxFVpYYnS01 aRf620SjiTm7bwjgFY1OItCVAtSn5THGFiuZM9EH+a6Cz9WO35OEl72aNHjqZxiBlHYh k+q0l6zo0n7MM08xmoQzw2kEcDBOHw4hFxWXcYkdB34ImmbGZB1XUnaKYm92VPiMUKAq igqRfcgQY+JN6PwaXS5TpEIkfYbRzFZ5sm4/TEsza8goramV8JavhSOC+2drkk3rLX66 RgBldN2spxl5zoVMhY7zGv9OsxecSMtb03px+uVVbTlTEQlf9VGfFuBX+JaYlUqOpVG4 0kAA== 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=6h84bN5UynB9u5ZgnS5wHHEEN9sb0EhsJrModjc+L5o=; b=IxWvcswndQ/OiGMW2857+GzjSwWogMRyCCgHLynv3oJ2+X+M4ebgXaPzbGYuJ2V5Al 4xrTSRLh6gKGuAuTeFs681DnPEDSI19NI0xzfaRQ3wFFlpjkFeeH+njFwG1Y1P9Px9Au mKRiiYDzwwq1IMHURK6ZZCPpxZ/+lyUxexEFE8DLK1huDnOnJkQD+5ojM769eKwsrRDm I9uNcalIvbN6qKBWJ8EpxZCVodLPQjAG6H/eKZP+tFWMskfouP7N1nklNdYU7m8qoRuP PGRFA+yxopzSdl58pb8L7uPOWLf1S9sLHFjfYmY05tIU+TVc6WPb6Twb5oR38VV+A4p7 eMeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bNIqle7/"; 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 e74si3490670ote.14.2019.12.04.10.15.36; Wed, 04 Dec 2019 10:15:48 -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="bNIqle7/"; 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 S1731508AbfLDSO2 (ORCPT + 99 others); Wed, 4 Dec 2019 13:14:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:43788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731625AbfLDSO0 (ORCPT ); Wed, 4 Dec 2019 13:14:26 -0500 Received: from localhost (unknown [217.68.49.72]) (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 35B3820674; Wed, 4 Dec 2019 18:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575483265; bh=HyRnJ4hHIIT88R4IE4XWdBuwVdb6Ox6saxvkkrM4gqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bNIqle7/IRGIMiB1FvOb7SUSbEKv7y9W1WwFI61ZJvZBnJq64OFlKPdznytmfQqHF z3KrFXAGQFGXPZDChw4R4vCg0stIb+UI3heyYdUrSUETJM1gwz5xeaet0+69x5vVNp A4j2BWZrICDoTrPMQB26B0UKuHbKFy35YcC6Wu2E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Rutherford , Jon Maloy , "David S. Miller" Subject: [PATCH 4.9 119/125] tipc: fix link name length check Date: Wed, 4 Dec 2019 18:57:04 +0100 Message-Id: <20191204175326.498816873@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175308.377746305@linuxfoundation.org> References: <20191204175308.377746305@linuxfoundation.org> User-Agent: quilt/0.66 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 From: John Rutherford [ Upstream commit fd567ac20cb0377ff466d3337e6e9ac5d0cb15e4 ] In commit 4f07b80c9733 ("tipc: check msg->req data len in tipc_nl_compat_bearer_disable") the same patch code was copied into routines: tipc_nl_compat_bearer_disable(), tipc_nl_compat_link_stat_dump() and tipc_nl_compat_link_reset_stats(). The two link routine occurrences should have been modified to check the maximum link name length and not bearer name length. Fixes: 4f07b80c9733 ("tipc: check msg->reg data len in tipc_nl_compat_bearer_disable") Signed-off-by: John Rutherford Acked-by: Jon Maloy Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tipc/netlink_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -539,7 +539,7 @@ static int tipc_nl_compat_link_stat_dump if (len <= 0) return -EINVAL; - len = min_t(int, len, TIPC_MAX_BEARER_NAME); + len = min_t(int, len, TIPC_MAX_LINK_NAME); if (!string_is_valid(name, len)) return -EINVAL; @@ -821,7 +821,7 @@ static int tipc_nl_compat_link_reset_sta if (len <= 0) return -EINVAL; - len = min_t(int, len, TIPC_MAX_BEARER_NAME); + len = min_t(int, len, TIPC_MAX_LINK_NAME); if (!string_is_valid(name, len)) return -EINVAL;