Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3973943pxb; Tue, 25 Jan 2022 00:22:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvgN7OaO2Tb8ZZAuFi2u//6NXGy/4gN/wTjO1SPn3m7m+alHKjHBjhNOKr8l5KJudWlayC X-Received: by 2002:aa7:d547:: with SMTP id u7mr19267560edr.76.1643098943998; Tue, 25 Jan 2022 00:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098943; cv=none; d=google.com; s=arc-20160816; b=q1gkiIxZoFDIOdfZwvw4xm7fpXiAjOw+oaq5MxNNOFodl6m4MvZkMGCt57UC5eMlpt XDdA4ZAwF272ejxSOHLd9LBwzRtTy2fqZ/U3PdcEr8SQXjssFs5W06u/x9PGrQnyy4Nd q32L/KEx/TdGcpoXPm+6gRbM7jxsQD+ZDNIHaTZhQaUC6s0q0acnvoOqY4ax1KGr6SlA PG2/fH0rBiilyJRyuWVUFHPIXR+j24XXkq11wyz9E0bHxzonzNtMue3J6c8tPOf8a9fG XgKJvErb25FpmRLP+LhCdBy3UVaniOOoOdOy9l+yJhGVE62iRtNJB6dKv+MyFolvylHK Sz+A== 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=rBTVXdICkXz8C/f3ajh3jPncIeRbsFQhc1rnLpOlycU=; b=wh88etUmrmhXoQOxJ/3xsgSdhE4D1KzVdi+qXTQCtkJ6bVURzoTJMCMLHU9GdfZNw8 nSSue8Fv8z0s1/IYfOjIcme9KoyKgnmkdU45zIYTe/YPOph/ppU93/EaKhSiOxhpwGBe dQ8Kz8qIFLTDF2+LLCUQRAjRXk+1Hroq21s/j4hJVY+wl8ubqFOZrCROJYSYJxvnOC4n TShX+HRjMbj9msxqwAgxQ9Aqgs9J4NWG1tfDwJrfvNr73qnTRLYYI+VGR4Hstabik/Ti XrdV2fnFzKJXCkWD5Zg2EmDkc8auiaz5lVN5pyjIVweMOhZhFqD2UtOIuvxvW3L0q+qa Gd/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=niA8N7BQ; 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 ne13si2270024ejc.856.2022.01.25.00.21.59; Tue, 25 Jan 2022 00:22:23 -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=niA8N7BQ; 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 S3420818AbiAYCZb (ORCPT + 99 others); Mon, 24 Jan 2022 21:25:31 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:45064 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349705AbiAXTVL (ORCPT ); Mon, 24 Jan 2022 14:21: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 F3816B8122A; Mon, 24 Jan 2022 19:21:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BC4BC340E5; Mon, 24 Jan 2022 19:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052068; bh=xAngeKfXCJtF/25f0h8+pSD9XBwTu6oIqZSVUBcS/cQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=niA8N7BQLwbTJGLj7bXdajUNzarX3hE1WdnR7o04nVVZMwQZEWZi4RN+QnX+gpZlI k/g9P4fBrVNOfD6uq1jZj1OosUJkH5g+nUk/JRpJ1u2o9t7P7pqa86A+6gD9Y7DT/I Xhn/+SZiZy/4544jUpsXN1w5K54D1eW76+X77sQk= 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 4.19 146/239] bpf: Do not WARN in bpf_warn_invalid_xdp_action() Date: Mon, 24 Jan 2022 19:43:04 +0100 Message-Id: <20220124183947.737950237@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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 01496c7cb42d7..7d68c98a00aa8 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -5534,9 +5534,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