Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2417377pxj; Mon, 17 May 2021 00:43:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrAUNeE7K9spBRe2JIeuJdXbmyNNOA+EOaQGAStL9TfosRve7RgJgscH52/6Kta42OrpHp X-Received: by 2002:a17:906:46d1:: with SMTP id k17mr17131177ejs.77.1621237438053; Mon, 17 May 2021 00:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621237438; cv=none; d=google.com; s=arc-20160816; b=cqcujoYMbNzDcWy+7O1DrnyGf625DYVxdc/ild4RVL+FiDr0YYR2zRtrIlbSYLNXAv oh8lXeGofWrRi7dMmsPlDRNIQoFr5KVV9ZcBxBpdb3Jrh3218u1K2gcrdLFkajs5ACgT wtVmVJDZyvq+3cb7sIWxfkfUGmFOq+xJzSoTL2NKRwW8Ct9MJBZjhRWtd4tEtfU+5uQ1 z2BLGYY0kZ9OD6YiMTKPUy18TyWPxl83eme9fy5gWpAmP00BX2ZJ5PM0pGZPx9P07jjl UpgBSHndOh+lOGh3pAPZiqPLfz5W5tYhXF0K6HG8kfRO/a9wXh9yMnqF8NRwk4ZffgQi vXRg== 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:date:cc:to:from:subject :message-id:dkim-signature; bh=f7qNgC8imSHKbn6li286hRYwuW3Kgkex7BvbIupjpGc=; b=PGrYIII4guOZpHX82541WNvVA9Fn5cSrtJyfmnsIut+ECca0yg6O9+ksQF+jPoGyHe SCBnrdKKWM7g5vQfm1G+ibhOvOkfzhd6fuJ0Ok6Eaxob7RJxh5LFH8Tg2o8gIKmlspxe iLCO2scwZdJ6ODuSjXe4FP6m5CdL/ArtL6lkcnG3WIDurIZujNs11DramizI2oh04bop gSw4DzBWFWZHK3x2zispT9JeHkf0bvjlBt3GEc9ta6HEgRU/UIpaB+B+nNt0IH8Qwe8x mFe71NCK9AVZUDF/htnVWL2COAgHYAq8BN/Vb9jHpF0wkS7SdipnBnoQeK2erug7VQ7o Sblg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="L2im/GdJ"; 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 jz8si7361228ejc.34.2021.05.17.00.43.34; Mon, 17 May 2021 00:43:58 -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=@redhat.com header.s=mimecast20190719 header.b="L2im/GdJ"; 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 S232895AbhEQGw5 (ORCPT + 99 others); Mon, 17 May 2021 02:52:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55795 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbhEQGw4 (ORCPT ); Mon, 17 May 2021 02:52:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621234297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f7qNgC8imSHKbn6li286hRYwuW3Kgkex7BvbIupjpGc=; b=L2im/GdJyeCvDavHITZJK9gfie3E3kI7t1TWGb82a/XBAPPFfJZcDSFoHUa0cO1GvZtN/F kHFjuIowdmOhoBKc8JvhkO8sh92oXSmEpoxObJ2pvQ9lyYhgy2Nz94YxU4e7E5/l274IF9 EJSqvYhhneBWPIcCMrxCwINGS9acD7A= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-575-n8NL2SwyOF-xeb6H69X4nQ-1; Mon, 17 May 2021 02:51:35 -0400 X-MC-Unique: n8NL2SwyOF-xeb6H69X4nQ-1 Received: by mail-wm1-f70.google.com with SMTP id o10-20020a05600c4fcab029014ae7fdec90so1051947wmq.5 for ; Sun, 16 May 2021 23:51:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=f7qNgC8imSHKbn6li286hRYwuW3Kgkex7BvbIupjpGc=; b=ogtU9cPFyr09v+SkvAywBLKFcfVr9LzSKNoWTo8IYP0Gx4OEIMLAQ9Dj4LNyLPJM4c 8xZxOTJrnW+MZjt71zodKeHX+nsDE1l9JuVe7BqBv1kXsvTO6er++F7jqp6PGrJrhydc /YXgj3XYIQr3HPdVwHzLN97SmT9GIIJadcjaBnWaK2r0/tNFO068whImNZzmrbczd16m XIQVr1/pWos64ZJco3/HvBH7BX6Je6LkD/FiQQXkTpY4w2xFyh4+a33T4OO5C3Cjpdqg LelS3TiJis8cc80HyWZFBCBRubz3Z1Kdo8SUq4M47fs7GBUcslfkcGzpS9mK0Uzcygc6 NXCA== X-Gm-Message-State: AOAM5321GY6LWUPRWVj+7JrSf4KN5nmU24pzpxeXMY8PCd54+h6BED8Q ESa5c+j5RnAzUPPUv0eS8NqFNYuKV32DiE1kAc6lVhvI1Sg1MY13WaGvESBQmgXYYSxsUsh6Lgy q6s126nrgiP/NgAYvMJTXxRHV X-Received: by 2002:adf:fd82:: with SMTP id d2mr73783376wrr.218.1621234292984; Sun, 16 May 2021 23:51:32 -0700 (PDT) X-Received: by 2002:adf:fd82:: with SMTP id d2mr73783362wrr.218.1621234292843; Sun, 16 May 2021 23:51:32 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-245-104.dyn.eolo.it. [146.241.245.104]) by smtp.gmail.com with ESMTPSA id k7sm16778838wro.8.2021.05.16.23.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 23:51:32 -0700 (PDT) Message-ID: <2e1ffc55aedb5d10eacce34cb7a5809138528d03.camel@redhat.com> Subject: Re: [PATCH 5.10 380/530] udp: never accept GSO_FRAGLIST packets From: Paolo Abeni To: Pavel Machek , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Willem de Bruijn , "David S. Miller" , Sasha Levin Date: Mon, 17 May 2021 08:51:31 +0200 In-Reply-To: <20210515083717.GD30461@amd> References: <20210512144819.664462530@linuxfoundation.org> <20210512144832.263718249@linuxfoundation.org> <20210515083717.GD30461@amd> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2021-05-15 at 10:37 +0200, Pavel Machek wrote: > Hi! > > > From: Paolo Abeni > > > > [ Upstream commit 78352f73dc5047f3f744764cc45912498c52f3c9 ] > > > > Currently the UDP protocol delivers GSO_FRAGLIST packets to > > the sockets without the expected segmentation. > > > > This change addresses the issue introducing and maintaining > > a couple of new fields to explicitly accept SKB_GSO_UDP_L4 > > or GSO_FRAGLIST packets. Additionally updates udp_unexpected_gso() > > accordingly. > > > > UDP sockets enabling UDP_GRO stil keep accept_udp_fraglist > > zeroed. > > What is going on here? accept_udp_fraglist variable is read-only. Thank you for checking this! The 'accept_udp_fraglist' field is implicitly initilized to zero at UDP socket allocation time (done by sk_alloc). So this patch effectively force segmentation of SKB_GSO_FRAGLIST packets via the udp_unexpected_gso() helper. We introduce the above field instead of unconditionally segmenting SKB_GSO_FRAGLIST, because the next patch will use it (to avoid unneeded segmentation for performance's sake for UDP tunnel), as you noted. Please let me know if the above clarifies the situation. Thanks! Paolo