mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 12:26:11 +00:00
netfilter: xt_sctp: validate the flag_info count
commite994764976
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:2e4e6a17af
("[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables") Cc: stable@vger.kernel.org Reported-by: Lucas Leong <wmliang@infosec.exchange> Signed-off-by: Wander Lairson Costa <wander@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
83b995321e
commit
b63b4e1145
1 changed files with 2 additions and 0 deletions
|
@ -149,6 +149,8 @@ static int sctp_mt_check(const struct xt_mtchk_param *par)
|
||||||
{
|
{
|
||||||
const struct xt_sctp_info *info = par->matchinfo;
|
const struct xt_sctp_info *info = par->matchinfo;
|
||||||
|
|
||||||
|
if (info->flag_count > ARRAY_SIZE(info->flag_info))
|
||||||
|
return -EINVAL;
|
||||||
if (info->flags & ~XT_SCTP_VALID_FLAGS)
|
if (info->flags & ~XT_SCTP_VALID_FLAGS)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (info->invflags & ~XT_SCTP_VALID_FLAGS)
|
if (info->invflags & ~XT_SCTP_VALID_FLAGS)
|
||||||
|
|
Loading…
Reference in a new issue