Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3658493pxv; Mon, 26 Jul 2021 08:53:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAzhikKBf4Lph9D9RpllzSr15lkDk7l42UReKUz4cbmARwE+J2kIt+yvYFabAR1FIZYloP X-Received: by 2002:a05:6638:144e:: with SMTP id l14mr17164904jad.69.1627314821038; Mon, 26 Jul 2021 08:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627314821; cv=none; d=google.com; s=arc-20160816; b=Bigpm94wL5VKPNIUSuBtvpvXtc+0ueykZY2Ut/iaV+HmMm+6PKcrxQd4XxvX72mflt igiwqUoc5JXHUINc6Ajq2iRAfJ76s5mH2+Tejk532A8VxgYLvdUGCIQbejt7z6FEFX6w VJnAma00ocMOqmOPXyCY4q1hNoMcS9HmYwU1YYSX4cIZJ6AE9pBrzGWj1yt1AyB9Qlup EYKvsiH1IGxKzjpz6Al7WOEdoo9qsOPLS9w0g/Y/BPpWX93qYaybzZmrpX3xbJ62UME0 zBR3wV2B3udE0S5Uykb6GIEZDghabs7pMd9u1KCjBZxuUxyGXq9CiR3g0w+vT/qgqYwB X5zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GWcRf+NVFsiCbI2fKIzBII+qbBcOG+5LrkZ73ncM3V0=; b=XltVdM9IxTA4vNJ2WEq1kdORHlAnU0raUA6YucA3Ov1cmGB1/HFu3Raqyc+cFdMKYQ Xkw1E+qRicm5MVrY5hm8sIfHF29V/qt8pT3OAqoWTMu2Uyq9enTURWtYAqox/vDIdbSG Pl8Hj8y+IBRMil+7vcWrbFdRw71AzGx7xvzjEF7ynjUDFbQbZ5q9Fi5+SBoSGuHSzR8T nR0CZBhw54uFcd2VD1EaTyrrw/pxRNSqDmV1rcm7S0KDYPaB5xSfkwTr0YC6pUfhu++f 1/yYjdI/toSl+mEbvAB+jzTfr3yi81mXqBoZJZVvWWoHYsUft9C4OEdVu5xk6LgwSVWR DjLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1C/90gDR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p20si319168ioo.40.2021.07.26.08.53.26; Mon, 26 Jul 2021 08:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1C/90gDR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236186AbhGZPLg (ORCPT + 99 others); Mon, 26 Jul 2021 11:11:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:48178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235637AbhGZPG7 (ORCPT ); Mon, 26 Jul 2021 11:06:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6506F60F02; Mon, 26 Jul 2021 15:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314447; bh=BWv4EkuUrg95Zrw8X36zBTW4ww8yj7vke24t6oZFk24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1C/90gDRBRmcW3atXt78M3idOVk1bHNnngZmW7EONrBl4gbJGrZTdoIYiYRSA+kEm HDhq3o4t3tol8SBmn1qZQpWUL1idgyAUloI+KNSqv0x5MQuJX1Wmt5I7uFM9jRrzB5 Eu2/qQPcqiBmlJWVp4xiHyuwMHxuu+9FSHG7Oih0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Ahern , Vadim Fedorenko , "David S. Miller" Subject: [PATCH 4.14 23/82] net: ipv6: fix return value of ip6_skb_dst_mtu Date: Mon, 26 Jul 2021 17:38:23 +0200 Message-Id: <20210726153828.914577479@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153828.144714469@linuxfoundation.org> References: <20210726153828.144714469@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vadim Fedorenko commit 40fc3054b45820c28ea3c65e2c86d041dc244a8a upstream. Commit 628a5c561890 ("[INET]: Add IP(V6)_PMTUDISC_RPOBE") introduced ip6_skb_dst_mtu with return value of signed int which is inconsistent with actually returned values. Also 2 users of this function actually assign its value to unsigned int variable and only __xfrm6_output assigns result of this function to signed variable but actually uses as unsigned in further comparisons and calls. Change this function to return unsigned int value. Fixes: 628a5c561890 ("[INET]: Add IP(V6)_PMTUDISC_RPOBE") Reviewed-by: David Ahern Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/ip6_route.h | 2 +- net/ipv6/xfrm6_output.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -214,7 +214,7 @@ static inline bool ipv6_anycast_destinat int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, int (*output)(struct net *, struct sock *, struct sk_buff *)); -static inline int ip6_skb_dst_mtu(struct sk_buff *skb) +static inline unsigned int ip6_skb_dst_mtu(struct sk_buff *skb) { struct ipv6_pinfo *np = skb->sk && !dev_recursion_level() ? inet6_sk(skb->sk) : NULL; --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c @@ -146,7 +146,7 @@ static int __xfrm6_output(struct net *ne { struct dst_entry *dst = skb_dst(skb); struct xfrm_state *x = dst->xfrm; - int mtu; + unsigned int mtu; bool toobig; #ifdef CONFIG_NETFILTER