Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4690680rwb; Tue, 20 Sep 2022 18:47:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6FqefKSzpmZJzhAjO632oVKnZ3ILjF9vBiiPoztqWIlGM7BoxRCqZtXn8WdBUC4Bd5NxwK X-Received: by 2002:a05:6402:847:b0:453:943b:bf4 with SMTP id b7-20020a056402084700b00453943b0bf4mr17851130edz.301.1663724861838; Tue, 20 Sep 2022 18:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663724861; cv=none; d=google.com; s=arc-20160816; b=hZxa1CwBA8VSckk0xiMgDeYiswPKX1R75QmE8wo9f3xj8NtlEf9jKO5TMPr/dA/TWS BT2dU0pzqSa5T42u1tlbMMnYpmjaZsFhWepJItiAXwrFcjIgNOfElsBtqDnpczcKoh/V gfNeoC1+ZbCs8pYlzAcAjz6bH4nmGiL0DILWRdEXrhnZOEbpirvc6/R4rY5fJOkTQlee R80yOC2TeCfLBROGnrOnIWvo+zf5NUNEeS4K/kFUpcGdv3780bK3B2PS9ydTQ95QuFVw DQdCC6/Lq5wCA6CtB17noRgR8HzXVbfmorVoSijBxvULfyp0Zj8lip1b2zzeW9l9CrOG Mtmg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2a9zfDnHDp8v+TWqoFXXlEJw2dZ6+6f8B99krfO7sq8=; b=YD/1FxkVtuUhfcPDdB2ZkNO1zNgyQ00UjD9u/vQVLj1rtiYG0IsFNq4WhnZciEZBIU znwbtEmKAEoZkl4tTQOHTIoviqMgBAuAcCeGTkfjlvaprysDtgHeEjVzKI2J1bbwtsfR iYEOvni/Z0cgvVYh2s3l/MsC9e8HTCKcK8S9yMUMliDV//RFwnF3GE2z2JGzz/N7BbdD efVjpTwrcZCdlK6Lv+3GjVqNn7DTfscIGgGObqMkuX2Mh2o6PFWZ/pVtBVVnDnbaDMea UcpOVkPh/QSzjCiMeODPo0aoj1yzelRJa19zRKYpOEmuLuXqrRzP2uofmJ6bA1/saG/D J23A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TFasKd16; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s29-20020a508d1d000000b004480d6fefe4si1242807eds.239.2022.09.20.18.47.16; Tue, 20 Sep 2022 18:47:41 -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=@gmail.com header.s=20210112 header.b=TFasKd16; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbiIUA7g (ORCPT + 99 others); Tue, 20 Sep 2022 20:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbiIUA7e (ORCPT ); Tue, 20 Sep 2022 20:59:34 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52670F27; Tue, 20 Sep 2022 17:59:31 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id w2so3091963qtv.9; Tue, 20 Sep 2022 17:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=2a9zfDnHDp8v+TWqoFXXlEJw2dZ6+6f8B99krfO7sq8=; b=TFasKd16JpFp1SAV6lXBv66eyOBM6wkBRUYFyvh05hEurroqxrpJAmcpqVP3CZLMAV /vstiufhLPxzWjvEDufT7BGN8tY22O599KiKtph1SGnPUJ1Sp1s4o0oSFRfyVrGqneBe j60mH8nlktDoYXOZ1HdJWRNTzhNDLLfb0rrJMor/wCNHY7lroyikSBHLS+nFOElQzh5h ljT3Ttf61IChxdHJO5gYhWVAwP5+yTpn6T6NQbWeZ2lOqZTn//SQEiDPCGkbOa1kzEc9 UBJ82Zz4i2/6A93NdcFEwX9hNAa1AePe9EYlvL7Hl2t4RuUQTho4uSxw48SgI85CosTk wzFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=2a9zfDnHDp8v+TWqoFXXlEJw2dZ6+6f8B99krfO7sq8=; b=fpu+Gah7IN4JXoDYqgmhZYU26sOQx3449QCEXEJy71eg5dVdoTYdFauMrcWm8U3aMi D6paL1w4WOrOf/sT5dXUxSZpthtSbR7UPihIUQn0mwPI8WoWrnOLT+4Dn9ncDT4YIqeG ygVg3tOdw5wLA3ExqkvlvAGgHje3zz3/JcR6fGAvxcM3hXZhgS+gLv5kbovIcL8UmRSn tR5Go2Nl85UNOWL5cb4N4/6gAyTq7ND14Yckk/lxNjISOpABetsLVm3rePPEQOQRE7yO 1HlSirxF9A6DOxeOurWPCk/odzRBUYybMidoR0kO40IxLSLPLxhqZFS87LqtwjarPMDL bV7w== X-Gm-Message-State: ACrzQf3di/kOM2/wgKGR8e3OGzA4gC2YLdLCbYxoF18ztLiljpm8UrHT SfgjvrzNfNQBo+e+Nf2DdA== X-Received: by 2002:ac8:4e8f:0:b0:35c:f42e:5a64 with SMTP id 15-20020ac84e8f000000b0035cf42e5a64mr7677441qtp.680.1663721970305; Tue, 20 Sep 2022 17:59:30 -0700 (PDT) Received: from bytedance.attlocal.net (ec2-3-231-65-244.compute-1.amazonaws.com. [3.231.65.244]) by smtp.gmail.com with ESMTPSA id l15-20020ac8148f000000b0034456277e3asm627748qtj.89.2022.09.20.17.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 17:59:29 -0700 (PDT) From: Peilin Ye To: Eric Dumazet , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Paolo Abeni Cc: Peilin Ye , Cong Wang , Kuniyuki Iwashima , Alexei Starovoitov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Peilin Ye Subject: [PATCH net] udp: Use WARN_ON_ONCE() in udp_read_skb() Date: Tue, 20 Sep 2022 17:59:15 -0700 Message-Id: <20220921005915.2697-1-yepeilin.cs@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 From: Peilin Ye Prevent udp_read_skb() from flooding the syslog. Suggested-by: Jakub Sitnicki Signed-off-by: Peilin Ye --- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index cd72158e953a..560d9eadeaa5 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1821,7 +1821,7 @@ int udp_read_skb(struct sock *sk, skb_read_actor_t recv_actor) continue; } - WARN_ON(!skb_set_owner_sk_safe(skb, sk)); + WARN_ON_ONCE(!skb_set_owner_sk_safe(skb, sk)); used = recv_actor(sk, skb); if (used <= 0) { if (!copied) -- 2.20.1