Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1251381rwd; Wed, 31 May 2023 11:18:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FwBgpZY26uRkCFHGVFZzqEShSGWUczK8p5qHimJ2iOTytahEI3PPamh1eAJHFMLw0SRKZ X-Received: by 2002:a05:6808:3a98:b0:398:596d:69da with SMTP id fb24-20020a0568083a9800b00398596d69damr4247841oib.22.1685557137801; Wed, 31 May 2023 11:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685557137; cv=none; d=google.com; s=arc-20160816; b=Fj2cCE2lf9s9CLU63TYCmDYporBeec0Ae6ir75lZcHWrDVpAnk6tp8I2P7r82p5jEo ZCRn3h/eco+OjE10m9sens4pqYWeRgyf1Hm2sCjqM4OAccq0QJaYY5BoU7p3pEqhsVIf rlxgQjPH+dF5h9GC0KiHTcH2GatdhB6sf8FPBpyABjBB39rc31AjXeiLqZs2Wlazc2ZC LWWU5NGhUMYuQavkU1DfhGSQHDJoItFoX2WBLDHBMYFez7Fw6V/TqOqjSCR3xNWneRqE mWrejB/wooEpSjlVdwLEOy1Ghq9RCK4Zu6WSuVpjC+RKNwxMLkwOyYovMmESJgVin05k 8NAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YAWAJe3UA9xA6PqORf3KUovsk+ctYnZo8FLCQDjgOnc=; b=cchRFS7LZHEV1hO3VIQkpc8q83VdwUtJ63V1r8RXLNJ3RMFP+ksJChRsO6wWJTFneC JxTkd/VLRS5QQFu+8vRqdS7BLF4SxKtRUdlxTFn91eFaiCuf8pbTTFe6XDw9UmLIzn/1 ICIaq5Et+9EOj6jm+OmJxkmjkhbJaaYhsQDAyg/3z+XVC/EnhthXbjlwCXaPN9IWOowe +FR2esBI+LEF3axs48cho8fqtYRuc4TaPMaz67c9ThIn+oXBz70uzeXsz1cAIShBkAhb T1wZr7GXqaTu99yLlWJ735Q1MnL0MvNniwcZh9yXdZ1V74o6L9YSwMqgjHdeCxjlaCmi a74w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=crju0aub; 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 s195-20020a632ccc000000b0053fbae20d02si1377337pgs.655.2023.05.31.11.18.38; Wed, 31 May 2023 11:18:57 -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=crju0aub; 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 S229925AbjEaSMa (ORCPT + 99 others); Wed, 31 May 2023 14:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjEaSM3 (ORCPT ); Wed, 31 May 2023 14:12:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D3D126 for ; Wed, 31 May 2023 11:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685556706; 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: in-reply-to:in-reply-to:references:references; bh=YAWAJe3UA9xA6PqORf3KUovsk+ctYnZo8FLCQDjgOnc=; b=crju0aubawoYU4mm8exgvUgGHdWCH2IbFJuXA8+Ajhh9ywkwgHVINh1+8VkilEyBJa/HOU OCkd+IeTgq+Fxzw5JtpRySQ765RwAf17GMrhEAlKeWg2IJRppy/Rd4oN2J8AQ7QYsrN++6 RLvAR/c25DDR/BoZbVeU7NDWGCVYOiA= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-2aGgjcTMMKSFu91oVV08nw-1; Wed, 31 May 2023 14:11:44 -0400 X-MC-Unique: 2aGgjcTMMKSFu91oVV08nw-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-30af00323b0so1541937f8f.2 for ; Wed, 31 May 2023 11:11:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685556703; x=1688148703; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YAWAJe3UA9xA6PqORf3KUovsk+ctYnZo8FLCQDjgOnc=; b=c0e5kBRHG6h5YHxnCCWwKXVREGPgljffxp3BQWl56CT+wXeXX6RHybNzPakN2HY1DC R1lsqhFhsFfOY7wmJdTq76yXzkBdkrXdfeEBDhLjenjzzNS1Oe3Kn87cr2UPtyut3Jwr IIE4a0Bbt+g5qVBarb9+oeHnFg03L3jcEo1b4Um51UFXuFTX6A/A4UmFWQ4d13bewBTI MDbiSGUDscFWYXfPh/f1kBNzvhcL0ya9CtFrPi1PSY3rM4aXgPylD5GS8L17ObluxUv5 xE6QSKRptdUHOaMxQkIe9EP32dK0gnkR9JahATFvknL65mZgqXHKQmmE/qz51opmePdK PNUg== X-Gm-Message-State: AC+VfDzB+xUzwXXdklJ1kXowOyaHrhih9qaeYujgoiGUAWu7oh4cfqzN npfR4U0MdhKcb0bKJC2iSlkeYJEAbp1YEHyHPF6ovI9OB0QQZhOZ12BZlgi3bO+8KCN/XMr6W00 A1PMuMf3J8jbEoY3qlFGRg7Fg X-Received: by 2002:a7b:c00f:0:b0:3f6:464:4b32 with SMTP id c15-20020a7bc00f000000b003f604644b32mr29558wmb.13.1685556703648; Wed, 31 May 2023 11:11:43 -0700 (PDT) X-Received: by 2002:a7b:c00f:0:b0:3f6:464:4b32 with SMTP id c15-20020a7bc00f000000b003f604644b32mr29540wmb.13.1685556703308; Wed, 31 May 2023 11:11:43 -0700 (PDT) Received: from debian (2a01cb058d652b003ebe8a257dfba413.ipv6.abo.wanadoo.fr. [2a01:cb05:8d65:2b00:3ebe:8a25:7dfb:a413]) by smtp.gmail.com with ESMTPSA id t7-20020a5d4607000000b0030647449730sm7533168wrq.74.2023.05.31.11.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 11:11:42 -0700 (PDT) Date: Wed, 31 May 2023 20:11:41 +0200 From: Guillaume Nault To: Mirsad Todorovac Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: POSSIBLE BUG: selftests/net/fcnal-test.sh: [FAIL] in vrf "bind - ns-B IPv6 LLA" test Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, May 24, 2023 at 02:17:09PM +0200, Mirsad Todorovac wrote: > Hi, Hi Mirsad, > The very recent 6.4-rc3 kernel build with AlmaLinux 8.7 on LENOVO 10TX000VCR > desktop box fails one test: > > [root@host net]# ./fcnal-test.sh > [...] > TEST: ping out, vrf device+address bind - ns-B loopback IPv6 [ OK ] > TEST: ping out, vrf device+address bind - ns-B IPv6 LLA [FAIL] > TEST: ping in - ns-A IPv6 [ OK ] > [...] > Tests passed: 887 > Tests failed: 1 > [root@host net]# This test also fails on -net. The problem is specific to ping sockets (same test passes with raw sockets). I believe this test has always failed since fcnal-test.sh started using net.ipv4.ping_group_range (commit e71b7f1f44d3 ("selftests: add ping test with ping_group_range tuned")). The executed command is: ip netns exec ns-A ip vrf exec red /usr/bin/ping6 -c1 -w1 -I 2001:db8:3::1 fe80::a846:b5ff:fe4c:da4e%eth1 So ping6 is executed inside VRF 'red' and sets .sin6_scope_id to 'eth1' (which is a slave device of VRF 'red'). Therefore, we have sk->sk_bound_dev_if == 'red' and .sin6_scope_id == 'eth1'. This fails because ping_v6_sendmsg() expects them to be equal: static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) { ... if (__ipv6_addr_needs_scope_id(ipv6_addr_type(daddr))) oif = u->sin6_scope_id; ... if ((__ipv6_addr_needs_scope_id(addr_type) && !oif) || (addr_type & IPV6_ADDR_MAPPED) || (oif && sk->sk_bound_dev_if && oif != sk->sk_bound_dev_if)) <-- oif='eth1', but ->sk_bound_dev_if='red' return -EINVAL; ... } I believe this condition should be relaxed to allow the case where ->sk_bound_dev_if is oif's master device (and maybe there are other VRF cases to also consider).