From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Vasily Averin <vvs@virtuozzo.com>
Cc: Jozsef Kadlecsik <kadlec@netfilter.org>,
Florian Westphal <fw@strlen.de>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org
Subject: Re: [PATCH] netfilter: ipset: fixes possible oops in mtype_resize
Date: Thu, 17 Dec 2020 19:44:18 +0100 [thread overview]
Message-ID: <20201217184418.GC17365@salvia> (raw)
In-Reply-To: <bfeee41d-65f0-40b2-1139-b888627e34ef@virtuozzo.com>
On Thu, Dec 17, 2020 at 11:53:40AM +0300, Vasily Averin wrote:
> currently mtype_resize() can cause oops
>
> t = ip_set_alloc(htable_size(htable_bits));
> if (!t) {
> ret = -ENOMEM;
> goto out;
> }
> t->hregion = ip_set_alloc(ahash_sizeof_regions(htable_bits));
>
> Increased htable_bits can force htable_size() to return 0.
> In own turn ip_set_alloc(0) returns not 0 but ZERO_SIZE_PTR,
> so follwoing access to t->hregion should trigger an OOPS.
Applied, thanks.
prev parent reply other threads:[~2020-12-17 18:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-17 8:53 [PATCH] netfilter: ipset: fixes possible oops in mtype_resize Vasily Averin
2020-12-17 17:12 ` Jozsef Kadlecsik
2020-12-17 18:44 ` Pablo Neira Ayuso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201217184418.GC17365@salvia \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=vvs@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).