Florian Westphal 133fd41eb2 netfilter: x_tables: fix compat match/target pad out-of-bound write
stable inclusion
from linux-4.19.188
commit 12ec80252edefff00809d473a47e5f89c7485499
category: bugfix
issue: #I42HLL
CVE: CVE-2021-22555

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

commit b29c457a6511435960115c0f548c4360d5f4801d 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: syzbot+cfc0247ac173f597aaaa@syzkaller.appspotmail.com
Reported-by: Andy Nguyen <theflow@google.com>
Fixes: 9fa492cdc160c ("[NETFILTER]: x_tables: simplify compat API")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Yu Changchun <yuchangchun1@huawei.com>
2021-08-03 10:05:37 +08:00
..
2018-05-16 07:24:30 +02:00
2018-04-23 10:21:24 -04:00
2020-10-29 09:54:58 +01:00
2019-04-17 08:38:41 +02:00
2018-02-28 11:43:28 -05:00