Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3646215pxb; Mon, 24 Jan 2022 14:19:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRUh+Nw4UHHUwMKJMlMAHYiXHxmKg884nLYC89mrVD0ZmT7uUwPwq2+5RAjHpiu0Mku8Nf X-Received: by 2002:a17:90b:93:: with SMTP id bb19mr409193pjb.49.1643062754904; Mon, 24 Jan 2022 14:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062754; cv=none; d=google.com; s=arc-20160816; b=StWi15/rX50eBp1/Y8JD9Iyd4Fb8V2zesh0Ikv/UC/4hpvKEUhiPxCZAxIFjQPjA30 22rhM8lLHYS2IQJlpCW3cEz9/xmeasGF7IotxwsjMueMSUOuWDot0NRRoarWLS1SbNfc /v6hipjfQ5fkE5FjMWcx5qRjL4dz1pyH2e2l6+GEP1Ypjkr3glLdpFdsi5PAGt2dIsL0 Yd1qDhlWSuNI5MHjhElMSvznr7rKQqcKe0F+eYPCag5i8yjH0GxYfTkoWXrX0FGyTohg VX0MmIMGWMLMjFCp1gxfPPf0MgmKoqP0rpF9YfrIclxl2NigqSzBenTcV2X5A21nZLXK 3HOw== 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=qSuUsjCdzFbI2hh7OBwODzeDXROhuFazgcZC1VxM694=; b=hbaX1Q/NIR2+UK/C+dhoBslZQB5Qwq7hdhKSXHu8Mi8zXtvAZ1N+VSLabrxxUvYcKA 0yABrYTZC7fu18d1vSNsRnfQzOp1JcON/q/bRONpIO/MJCcyXhlIPxGXZ3/gi0STvfto A4dGThPQ/Pkihw8aFPZd1eFXslz14rLqPcNR+CtneCK7kf0l8E/Olww/rOwmgOSw11w8 pXjVOtXMeS0GtmK1f+Dsr0cSv+MyGhFaDv+qrXDcl5E8UQGv4KBLJ2h+KHr8lDu4vt0T XlZv5Zn6mQaAxGT8l7k7lww2lFDxb5/eWL+f6VcC9ouVnklNwzjJKuCF+VLGbFgc+hfv ZWeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GLt7FMPR; 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 127si13863866pgc.257.2022.01.24.14.18.38; Mon, 24 Jan 2022 14:19:14 -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=GLt7FMPR; 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 S1581296AbiAXWLd (ORCPT + 99 others); Mon, 24 Jan 2022 17:11:33 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:40482 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452459AbiAXVZi (ORCPT ); Mon, 24 Jan 2022 16:25:38 -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 CA0C4B80FA1; Mon, 24 Jan 2022 21:25:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05E27C340E4; Mon, 24 Jan 2022 21:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059536; bh=61ceIHMJ+OldHwRLEtoYGl3BHB03bL4y4xAgQX2DcGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GLt7FMPRLJxVIECqaURW+ixqSPkloWoGB5Fmgdq6V0JowATSo4PA8p1B4As/DPF9j eAiaSxDxS6yRd3YzUdNNBx8nPpzdwXiQ4IeY2SNm8dFF5EXyxUHRFtq4fDDcR2+GYF tbdKs8nu4LETlRP37aV6BhCn5eBQvKNHxTMN2SiY= 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.16 0647/1039] bpf: Do not WARN in bpf_warn_invalid_xdp_action() Date: Mon, 24 Jan 2022 19:40:36 +0100 Message-Id: <20220124184147.096194625@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 31147a4cfab30..5b82a817f65a6 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -8187,9 +8187,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