Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6816463rwb; Tue, 15 Nov 2022 04:13:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wCYUtibcizwcwZZD/Ha5cxXKtxC3bNPy1OP9Y19QjgG9jrq67EiyW/JnQsJVESPyj+hrK X-Received: by 2002:a17:902:7b8c:b0:183:7f67:25d7 with SMTP id w12-20020a1709027b8c00b001837f6725d7mr3640290pll.164.1668514389449; Tue, 15 Nov 2022 04:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668514389; cv=none; d=google.com; s=arc-20160816; b=RCbB98nYz1tv6mvuiyIhY0Lfwj6k3X21cAIzlsPNUlQsEkWcCpYf7qIbK/7itEtz66 TWCIfa6SLU2wUSXBQzyZG1Y+tqB3Jf9aFZmL8PK7oaVOKTha4nJi+HDrEbB7sjIQTW+D odscC9/9kZ1c9XO+zPX/ARp//fBJ8aRyxeHcFQVxG6OMWTZXJXIheCVjywqPhhaTYGR1 xcf9QbwtDMTyrs943QQ9L551U8w6040OzgarUH7FKeHLiw4pvH8UZ3VnOWAW8vDbV7tO A+3lqgQILiaWauNyFkwThB/3rywLBm6MZfJRTTSlZWQRiHOrIx4f/UCrg1gnUDA+4DUh BWUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=YiLRB+no6Obv7jh7c1l04K32ySwQNOr1SFbZK57JYcE=; b=AZVtlOcpBO+/DSMAbAFwzWCI1E0q/B0/uILJfSg29c+TzcxPeVi98wTiK4kSxd3ZAn NWrfSa9zIREzEnyiPrmZidDBbPBZ4VXvzg3AaBdvnYQQhddzsjW0JfBqXd5rh9+0/3Ch Xg78qZ/4Sugcheu854hdmaYRj7/iIz1xipN90UWSNnEXWgSyYpx79uzU4Vjy4nxefVCH p/JBY2fiNLoMvk9/EwvEFT0UBeBn/lPdRrjBVUT24v1x5F9BUddoPFQ6Mx2D9vRdnH9f JkEKxle91d5OVcFVFbCZZsMW1g22rCP0TtkUXXEufoSWeKUhvsZCoyBtNrjkTSSSIpCV S+VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=Iud274mE; 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=tessares.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk12-20020a17090b33cc00b00202c850b5a8si20618629pjb.11.2022.11.15.04.12.53; Tue, 15 Nov 2022 04:13:09 -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=@tessares.net header.s=google header.b=Iud274mE; 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=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiKOLhh (ORCPT + 90 others); Tue, 15 Nov 2022 06:37:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbiKOLhf (ORCPT ); Tue, 15 Nov 2022 06:37:35 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEFA17656 for ; Tue, 15 Nov 2022 03:37:32 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id cl5so23756511wrb.9 for ; Tue, 15 Nov 2022 03:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YiLRB+no6Obv7jh7c1l04K32ySwQNOr1SFbZK57JYcE=; b=Iud274mEKb6gZLmUkIMS0HEBSJoqBMdOKEfk8qwd2MtJLczLjJRzoaL8507alqoL3D Ov+cYEcS0L3k3LmCx17JcRv/B0ThjUgCbfaVyFM4lj77nww8ID8Ub2JJEDSRF43PDVYm GUPab/bDvGz/S+KHx2O9YWpKHqF/3mmrIzJydxoJW3zQmciG7vttQrlhepL07+p8+iHr q+k6sgMxuo+ajcoNjwpOwEMi0wL3CqwP8zTBTZ3oh5PH1l2wxHZwcP5QMoaCGP3t4HpB m67QPaxcrGiGeb3aEyZ4QVK4Fv7XfllRt14Nm1YzBk9ydpIXMzvX5LNDhOCmfBb28fYX EzkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YiLRB+no6Obv7jh7c1l04K32ySwQNOr1SFbZK57JYcE=; b=TkX1nG2JbBLtkuQn4HLPGe3Pcxb+KG3D/Aj/J1fCDrHs/LVBAnLMLR3biIkGSS+hW4 Qel6vBcHaDntI6/RTOzO7c2G/oUIjPixyaa7K+R++b6K9K1TGLVJnNgprmnVAXoQr5Lx GxZqG2i84emVRFUVRXCzvqtbIESoHxtPiQK9ikr52tll9wCEMFMt+fozpWC63eGZ2lWz 5NwhHV5YqksNu27QD3gND7/Z8gTddjMdftUfLEUSh53gW/b0L4ecVN2KPIehTBEdQbyl Rw8+psD7KbvvhYtjK+D4dlk2uBYB9am1WnAHGL+tdjNtjrPWouJCDz2Zoc1d1DZ5qp3W vtPA== X-Gm-Message-State: ANoB5plQSmKPO/b8dVDV5ucpR/os8yMZlCMODLg2q45R7aCLYeGDQmxw m6j7NkSsscCJMTN9I+kmPiqdqQ== X-Received: by 2002:a5d:49c9:0:b0:236:73fa:c56e with SMTP id t9-20020a5d49c9000000b0023673fac56emr10351544wrs.432.1668512251354; Tue, 15 Nov 2022 03:37:31 -0800 (PST) Received: from ?IPV6:2a02:578:8593:1200:765b:95ed:f124:a78a? ([2a02:578:8593:1200:765b:95ed:f124:a78a]) by smtp.gmail.com with ESMTPSA id u12-20020adfdb8c000000b002417ed67bfdsm9112478wri.5.2022.11.15.03.37.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 03:37:30 -0800 (PST) Message-ID: Date: Tue, 15 Nov 2022 12:37:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH net-next] tcp: Fix tcp_syn_flood_action() if CONFIG_IPV6=n Content-Language: en-GB To: Geert Uytterhoeven , Jamie Bainbridge , Eric Dumazet , "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Paolo Abeni , Chris Down , Stephen Hemminger Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Matthieu Baerts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Hi Geert, On 15/11/2022 11:12, Geert Uytterhoeven wrote: > If CONFIG_IPV6=n: > > net/ipv4/tcp_input.c: In function ‘tcp_syn_flood_action’: > include/net/sock.h:387:37: error: ‘const struct sock_common’ has no member named ‘skc_v6_rcv_saddr’; did you mean ‘skc_rcv_saddr’? > 387 | #define sk_v6_rcv_saddr __sk_common.skc_v6_rcv_saddr > | ^~~~~~~~~~~~~~~~ > include/linux/printk.h:429:19: note: in definition of macro ‘printk_index_wrap’ > 429 | _p_func(_fmt, ##__VA_ARGS__); \ > | ^~~~~~~~~~~ > include/linux/printk.h:530:2: note: in expansion of macro ‘printk’ > 530 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > | ^~~~~~ > include/linux/net.h:272:3: note: in expansion of macro ‘pr_info’ > 272 | function(__VA_ARGS__); \ > | ^~~~~~~~ > include/linux/net.h:288:2: note: in expansion of macro ‘net_ratelimited_function’ > 288 | net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__) > | ^~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/net.h:288:43: note: in expansion of macro ‘sk_v6_rcv_saddr’ > 288 | net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__) > | ^~~~~~~~~~~ > net/ipv4/tcp_input.c:6847:4: note: in expansion of macro ‘net_info_ratelimited’ > 6847 | net_info_ratelimited("%s: Possible SYN flooding on port [%pI6c]:%u. %s.\n", > | ^~~~~~~~~~~~~~~~~~~~ > > Fix this by using "#if" instead of "if", like is done for all other > checks for CONFIG_IPV6. Thank you for the patch! Our CI validating MPTCP also found the issue. I was going to suggest a similar one before I saw yours :) Everything is fixed on my side after having applied the patch! Tested-by: Matthieu Baerts > Fixes: d9282e48c6088105 ("tcp: Add listening address to SYN flood message") > Signed-off-by: Geert Uytterhoeven > --- > net/ipv4/tcp_input.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > index 94024fdc2da1b28a..e5d7a33fac6666bb 100644 > --- a/net/ipv4/tcp_input.c > +++ b/net/ipv4/tcp_input.c > @@ -6843,11 +6843,14 @@ static bool tcp_syn_flood_action(const struct sock *sk, const char *proto) > > if (!queue->synflood_warned && syncookies != 2 && > xchg(&queue->synflood_warned, 1) == 0) { > - if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) { > +#if IS_ENABLED(CONFIG_IPV6) > + if (sk->sk_family == AF_INET6) { > net_info_ratelimited("%s: Possible SYN flooding on port [%pI6c]:%u. %s.\n", > proto, &sk->sk_v6_rcv_saddr, > sk->sk_num, msg); > - } else { > + } else > +#endif > + { I was going to suggest to remove the unneeded braces here and just before + eventually fix the indentation under net_info_ratelimited() while at it but that's just some details not directly linked to the fix here. Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net