mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
bpf: Do not WARN in bpf_warn_invalid_xdp_action()
[ Upstream commit 2cbad98903
]
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>
This commit is contained in:
parent
0e8805f73b
commit
59f0363346
1 changed files with 3 additions and 3 deletions
|
@ -7921,9 +7921,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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue