Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4972447ioa; Wed, 27 Apr 2022 15:46:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn3x0IoNMD6wy+QUq2zV/pYB+xV8bSNvKB+rH/LWDLtsVDzC/hNlB15FBXvLF6kbqszG0u X-Received: by 2002:a17:90a:a82:b0:1da:3763:5cf5 with SMTP id 2-20020a17090a0a8200b001da37635cf5mr6168939pjw.55.1651099575659; Wed, 27 Apr 2022 15:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651099575; cv=none; d=google.com; s=arc-20160816; b=d8LSveBEJPYKFxbQZNi2+CdBWz7ls112ho+GKBN5CToWIEiBI1WYL4cKvXxKPGMTki Sx2sVmXQPAUSZ8dh9D4tDamE1olEbJCIUzcX4Si6Pw02P1DjnYf87snd8zChqobO62Gq uiYWeYhXVhOW6IxgNVRNBH+uqRsI3an+yZdYPN0mSjvRAe6zNpsII973vA1dxn3xIq4W yI6Ce3E8DwPBsI8RsPjgFifi2j5d8s7OJ7QA0FqWc0Wy778hQkC9K0Oghje1RQbCMCRD 27Hhe7IBgkTBxVaVfVOE86buhYMlrFsd6aeUOFA07hiLXzHSqFuofm6BcRM8JohjmVsl 4/fA== 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:message-id:date:cc:to:from:subject:organization :dkim-signature; bh=ynrdYfrlOMf+XrSFv4MehKt+yj27yIpUWGbpxiPvDXQ=; b=QalgE2gnfYyyOgaMw3MU8FbKyRP5b3u5uzwasNddnn4vcIzS4xjSkt1URk+ri4K27E znOVhDJzjBj9LltmgrTX4cwa72rIEPMNmhLFChduGl4eEO/sVNgpiE4I/etkUKYqaU9L UGQtdT7+uPLtKAvn9wnYuzlNox6M3rdG3ssQ6/TvSfeB1z6GFcQ9b22TBteTBLzrOANy 6SLjAvNgSRmYbnqMl2x6lReDLf1Cz7ZZ5+Hosfv58Sp7sCgcMrFSaAEL1xTDOH8ArBll 43NIlItiNOZLdVJpNGD+3VEFeqGAvmQ7/GShaMImUtaROMiPKcFqhNf5izzGyeDbpljC HbNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W1vbmzno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l184-20020a6388c1000000b003ab7e471c80si2494253pgd.471.2022.04.27.15.45.56; Wed, 27 Apr 2022 15:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W1vbmzno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237543AbiD0Vd6 (ORCPT + 99 others); Wed, 27 Apr 2022 17:33:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237501AbiD0Vdz (ORCPT ); Wed, 27 Apr 2022 17:33:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0501327152 for ; Wed, 27 Apr 2022 14:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651095042; 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; bh=ynrdYfrlOMf+XrSFv4MehKt+yj27yIpUWGbpxiPvDXQ=; b=W1vbmznoW+pxPcxH9702/BkOKu+WIgNj3WijqPEou/H/2VKdSzhd4x3+m3f5euRuHrDpVu 0bW9uJ+oxR0D97VRHzYZmXLotLbEkYv3sc4cW7kG2DbT9XWfs5xNB+jKeG+gxUOdr93tOS jqGA+WZSMUExNfFRYuDqTw7AsR8D4lE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-271-Qj0SZqLlOSu5i6kHs-f7DA-1; Wed, 27 Apr 2022 17:30:38 -0400 X-MC-Unique: Qj0SZqLlOSu5i6kHs-f7DA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D61885A5A8; Wed, 27 Apr 2022 21:30:38 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69CBA40CFD0C; Wed, 27 Apr 2022 21:30:37 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH] rxrpc: Enable IPv6 checksums on transport socket From: David Howells To: marc.dionne@auristor.com Cc: Xin Long , Vadim Fedorenko , "David S. Miller" , linux-afs@lists.infradead.org, dhowells@redhat.com, linux-kernel@vger.kernel.org Date: Wed, 27 Apr 2022 22:30:36 +0100 Message-ID: <165109503652.611257.12851860419631266883.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org AF_RXRPC doesn't currently enable IPv6 UDP Tx checksums on the transport socket it opens and the checksums in the packets it generates end up 0. It probably should also enable IPv6 UDP Rx checksums and IPv4 UDP checksums. The latter only seem to be applied if the socket family is AF_INET and don't seem to apply if it's AF_INET6. IPv4 packets from an IPv6 socket seem to have checksums anyway. What seems to have happened is that the inet_inv_convert_csum() call didn't get converted to the appropriate udp_port_cfg parameters - and udp_sock_create() disables checksums unless explicitly told not too. Fix this by enabling the three udp_port_cfg checksum options. Fixes: 1a9b86c9fd95 ("rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket") Reported-by: Marc Dionne Signed-off-by: David Howells cc: Xin Long cc: Vadim Fedorenko cc: David S. Miller cc: linux-afs@lists.infradead.org --- net/rxrpc/local_object.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index a4111408ffd0..6a1611b0e303 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -117,6 +117,7 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net) local, srx->transport_type, srx->transport.family); udp_conf.family = srx->transport.family; + udp_conf.use_udp_checksums = true; if (udp_conf.family == AF_INET) { udp_conf.local_ip = srx->transport.sin.sin_addr; udp_conf.local_udp_port = srx->transport.sin.sin_port; @@ -124,6 +125,8 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net) } else { udp_conf.local_ip6 = srx->transport.sin6.sin6_addr; udp_conf.local_udp_port = srx->transport.sin6.sin6_port; + udp_conf.use_udp6_tx_checksums = true; + udp_conf.use_udp6_rx_checksums = true; #endif } ret = udp_sock_create(net, &udp_conf, &local->socket);