Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1263531rwb; Wed, 7 Dec 2022 10:32:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7XOFCsVCbebusRP4gih9OmbZrg+ih2qNICkCl2DyDWkNKOFOiwtJ+nxwK2PuG9XHu4jPLU X-Received: by 2002:a17:906:230f:b0:7c0:d7b5:9ab0 with SMTP id l15-20020a170906230f00b007c0d7b59ab0mr16081710eja.647.1670437978192; Wed, 07 Dec 2022 10:32:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670437978; cv=none; d=google.com; s=arc-20160816; b=lu6ydTaf2Wq1tzQfcvoN+rSGeA9Ue5aUQEejyPA0eeNXQpnSO+JuMsUJK6HRh1ss3o th+mYm11ZqfkC27yeMydLIK6ekQhomHK2xclHvTyGsacwfB/6ZSvYkJJiERIK5kfy+gH pZsK1XTGlsqeyA5FfDC16ymGpDVYtzSYDdfA5lR+fsde7DaJ10Dyq3fRZl2aiJBbuIVz DbATnM7OaZs8xdJCrCwuDpDx7a7wBWa5YUbEEc4iv3sjuSpy9+z21FzygHFCEo/sAJjY K63tZ+B7HMfn/XK6+YWY+a2qmoPWaRE/2rHsUtCCyAVwakwuOuEjYISSLvlzCAnhIhiG EQSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xvQqPZb0HyLKTtihqVOtyF4LFNcuCoZJQcEBfxfdTAU=; b=bwdQWrGL12eDbjTPkQRVzmD946GwoKPx8+HSR1Q8a1lcB4w4JwahBCdnKJpF8i0YWP HF2WFzj4vGOSNkclkWGOjw65RDBadGK6S2S8/8PnGgX6DRIc75TOnUCXKE0PjNrbRtqR VqmM1DmNNEpdMstnYn3zOUEOetZhzrPdQ7yGDXjTOTY2C8bzB81WuvqmPFJXNKN9kCOm uoVd1s2VF7qpdQa+SDsanRELjod7TW1MpIck5sGT8xgS2seEe/B0aka2+k9RONAcVwX9 iyCDdarZnGv4NcpEwcSsX03AbGNaEjRFCa0e4IXKYEvdN/KPHavJ4vs53ndroFVNd1N8 mP/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=eCU6VlIX; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq40-20020a1709073f2800b0078dfe6dc4d2si11027062ejc.33.2022.12.07.10.32.38; Wed, 07 Dec 2022 10:32:58 -0800 (PST) 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=@google.com header.s=20210112 header.b=eCU6VlIX; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbiLGR74 (ORCPT + 74 others); Wed, 7 Dec 2022 12:59:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbiLGR7x (ORCPT ); Wed, 7 Dec 2022 12:59:53 -0500 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 576375D697 for ; Wed, 7 Dec 2022 09:59:51 -0800 (PST) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-3b56782b3f6so194341007b3.13 for ; Wed, 07 Dec 2022 09:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xvQqPZb0HyLKTtihqVOtyF4LFNcuCoZJQcEBfxfdTAU=; b=eCU6VlIXSasoscAbFFEqj7RkjyRoy5pojeLH7Jgh6ydvo9IAOBBeMSSnvkzxo1UTgO F6IOxpH+mrafQSbeJZRZfDzxhfiAScUPuJjwL0GDHflWAAC8uHxiXL4tZBa8EaOhbpMw u4WEOa3M6oYV6RFFCetVdo1+q7T5L8SBh8TBoGLMavAI4/WaHucYBi7ktF4OCywuMWxO YaPl2Ie3i4hCBrDWjBNheWilsLL+x9UBk7h9H6q1i36hnC41pQ6jyZzwhAYT5eIihsce 87MGs1YGbyzpwVa8uXnqZSqZiwi+wF1N5QTDVBu20A4VpP8WKd14FPTI6e24X0lDRfin erzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xvQqPZb0HyLKTtihqVOtyF4LFNcuCoZJQcEBfxfdTAU=; b=HvlDhEvK9GSKqwcbtyzZ7/s+rdK5p/YJH791QjwhGLLlrHo4rpnJ22DiA7ljPRa0WV pmYf5AcdkYPmvXKDEdglBaUgY+HJCR/t3tTrBbpAy0xZbQjsUoxAGWMpPwC1YnP9JTLF Rdsl0nmoHO3f5qRm/ZPwSLYll+dHvjEqthfv7KCjf+Et9XMexK84g0YHl9K+WrqaWe0o YjKCCH24ixOKL3m7/Wu6T8pz+QYROOMuUy1JNC6f6TvSmOPk2ZbSKIdLf9/Dzj9cXq+w OBCTfXve1xuve/I7aBFnPVzrNRKrN2TIZlcVCU/tMQDRS6Y4LCBBGdOkydNpX5H30IQY bZTw== X-Gm-Message-State: ANoB5pmJ7cXfXzYRgpOPjg9ZdFjdUcaIA1IVb1QlMIcJ20MmOl0C1FN8 paM/ca3uBxrJRoMky3KIQAmHz6I9xJwl9wiAmVWJsQ== X-Received: by 2002:a81:a8a:0:b0:37e:6806:a5f9 with SMTP id 132-20020a810a8a000000b0037e6806a5f9mr7018502ywk.47.1670435990183; Wed, 07 Dec 2022 09:59:50 -0800 (PST) MIME-Version: 1.0 References: <20220831133758.3741187-1-leitao@debian.org> In-Reply-To: From: Eric Dumazet Date: Wed, 7 Dec 2022 18:59:38 +0100 Message-ID: Subject: Re: [PATCH RESEND net-next] tcp: socket-specific version of WARN_ON_ONCE() To: Breno Leitao Cc: David Miller , Jakub Kicinski , netdev , leit@fb.com, Hideaki YOSHIFUJI , Paolo Abeni , David Ahern , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, Dec 7, 2022 at 6:37 PM Breno Leitao wrote: > > On Sat, Sep 03, 2022 at 09:42:43AM -0700, Eric Dumazet wrote: > > On Wed, Aug 31, 2022 at 6:38 AM Breno Leitao wrote: > > > > > > There are cases where we need information about the socket during a > > > warning, so, it could help us to find bugs that happens that do not h= ave > > > a easily repro. > > > > > > BPF congestion control algorithms can change socket state in unexpect= ed > > > ways, leading to WARNings. Additional information about the socket st= ate > > > is useful to identify the culprit. > > > > Well, this suggests we need to fix BPF side ? > > > > Not sure how this can happen, because TCP_BPF_IW has > > > > if (val <=3D 0 || tp->data_segs_out > tp->syn_data) > > ret =3D -EINVAL; > > else > > tcp_snd_cwnd_set(tp, val); > > I am not sure we are hitting this path, please check the stack below > > > It seems you already found the issue in an eBPF CC, can you share the d= etails ? > > Sure, here is an example of what we are facing (with some obfuscation). > Remeber that there are users' BPF application running: > > [155375.750105] ------------[ cut here ]------------ > [155375.759526] WARNING: CPU: 19 PID: 0 at net/ipv4/tcp.c:4552 tcp_sock_w= arn+0x6/0x20 > [155375.774700] Modules linked in: vhost_net tun vhost vhost_iotlb tap vi= rtio_net net_failover failover mpls_gso mpls_iptunnel mpls_router ip_tunnel= fou ip6_udp_tunnel udp_tunnel sch_fq sunrpc bpf_preload tls act_gact cls_b= pf tcp_diag inet_diag skx_edac nfit libnvdimm x86_pkg_temp_thermal intel_po= werclamp coretemp iTCO_wdt kvm_intel iTCO_vendor_support kvm evdev ses irqb= ypass enclosure i2c_i801 i2c_smbus ipmi_si ipmi_devintf ipmi_msghandler acp= i_cpufreq button tpm_crb sch_fq_codel fuse sg nvme mpi3mr scsi_transport_sa= s nvme_core xhci_pci xhci_hcd loop efivarfs autofs4 > [155375.874916] CPU: 19 PID: 0 Comm: swapper/19 Kdump: loaded Tainted: G = S 5.12.0-0_XXXXXXXX_g0fed6f189e14 #1 > [155375.898770] Hardware name: XXXX XXX XXXX XXXXX, BIOS BS_BIOS_XXX XX/X= X/2022 > [155375.916015] RIP: 0010:tcp_sock_warn+0x6/0x20 > [155375.924755] Code: 4d 01 3e 85 c0 0f 84 57 ff ff ff 48 8b 0c 24 44 8b = 01 eb 82 e8 eb b7 14 00 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 53 = <0f> 0b 48 85 ff 0f 85 77 70 14 00 5b c3 66 66 2e 0f 1f 84 00 00 00 > [155375.962518] RSP: 0018:ffffc90000d08988 EFLAGS: 00010246 > [155375.973157] RAX: ffff88817432b5c0 RBX: ffff88828f748000 RCX: ffffc900= 00d08a34 > [155375.987614] RDX: 0000000000000000 RSI: 00000000822be8c8 RDI: ffff8882= 8f748000 > [155376.002074] RBP: 0000000000000040 R08: ffffc90000d08a38 R09: 00000000= 822be334 > [155376.016531] R10: 0000000000000000 R11: 0000000000000001 R12: 00000000= 00000000 > [155376.030988] R13: ffffc90000d08a34 R14: 0000000000005546 R15: 00000000= 00000000 > [155376.045441] FS: 0000000000000000(0000) GS:ffff88903f8c0000(0000) knl= GS:0000000000000000 > [155376.061804] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [155376.073474] CR2: 00007fe407603080 CR3: 0000000b19993006 CR4: 00000000= 007706e0 > [155376.087928] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 00000000= 00000000 > [155376.102383] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 00000000= 00000400 > [155376.116841] PKRU: 55555554 > [155376.122427] Call Trace: > [155376.127497] > [155376.131697] tcp_fastretrans_alert+0x988/0x9e0 > [155376.140774] tcp_ack+0x8b4/0x1360 > [155376.147581] ? __cgroup_bpf_run_filter_skb+0x185/0x440 > [155376.158037] tcp_rcv_established+0x135/0x660 > [155376.166755] ? sk_filter_trim_cap+0xbc/0x220 > [155376.175472] tcp_v6_do_rcv+0xbe/0x3e0 > [155376.182974] tcp_v6_rcv+0xc01/0xc90 > [155376.190128] ip6_protocol_deliver_rcu+0xbd/0x450 > [155376.199541] ip6_input_finish+0x3d/0x60 > [155376.207388] ip6_input+0xb5/0xc0 > [155376.214019] ip6_sublist_rcv_finish+0x37/0x50 > [155376.222912] ip6_sublist_rcv+0x1dd/0x270 > [155376.230935] ipv6_list_rcv+0x113/0x140 > [155376.238618] __netif_receive_skb_list_core+0x1a0/0x210 > [155376.249080] netif_receive_skb_list_internal+0x186/0x2a0 > [155376.259887] gro_normal_list.part.171+0x19/0x40 > [155376.269137] napi_complete_done+0x65/0x150 > [155376.277514] bnxt_poll_p5+0x25b/0x2b0 > [155376.285027] ? tcp_write_xmit+0x278/0x1060 > [155376.293398] __napi_poll+0x25/0x120 > [155376.300552] net_rx_action+0x189/0x300 > [155376.308227] __do_softirq+0xbb/0x271 > [155376.315554] irq_exit_rcu+0x97/0xa0 > [155376.322710] common_interrupt+0x7f/0xa0 > [155376.330566] > [155376.334947] asm_common_interrupt+0x1e/0x40 > [155376.343499] RIP: 0010:cpuidle_enter_state+0xc2/0x340 > [155376.353619] Code: 48 89 c5 0f 1f 44 00 00 31 ff e8 f9 8d 73 ff 45 84 = ff 74 12 9c 58 f6 c4 02 0f 85 38 02 00 00 31 ff e8 b2 36 79 ff fb 45 85 f6 = <0f> 88 e8 00 00 00 49 63 d6 48 2b 2c 24 48 6b ca 68 48 8d 04 52 48 > [155376.391367] RSP: 0018:ffffc90000293e90 EFLAGS: 00000202 > [155376.402004] RAX: ffff88903f8eaa80 RBX: ffffe8ffff4c6c00 RCX: 00000000= 0000001f > [155376.416456] RDX: 00008d503c63f228 RSI: 000000005ba4b680 RDI: 00000000= 00000000 > [155376.430910] RBP: 00008d503c63f228 R08: 0000000000000002 R09: 00000000= 0002a300 > [155376.445372] R10: 002435b781e62f4a R11: ffff88903f8e9a84 R12: 00000000= 00000001 > [155376.459832] R13: ffffffff83621200 R14: 0000000000000001 R15: 00000000= 00000000 > [155376.474307] cpuidle_enter+0x29/0x40 > [155376.481654] do_idle+0x1bb/0x200 > [155376.488297] cpu_startup_entry+0x19/0x20 > [155376.496320] start_secondary+0x104/0x140 > [155376.504342] secondary_startup_64_no_verify+0xb0/0xbb > [155376.514629] ---[ end trace 9b428a0d7901c3ff ]--- > [155376.524041] TCP: Socket Info: family=3D10 state=3D1 sport=3D12345 dpo= rt=3D57616 ccname=3Dned_tcp_dctcp01 cwnd=3D1 > [155376.524045] TCP: saddr=3DXXXX:XXXX:XXXX:XXXX:XXXX:0000:00c8:0000 dadd= r=3DXXXX:XXXX:XXXX:XXXX:XXXX:0000:0288:00 Try to give us symbols with scripts/decode_stacktrace.sh , thanks. Also 5.12 is kind of old :/