Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2662075pxb; Tue, 9 Mar 2021 07:58:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1LD+PkKQfGnTLGPb5lUyxGghN1rPDrA+/dwSkhWEcA7r611ZbTbzr7JQ909qliLPuz7O4 X-Received: by 2002:a05:6402:30a5:: with SMTP id df5mr5007540edb.24.1615305513211; Tue, 09 Mar 2021 07:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615305513; cv=none; d=google.com; s=arc-20160816; b=B1OR0H/+0hthqMuZmLxlbs0NbW0I2I6+8LXagJ4ZsuLy5HW66AS1yUtMRdLjb45AE7 bgNGx5xssi53ct7nNbGyCh+vpqpQjrDNK5fdmPYYMkWpeafbJ861RmsR+BLbngsoPZng PK4sN9Jl9UH7Y+F5xXb8+Xb30DQL7k/oSUNfmdldFd/nPSPLWzEHNlb5K2aV4oSb5fog seDSKawJffYN2ELqWFTH6ACXShAby9XopkfcMSjo5+n/WTcEuKXBo80jWJ26Q/smZh5F EQT3uBSHYIYJzdNI9uZCDFsgnusRbUIOAp69434RhDNBTNF54kjpscOmmgSxe4YbgxCr /v+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=b5sJf5a/Nsswl7kMHUtt9MARj1P3JFHsuY5CgeMMi5Q=; b=HmxcYvrw+EZLyz+/pJ0hz3Eokr8AdDphkuTPQGBG9OVEQciDcYwWLZA2YtP0230ITK tzDVLNdi4/YEvyibltKAE10qPaPTCBv5207SF3D/im9ZEaxQmLO9WmK420t4cXUcZEOi Zy1/ufVp8y1NrMdfGY7qrMFY+FIx1+zJIz5pAR2/XRYGxEJozj5OadHPtpOPOIfY26V5 NEnTu86L+k6G2DZwNk6/x2oaKkSMetpsbBYLpVuo82qoZxHFdA1xRA48csFMyZSJIcde HxzqDk0KjgxY5HLDKqcY7s1CllbGdAsnHHg1Qx5PP8NRVnUgz0JHOFY1hG63oAduxrWZ ORBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="reguRV/K"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si1550397edc.195.2021.03.09.07.58.10; Tue, 09 Mar 2021 07:58:33 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="reguRV/K"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231968AbhCIP4U (ORCPT + 99 others); Tue, 9 Mar 2021 10:56:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231951AbhCIPzr (ORCPT ); Tue, 9 Mar 2021 10:55:47 -0500 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3759FC06174A; Tue, 9 Mar 2021 07:55:47 -0800 (PST) Received: by mail-ot1-x32d.google.com with SMTP id t16so13256737ott.3; Tue, 09 Mar 2021 07:55:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=b5sJf5a/Nsswl7kMHUtt9MARj1P3JFHsuY5CgeMMi5Q=; b=reguRV/Ku7o0pbogf/jH0d0oJ9bs8Gg7KnDshPUabTd0DMCyxupAWt3RvDINC7r5FN m1aKVH3ls8zAmYf5cgXn/koNUdgNiQZmBhTWj9z9HZK0Tp53SThuvtBjv0ieLH7yTRvE +0qzoYZoepRwZ47CR3eucxI6LDO5zP4cMOPXY0uBEgTRKko+XJMdUCaOKgFPjHKuCDaO nElHP50cjUEn4xXnHEUvRKTxuRSigssWkPdnbFU3tIpGonKW5WraAixFe6K0qfiy1OkI IKfncQi9IMoGZmKdPl9y9aVs0gFU/Rwh9DvTS8INIPDwqR0xMo0Te4UZhoLqtyzwVVow M+1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=b5sJf5a/Nsswl7kMHUtt9MARj1P3JFHsuY5CgeMMi5Q=; b=TmUZZUPCXDdez/GIs/TiQzEP64e7SAGo73OZOP2TS7cwZ2kwEF3NEVex9xE+zaSmKb mFwT+HXALKeCD4XL2WDyQIED9/5BSqcm2BvmO48p5k8YwfgteRUADJGx4tneH7TmezT+ rlHCZAbpCMvKuBgLahc4n3MifLuaqbJGRECvwrhWebggNINNtuj88QQPyGDJGgbBeABe MSbVQZMIHsJ9GWCgXl0hSIBQND/tUzE07DmaM2+jfwjWXVMlEj2oTabt4qMeQKBhcuE1 4+zbFKhi9Uev+iAmHZqrgc7Gya6gDr4Uq3AvNqsqu6PfBMkNh1Z7AegkGchiPXqAJWyM 6xlw== X-Gm-Message-State: AOAM532Ut3qtqTbjDhDEJ1rPuS0+vaZjnAeW+bvHEYUsI7AfeN5Ct72m 5fXsxWTwSZ7ww/AgKW3ltA4= X-Received: by 2002:a9d:650d:: with SMTP id i13mr25180280otl.12.1615305346631; Tue, 09 Mar 2021 07:55:46 -0800 (PST) Received: from Davids-MacBook-Pro.local ([8.48.134.40]) by smtp.googlemail.com with ESMTPSA id d1sm2950488oop.0.2021.03.09.07.55.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Mar 2021 07:55:46 -0800 (PST) Subject: Re: [PATCH net v3 2/2] net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 To: Balazs Nemeth , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, davem@davemloft.net, willemb@google.com, virtualization@lists.linux-foundation.org References: <9b79f43d2dfec8b2cb8e896b5591e7b1c3cc1f6c.1615288658.git.bnemeth@redhat.com> From: David Ahern Message-ID: <0c2f075e-ea66-66df-82e4-2c5fa71b2d43@gmail.com> Date: Tue, 9 Mar 2021 08:55:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <9b79f43d2dfec8b2cb8e896b5591e7b1c3cc1f6c.1615288658.git.bnemeth@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/9/21 4:31 AM, Balazs Nemeth wrote: > A packet with skb_inner_network_header(skb) == skb_network_header(skb) > and ETH_P_MPLS_UC will prevent mpls_gso_segment from pulling any headers > from the packet. Subsequently, the call to skb_mac_gso_segment will > again call mpls_gso_segment with the same packet leading to an infinite > loop. In addition, ensure that the header length is a multiple of four, > which should hold irrespective of the number of stacked labels. > > Signed-off-by: Balazs Nemeth > --- > net/mpls/mpls_gso.c | 3 +++ > 1 file changed, 3 insertions(+) > Reviewed-by: David Ahern