]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mctp: Handle error of rtnl_register_module().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 8 Oct 2024 18:47:35 +0000 (11:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:57 +0000 (15:11 +0200)
commitc9abdd07f52f0900e55a81a52b23292c6c0e1c0a
treed3396163e051a86b7934039d008badb0356db764
parent947acd1b09b04e1b1df4f6dce9d315941204f7b3
mctp: Handle error of rtnl_register_module().

[ Upstream commit d51705614f668254cc5def7490df76f9680b4659 ]

Since introduced, mctp has been ignoring the returned value of
rtnl_register_module(), which could fail silently.

Handling the error allows users to view a module as an all-or-nothing
thing in terms of the rtnetlink functionality.  This prevents syzkaller
from reporting spurious errors from its tests, where OOM often occurs
and module is automatically loaded.

Let's handle the errors by rtnl_register_many().

Fixes: 583be982d934 ("mctp: Add device handling and netlink interface")
Fixes: 831119f88781 ("mctp: Add neighbour netlink interface")
Fixes: 06d2f4c583a7 ("mctp: Add netlink route management")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/mctp.h
net/mctp/af_mctp.c
net/mctp/device.c
net/mctp/neigh.c
net/mctp/route.c