Skip to content

Commit 4253475

Browse files
walacvvarma
authored andcommitted
netfilter: xt_sctp: validate the flag_info count
commit e994764 upstream. sctp_mt_check doesn't validate the flag_count field. An attacker can take advantage of that to trigger a OOB read and leak memory information. Add the field validation in the checkentry function. Fixes: 2e4e6a1 ("[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables") Cc: [email protected] Reported-by: Lucas Leong <[email protected]> Signed-off-by: Wander Lairson Costa <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d77df03 commit 4253475

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/xt_sctp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ static int sctp_mt_check(const struct xt_mtchk_param *par)
150150
{
151151
const struct xt_sctp_info *info = par->matchinfo;
152152

153+
if (info->flag_count > ARRAY_SIZE(info->flag_info))
154+
return -EINVAL;
153155
if (info->flags & ~XT_SCTP_VALID_FLAGS)
154156
return -EINVAL;
155157
if (info->invflags & ~XT_SCTP_VALID_FLAGS)

0 commit comments

Comments
 (0)