Skip to content

Commit e6e3eb5

Browse files
echelonhkuba-moo
authored andcommitted
net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak
When building netlink messages, tc_chain_fill_node() never initializes the tcm_info field of struct tcmsg. Since the allocation is not zeroed, kernel heap memory is leaked to userspace through this 4-byte field. The fix simply zeroes tcm_info alongside the other fields that are already initialized. Fixes: 32a4f5e ("net: sched: introduce chain object to uapi") Signed-off-by: Yochai Eisenrich <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ddc748a commit e6e3eb5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/sched/cls_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2969,6 +2969,7 @@ static int tc_chain_fill_node(const struct tcf_proto_ops *tmplt_ops,
29692969
tcm->tcm__pad1 = 0;
29702970
tcm->tcm__pad2 = 0;
29712971
tcm->tcm_handle = 0;
2972+
tcm->tcm_info = 0;
29722973
if (block->q) {
29732974
tcm->tcm_ifindex = qdisc_dev(block->q)->ifindex;
29742975
tcm->tcm_parent = block->q->handle;

0 commit comments

Comments
 (0)