diff options
| author | Paolo Abeni <pabeni@redhat.com> | 2021-11-30 11:08:06 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-27 09:04:25 +0100 |
| commit | f6d5eb174ee9b9ca4911b98f243f149fbfd19a43 (patch) | |
| tree | 0e6a81ce4f12d5b0c8ea61c34eb6f1e2bfe0c7bf /net | |
| parent | 4cca06db20796f60ad83943b80664ef0d652dcac (diff) | |
| download | linux-f6d5eb174ee9b9ca4911b98f243f149fbfd19a43.tar.gz linux-f6d5eb174ee9b9ca4911b98f243f149fbfd19a43.tar.bz2 linux-f6d5eb174ee9b9ca4911b98f243f149fbfd19a43.zip | |
bpf: Do not WARN in bpf_warn_invalid_xdp_action()
[ 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 <pabeni@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/016ceec56e4817ebb2a9e35ce794d5c917df572c.1638189075.git.pabeni@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
| -rw-r--r-- | net/core/filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 01496c7cb42d..7d68c98a00aa 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); |
