From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf 2/3] netfilter: nfnetlink: relax strict multicast group from netlink_bind
Date: Mon, 5 Jan 2015 11:22:35 +0000 [thread overview]
Message-ID: <20150105112234.GA5741@acer.localdomain> (raw)
In-Reply-To: <1420455986-5800-2-git-send-email-pablo@netfilter.org>
On 05.01, Pablo Neira Ayuso wrote:
> Relax the checking that was introduced in 97840cb ("netfilter:
> nfnetlink: fix insufficient validation in nfnetlink_bind") when the
> subscription bitmask is used. Existing userspace code code may request
> to listen to all of the existing netlink groups by setting an all to one
> subscription group bitmask. Netlink already validates subscription via
> setsockopt() for us.
What is the point of doing this? I don't think its particulary
reasonable to subscribe to ~0 unless you're implementing some kind of
monitor.
We also don't know whether a bitmask or an invalid group number was
used, so the comment below is at least misleading.
And, unrelated, but since it went in via netfilter asking anyway, why
is the group number signed? That doesn't make any sense, it is treated
as unsigned everywhere else.
> diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
> index c6619d4..5082d81 100644
> --- a/net/netfilter/nfnetlink.c
> +++ b/net/netfilter/nfnetlink.c
> @@ -469,8 +469,11 @@ static int nfnetlink_bind(int group)
> const struct nfnetlink_subsystem *ss;
> int type;
>
> + /* No strict check for groups when subscription bitmask is used, group
> + * binding via setsockopt() already rejects this from netlink.
> + */
> if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX)
> - return -EINVAL;
> + return 0;
>
> type = nfnl_group2type[group];
>
> --
> 1.7.10.4
>
next prev parent reply other threads:[~2015-01-05 11:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-05 11:06 [PATCH nf 1/3] netfilter: nfnetlink: validate nfnetlink header from batch Pablo Neira Ayuso
2015-01-05 11:06 ` [PATCH nf 2/3] netfilter: nfnetlink: relax strict multicast group from netlink_bind Pablo Neira Ayuso
2015-01-05 11:22 ` Patrick McHardy [this message]
2015-01-05 11:41 ` Pablo Neira Ayuso
2015-01-05 11:43 ` Patrick McHardy
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=20150105112234.GA5741@acer.localdomain \
--to=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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).