Commit 1285d477 authored by Florian Westphal's avatar Florian Westphal Committed by Zheng Zengkai
Browse files

netfilter: x_tables: fix compat match/target pad out-of-bound write



stable inclusion
from stable-5.10.31
commit 1f3b9000cb44318b0de40a0f495a5a708cd9be6e
bugzilla: 51792

--------------------------------

commit b29c457a upstream.

xt_compat_match/target_from_user doesn't check that zeroing the area
to start of next rule won't write past end of allocated ruleset blob.

Remove this code and zero the entire blob beforehand.

Reported-by: default avatar <syzbot+cfc0247ac173f597aaaa@syzkaller.appspotmail.com>
Reported-by: default avatarAndy Nguyen <theflow@google.com>
Fixes: 9fa492cd ("[NETFILTER]: x_tables: simplify compat API")
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatar  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent a427cc17
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment