lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Jul 2020 09:41:18 +0200
From:   Daniel Lezcano <>
Cc:, Jakub Kicinski <>,
        Jiri Pirko <>,
        Cong Wang <>,
        Johannes Berg <>,
        Michal Kubecek <>, (open list:NETWORKING [GENERAL]), (open list)
Subject: [PATCH] net: genetlink: Move initialization to core_initcall

The generic netlink is initialized far after the netlink protocol
itself at subsys_initcall. The devlink is initialized at the same
level, but after, as shown by a disassembly of the vmlinux:

[ ... ]
374 ffff8000115f22c0 <__initcall_devlink_init4>:
375 ffff8000115f22c4 <__initcall_genl_init4>:
[ ... ]

The function devlink_init() calls genl_register_family() before the
generic netlink subsystem is initialized.

As the generic netlink initcall level is set since 2005, it seems that
was not a problem, but now we have the thermal framework initialized
at the core_initcall level which creates the generic netlink family
and sends a notification which leads to a subtle memory corruption
only detectable when the CONFIG_INIT_ON_ALLOC_DEFAULT_ON option is set
with the earlycon at init time.

The thermal framework needs to be initialized early in order to begin
the mitigation as soon as possible. Moving it to postcore_initcall is

This patch changes the initialization level for the generic netlink
family to the core_initcall and comes after the netlink protocol

Signed-off-by: Daniel Lezcano <>
 net/netlink/genetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 55ee680e9db1..36b8a1909826 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -1263,7 +1263,7 @@ static int __init genl_init(void)
 	panic("GENL: Cannot register controller: %d\n", err);
 static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
 			 gfp_t flags)

Powered by blists - more mailing lists