Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3608426pxb; Mon, 24 Jan 2022 13:25:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2w7OovWmQRDp7aG/YoWCG4BC/ZF6NDBxN57hMhHE88xtJzZSZ4RyFY4PtPsM6sLosc0fy X-Received: by 2002:a17:903:11d1:b0:149:57d1:acc6 with SMTP id q17-20020a17090311d100b0014957d1acc6mr15742827plh.134.1643059527432; Mon, 24 Jan 2022 13:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059527; cv=none; d=google.com; s=arc-20160816; b=f8TZuO8wAqiqQaIxn9JEgxO4kJPlBBzfEjbmL6H0FxtglqKfNq1WIslzgU9d77WuS9 AZfWTdQ1IeavhpbH09IWQPY2HtARqIM8nuMaMVYmCsLQUbiRkeUANk71db5cb2ldjtKR caySxzkWxoUM46KIzB9j5ypxsFpurov12AReRMm5KRdJ7NRzvlHsuHezWeRLFgik7e3Q 6O0pX8lAPvSfjmuGS0beuYQL2xBgCJg9PJU86SvjmPOw2D3ibYntBbs/kUvD0YoLzGct IdcgdXuMw+cUg6ALzAbIFBaG7OcQeIaGwYYuheDYmy5xVjzOAN3y3S3ZZrO48MBE+rE3 qkiA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1Q7dFxSpj9sfV+BeEv7Et7VNt6vhm5g4Gr8RyWQBumU=; b=KsTui94Zu+JgWuamyhVMHOIYnh7ILmDFMfwRQRLhI25/Taous96si1tl1/r2PcZ/lN cREZM9R/xYheYc+ODokeHHgka097kFe5rW7xs18AgLiemJfOQdpJtTTruUwM6zotyssM U8R90kjrxjrOIQYKDurp8NeRrLGPUx0PrASZEPkLYlVnV7m5tzMJ8Ll1qcopmYJ4QbvS x4/tNfhoc0VEiiWaH8EE+SQIWrSjNVBxDndZi2B7L0PVuFoTFNMg3UhrGC1VQ+s+lmkW pvxnQ7tunOamN/PIRaGaHUs3vZsO5olwczrHJfORTTEaJO0T5yFCYjQ/iHuYNKBIT8Ve iOQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bL2f1et+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q84si14598939pgq.500.2022.01.24.13.25.11; Mon, 24 Jan 2022 13:25:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bL2f1et+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444706AbiAXVBT (ORCPT + 99 others); Mon, 24 Jan 2022 16:01:19 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:40228 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387730AbiAXUhL (ORCPT ); Mon, 24 Jan 2022 15:37:11 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F0E55B80CCF; Mon, 24 Jan 2022 20:37:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BDA9C340E5; Mon, 24 Jan 2022 20:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056628; bh=7qiHpWY6b91yG9hop6KulGGHHBXmIN0F62hQVZYDCn0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bL2f1et+PYdwJE2Z9NpGcNwwZCdmHSMbuzSDnja3HkNN+75p9J/g30/1wXmwdbEG5 Qx2qu9wuVvPvWa/v+Cs2DGaH9yUxgHavarHMnL7qQt3gtmaylfJrM/SWcuXkxetDIN arZBK2sCgEM+ml4EG+jhOJcdgxeF01ZO0nPdlbCM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , Daniel Borkmann , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Sasha Levin Subject: [PATCH 5.15 548/846] bpf: Do not WARN in bpf_warn_invalid_xdp_action() Date: Mon, 24 Jan 2022 19:41:05 +0100 Message-Id: <20220124184119.924004304@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Abeni [ Upstream commit 2cbad989033bff0256675c38f96f5faab852af4b ] The WARN_ONCE() in bpf_warn_invalid_xdp_action() can be triggered by any bugged program, and even attaching a correct program to a NIC not supporting the given action. The resulting splat, beyond polluting the logs, fouls automated tools: e.g. a syzkaller reproducers using an XDP program returning an unsupported action will never pass validation. Replace the WARN_ONCE with a less intrusive pr_warn_once(). Signed-off-by: Paolo Abeni Signed-off-by: Daniel Borkmann Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/016ceec56e4817ebb2a9e35ce794d5c917df572c.1638189075.git.pabeni@redhat.com Signed-off-by: Sasha Levin --- net/core/filter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 1e43ab413b62e..f207e4782bd0e 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -8178,9 +8178,9 @@ void bpf_warn_invalid_xdp_action(u32 act) { const u32 act_max = XDP_REDIRECT; - WARN_ONCE(1, "%s XDP return value %u, expect packet loss!\n", - act > act_max ? "Illegal" : "Driver unsupported", - act); + pr_warn_once("%s XDP return value %u, expect packet loss!\n", + act > act_max ? "Illegal" : "Driver unsupported", + act); } EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action); -- 2.34.1