Skip to content
Commit 115ef44a authored by Jun Yang's avatar Jun Yang Committed by Jakub Kicinski
Browse files

sched: address a potential NULL pointer dereference in the GRED scheduler.



If kzalloc in gred_init returns a NULL pointer, the code follows the
error handling path, invoking gred_destroy. This, in turn, calls
gred_offload, where memset could receive a NULL pointer as input,
potentially leading to a kernel crash.

When table->opt is NULL in gred_init(), gred_change_table_def()
is not called yet, so it is not necessary to call ->ndo_setup_tc()
in gred_offload().

Signed-off-by: default avatarJun Yang <juny24602@gmail.com>
Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Fixes: f25c0515 ("net: sched: gred: dynamically allocate tc_gred_qopt_offload")
Link: https://patch.msgid.link/20250305154410.3505642-1-juny24602@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e4e832d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment