summaryrefslogtreecommitdiff
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorJun Yang <juny24602@gmail.com>2025-03-05 18:44:10 +0300
committerJakub Kicinski <kuba@kernel.org>2025-03-07 03:35:14 +0300
commit115ef44a98220fddfab37a39a19370497cd718b9 (patch)
tree55fcb7eca14935389f64eb9ef0e8d7143536fd5d /net/switchdev/switchdev.c
parente4e832d2b9e84d1a290f0279b10593cf465e6fb1 (diff)
downloadlinux-115ef44a98220fddfab37a39a19370497cd718b9.tar.xz
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: Jun Yang <juny24602@gmail.com> Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com> Fixes: f25c0515c521 ("net: sched: gred: dynamically allocate tc_gred_qopt_offload") Link: https://patch.msgid.link/20250305154410.3505642-1-juny24602@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions