Message ID | 20200501131521.178970534@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=1/SS=6P=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,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 C93FBC4724C for <stable@archiver.kernel.org>; Fri, 1 May 2020 13:28:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FA99208DB for <stable@archiver.kernel.org>; Fri, 1 May 2020 13:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339713; bh=oKniy+kiYwiUS+eRELPq61cbjj8BQLGPrq2i4CNt50w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=p8WbPKxTYvXHWxp05GrOTK1xF0WvbF5KJ+D/RYWGkJsskdNwfnun1RjqmFYPWPGqX zpljzxa8VyQ6ivH/BvhTUUqgoreW/ChiLp6WH+XHd93WDFW7OR0f46ZEDri/Dz2DPT 0DdAKBrGBzUn3uOvhy3mrbUwZ4O61N01QjwGymWI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729630AbgEAN2c (ORCPT <rfc822;stable@archiver.kernel.org>); Fri, 1 May 2020 09:28:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:51674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729626AbgEAN2c (ORCPT <rfc822;stable@vger.kernel.org>); Fri, 1 May 2020 09:28:32 -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 3A33D2166E; Fri, 1 May 2020 13:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339711; bh=oKniy+kiYwiUS+eRELPq61cbjj8BQLGPrq2i4CNt50w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2sl4Oig9lxyJciylx9oOnTpeoxkobz6KUGbQNv0y/zCYu70KOrPvZupSqz5sUy7bE wyHvvef/BZpaPFpSl8TOm3tQnaVXKjLcgjjt4SLC+gAoRAcpscHDrFNGlVhXu9+wf1 7I3Y4gNp3w+beX5GUvwTgx5CPQ6j2brqc5U5mgFc= 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 4.9 21/80] macsec: avoid to set wrong mtu Date: Fri, 1 May 2020 15:21:15 +0200 Message-Id: <20200501131521.178970534@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131513.810761598@linuxfoundation.org> References: <20200501131513.810761598@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/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -3209,11 +3209,11 @@ static int macsec_newlink(struct net *ne struct nlattr *tb[], struct nlattr *data[]) { struct macsec_dev *macsec = macsec_priv(dev); + rx_handler_func_t *rx_handler; + u8 icv_len = DEFAULT_ICV_LEN; struct net_device *real_dev; - int err; + int err, mtu; sci_t sci; - u8 icv_len = DEFAULT_ICV_LEN; - rx_handler_func_t *rx_handler; if (!tb[IFLA_LINK]) return -EINVAL; @@ -3229,7 +3229,11 @@ static int macsec_newlink(struct net *ne if (data && data[IFLA_MACSEC_ICV_LEN]) icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]); - dev->mtu = real_dev->mtu - icv_len - macsec_extra_len(true); + mtu = real_dev->mtu - icv_len - macsec_extra_len(true); + if (mtu < 0) + dev->mtu = 0; + else + dev->mtu = mtu; rx_handler = rtnl_dereference(real_dev->rx_handler); if (rx_handler && rx_handler != macsec_handle_frame)