Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1636035pxb; Mon, 8 Mar 2021 02:34:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJkh9713+5f1Si0soKSk5i0Z+CfDv1bfRIeGrdfzlHUag+Vf3NiquZ2AWSnEnj1OkwC4ee X-Received: by 2002:a50:da4f:: with SMTP id a15mr20966315edk.301.1615199657201; Mon, 08 Mar 2021 02:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615199657; cv=none; d=google.com; s=arc-20160816; b=xmRSzNPws5BlU30tf4VRjbCcTr9txe2MjMKA9Jc97LUzE9MhfvhQWX9X6vYCRTXasu BnSqlmvcEDSv7ILgfnE0SvxtNiGvhCZhK3tCdfFPPGmsiueAbSnrzok+bcQ6S3WITEV7 QXNpv83pcJzwfKsgQ+CVkGRmNWBXbeaUGQYyT/HMBwT/GP4kdqzfMLcbWMVJqztaM/jH zcueTXvQuR9kSvhFsIS+w0wpj+c/V6TYamMOYNmkElSgJ9H4HvyRUVaZdAm/4kzejZOa S0pvB1inpjvfkwstC6POfZhCrTXM8TiUCNYa5Y1B4vMKPK9o+l3s8+xOXTYNC5Rvzpjd uuNQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=sPmn+3VtIFlvEVuOGLaP5xi0YdL6Nlb6OjKmNe5SwYQ=; b=BqPaNEBlA5nlaMAdzMN8gMtgNUjkFaypFw4Asmn/V8fuEpGjheea2K9Sg3ylh0V+7R 0mbeQJiTfhrziP3ctx5pOJsfBS7FiJMykC7vMT5isCbPoyucAazaF1j3Xrcjkv1sQ8vy cVKvXRXWK9FmkoLiZoGH9kpy90ArG771uSqC4sObiwL73KWGLGRvgllyha/wB2eAd6qY AYdMolC8V/BjiKVP3GKnCKVQoE0VH7rtz5p5y6zHnPfKGRUmkrJRPLhLLqyFJ/o53eeG NwS+rLY2nMHPsqzLjO1IMNxNCCyx971WT5WU/ymkrVN67qiFMQRUTdCACPAMe8CSsgRG LDVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RP6fse8s; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si7237876edj.308.2021.03.08.02.33.55; Mon, 08 Mar 2021 02:34:17 -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=@redhat.com header.s=mimecast20190719 header.b=RP6fse8s; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231594AbhCHKcp (ORCPT + 99 others); Mon, 8 Mar 2021 05:32:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52822 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231572AbhCHKcT (ORCPT ); Mon, 8 Mar 2021 05:32:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615199538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sPmn+3VtIFlvEVuOGLaP5xi0YdL6Nlb6OjKmNe5SwYQ=; b=RP6fse8sqo2f86DotzKiHEDFE5fkPYWJuCCQDwq34LyAXsL5p+6kq6jRDKmfEpYjn9pbZI 1jghODWkq6MaBzz1daZ6XYSnga9Eb+arVb9VsOpEh11R6X8pNuewI9xzznvQMtKmSHBOh8 2osW3TMohbCkBbwZHqMOh263X9l2iNM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-VEeGFNJyMiOmN3ac4SUGyA-1; Mon, 08 Mar 2021 05:32:17 -0500 X-MC-Unique: VEeGFNJyMiOmN3ac4SUGyA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6402101962C; Mon, 8 Mar 2021 10:32:15 +0000 (UTC) Received: from bnemeth.users.ipa.redhat.com (ovpn-113-99.ams2.redhat.com [10.36.113.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id D83AB18C7A; Mon, 8 Mar 2021 10:32:13 +0000 (UTC) From: Balazs Nemeth To: 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, bnemeth@redhat.com Subject: [PATCH v2 0/2] net: prevent infinite loop caused by incorrect proto from virtio_net_hdr_set_proto Date: Mon, 8 Mar 2021 11:31:24 +0100 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here is v2 of the patches that prevent an infinite loop for gso packets with a protocol from virtio net hdr that doesn't match the protocol in the packet. Note that packets coming from a device without header_ops->parse_protocol being implemented will not be caught by the check in virtio_net_hdr_to_skb, but the infinite loop will still be prevented by the check in the gso layer. Balazs Nemeth (2): net: check if protocol extracted by virtio_net_hdr_set_proto is correct net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 include/linux/virtio_net.h | 8 +++++++- net/mpls/mpls_gso.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) -- 2.29.2