Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3574060pxb; Mon, 24 Jan 2022 12:33:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyr/YJfaN/1PfYRoENqhnAkPYSU4R5dzYf/DayfFH4c15odeQJawWjtFiBYBdHTwwEwJ+j X-Received: by 2002:a17:90a:5994:: with SMTP id l20mr3518118pji.121.1643056433431; Mon, 24 Jan 2022 12:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056433; cv=none; d=google.com; s=arc-20160816; b=nIyNvlO+nwAdpENDMb3GPXtK6vA1ulRgBPhekhP9BIChCrPUoTBdgFPfFyZuedb4rA ELb2lpEeUGCtqA+UDXbrJouSTY14vRJgn3IgVwlaX1jHTxCmcMWt4VX2aWQFztPJlEZH 3VNWI1cVPy3vYjZA9oLxhNIfbZhglgLhUbufOZs667Yo4jMPsMlwCxyb+2COQMXC2KBw qeuE29xd4WSdpEt+Sk/Q14hC3vjn5BwiNEW7864Rwn6vVav3gdFxqAqaokNssi5YTHpX 8h+oNlhg/QISz5qFONnr37EeUTwrtQ6zUgQnRDwXl2wqk8C4ou8ZagTrse/3ocsZoRNv ZhKQ== 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=5HWJqhTofRJaVdPHn/K4zw+3FLTTBHVEl0TCTM/ZOTA=; b=RHLEWCL4UvoXodmTV46u8O9YSvvJbPdTGkwmeKejHPq9I70y5+iCOb0qxv8bOeqkeF 5qugziAraYpFE1pUnmYVeWKmq9mvSYC8waC6WoZ0LiY3Wl8u8njBLRaBbZjzgBUaZw6Y 1tHXY1TrJQi+dSvSwwe3VhtUyHzIIaL3HgixjBptNdpB+Pz61y5UYFPBpIPdZKVFRpPz N+7bTeV5Dtemq+FTeDmJ/Zi4pahsY9XPFkZM4cBXfpV+U64p57IyTZ6fLIiTGcuHJlsy gauPfIRVgyhBJFvmJHa17xXnerIi2mmz3O84uPQU+zr+bwjVyOK38dh0dsICi27/KVJV 23DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="XyS/jJCE"; 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 x22si309652pjn.59.2022.01.24.12.33.35; Mon, 24 Jan 2022 12:33:53 -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="XyS/jJCE"; 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 S1354871AbiAXTjc (ORCPT + 99 others); Mon, 24 Jan 2022 14:39:32 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:32808 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350901AbiAXTdx (ORCPT ); Mon, 24 Jan 2022 14:33:53 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5183F61488; Mon, 24 Jan 2022 19:33:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25EB0C340E5; Mon, 24 Jan 2022 19:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052832; bh=tZM5TML74UbfSY7dpcQg47KWZMIdishfAIuWtvqaerk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XyS/jJCEXFQxvrCr/DY6Ulf9zZ+7hlFhckzP+6ORs7HzQJtOMleBApEENWrcbBDUp qCmA4W5QXFTXxJRc2QWuEGZdMTJAep/vto6FVFhlHmlAIw1p0uK+v4mIu3EdxuPKjw GWTmPQNIWfXhkEnheBuLI0cm2jgzzyvKgShtiQMI= 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.4 188/320] bpf: Do not WARN in bpf_warn_invalid_xdp_action() Date: Mon, 24 Jan 2022 19:42:52 +0100 Message-Id: <20220124184000.041545255@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 b90c0b5a10112..92ce4d46f02e4 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -6912,9 +6912,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