Skip to content

Commit e994764

Browse files
walacummakynes
authored andcommitted
netfilter: xt_sctp: validate the flag_info count
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]>
1 parent 28427f3 commit e994764

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
@@ -149,6 +149,8 @@ static int sctp_mt_check(const struct xt_mtchk_param *par)
149149
{
150150
const struct xt_sctp_info *info = par->matchinfo;
151151

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

0 commit comments

Comments
 (0)