Message ID | 20200420121508.962689315@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=w1qd=6E=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D71EC54FCB for <stable@archiver.kernel.org>; Mon, 20 Apr 2020 12:58:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEF7F2075A for <stable@archiver.kernel.org>; Mon, 20 Apr 2020 12:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587387517; bh=fGBeDcGkMF8qnx98mzK/4Lz582y1joSmdAPT16srA5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e20peFV2Wn6TPVnPv+ymIySB7v0Zo3/fYmVlTU5/5Ml5RIRv2ExEgXBqA3Ye3+gNg Keezw681vY7BEjDLHcaCg8Y8zW7Kk/sIZCTwz8hbJgLCwbVzNkEL/psVI3JVlatZSf WazXmMiOvHzl1meuBAZmNcWRhHXemSKSgg1zt7to= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728360AbgDTM6c (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 20 Apr 2020 08:58:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:36172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726498AbgDTMmy (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 20 Apr 2020 08:42:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 BCFE720747; Mon, 20 Apr 2020 12:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587386573; bh=fGBeDcGkMF8qnx98mzK/4Lz582y1joSmdAPT16srA5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g6nBb/4gLUGbq31KQEj81USQ8uYcTsvQ8ge3g/nr5+iIU1LBo11X10bXpagTHCvsl y3ffZP0JFWg8PeTM8WUunSE5jMskQOUfvxUdmzlnmlK5npKnIdf6U45Iya86ad42e9 CQlf5DYi1DZqqgO0JKY441VuldmRf4cEkdmEr45I= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Taehee Yoo <ap420073@gmail.com>, "David S. Miller" <davem@davemloft.net> Subject: [PATCH 5.6 02/71] hsr: check protocol version in hsr_newlink() Date: Mon, 20 Apr 2020 14:38:16 +0200 Message-Id: <20200420121508.962689315@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200420121508.491252919@linuxfoundation.org> References: <20200420121508.491252919@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c @@ -61,10 +61,16 @@ static int hsr_newlink(struct net *src_n else multicast_spec = nla_get_u8(data[IFLA_HSR_MULTICAST_SPEC]); - if (!data[IFLA_HSR_VERSION]) + if (!data[IFLA_HSR_VERSION]) { hsr_version = 0; - else + } else { hsr_version = nla_get_u8(data[IFLA_HSR_VERSION]); + if (hsr_version > 1) { + NL_SET_ERR_MSG_MOD(extack, + "Only versions 0..1 are supported"); + return -EINVAL; + } + } return hsr_dev_finalize(dev, link, multicast_spec, hsr_version); }