From: Jarek Poplawski <jarkao2@gmail.com>
To: Alessandro Suardi <alessandro.suardi@gmail.com>
Cc: Jan Engelhardt <jengelh@medozas.de>, jamal <hadi@cyberus.ca>,
David Miller <davem@davemloft.net>,
pablo@netfilter.org, arthur.marsh@internode.on.net,
eric.dumazet@gmail.com, netdev@vger.kernel.org
Subject: Re: inbound connection problems when "netlink: test for all flags of the NLM_F_DUMP composite" commit applied
Date: Tue, 18 Jan 2011 21:07:16 +0100 [thread overview]
Message-ID: <20110118200716.GA4288@del.dom.local> (raw)
In-Reply-To: <AANLkTi=00FRr08NjeMLN75U_N-cb9F78=E26LmMY7-uV@mail.gmail.com>
On Tue, Jan 18, 2011 at 08:26:42PM +0100, Alessandro Suardi wrote:
> On Tue, Jan 18, 2011 at 7:47 PM, Jarek Poplawski <jarkao2@gmail.com> wrote:
> > On Tue, Jan 18, 2011 at 07:28:52PM +0100, Jarek Poplawski wrote:
> >> On Tue, Jan 18, 2011 at 07:24:40PM +0100, Jan Engelhardt wrote:
> >> >
> >> > On Tuesday 2011-01-18 19:10, Alessandro Suardi wrote:
> >> > >On Tue, Jan 18, 2011 at 6:23 PM, Jarek Poplawski <jarkao2@gmail.com> wrote:
> >> > >>
> >> > >> NLM_F_DUMP flags should be applied to GET requests only, eg. rtnetlink
> >> > >> tests message type to verify this. Since genetlink can't do the same
> >> > >> use "practical" test for ops->dumpit (assuming NEW request won't be
> >> > >> mixed with GET).
> >> ...
> >> > >2.6.37-git18 + netlink revert + this patch
> >> > > - fixes Avahi
> >> > > - breaks acpid
> >> > >Starting acpi daemon: RTNETLINK1 answers: Operation not supported
> >> > >acpid: error talking to the kernel via netlink
> >> >
> >> > Deducing from that, it is a GET-like request that was sent by acpid,
> >> > and the message type is one that has both a dumpit and a doit function.
> >> > So if EOPNOTSUPP now occurs on all message types that have both dumpit
> >> > and doit, you should have broken a lot more than just acpid.
> >>
> >> Right, we need something better here.
> >
> > On the other hand, until there is something better, we might try to
> > fix it at least for "normal" dumpit cases?
> >
> > Alessandro, could you try (with the netlink revert)?
...
> 2.6.37-git18 + netlink revert + this 2nd attempt
>
> appears to be good for me - both Avahi and acpid start up fine and I
> can't see any other program misbehaving.
>
>
Alessandro, thanks for testing!
Jan, feel free to NAK if it can't help for your problem.
Jarek P.
---------------->
[PATCH v2] netlink: Fix possible NLM_F_DUMP misuse in genetlink
NLM_F_DUMP flags should be applied to GET requests only, eg. rtnetlink
tests message type to verify this. Since genetlink can't do the same
use "practical" test for ops->dumpit, assuming NEW request won't be
mixed with GET. Otherwise, it should work old way. Since, as reported
by Alessandro, apps like acpid use messages with ops->dumpit without
NLM_F_DUMP flags, there is no error reporting for this case.
Original patch by: Jan Engelhardt <jengelh@medozas.de>
Tested-by: Alessandro Suardi <alessandro.suardi@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Cc: Jan Engelhardt <jengelh@medozas.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jamal Hadi Salim <hadi@cyberus.ca>
---
diff -Nurp a/net/netlink/genetlink.c b/net/netlink/genetlink.c
--- a/net/netlink/genetlink.c 2011-01-18 16:58:16.000000000 +0100
+++ b/net/netlink/genetlink.c 2011-01-18 19:36:25.000000000 +0100
@@ -519,15 +519,14 @@ static int genl_rcv_msg(struct sk_buff *
security_netlink_recv(skb, CAP_NET_ADMIN))
return -EPERM;
- if (nlh->nlmsg_flags & NLM_F_DUMP) {
- if (ops->dumpit == NULL)
- return -EOPNOTSUPP;
-
- genl_unlock();
- err = netlink_dump_start(net->genl_sock, skb, nlh,
- ops->dumpit, ops->done);
- genl_lock();
- return err;
+ if (ops->dumpit) {
+ if (nlh->nlmsg_flags & NLM_F_DUMP) {
+ genl_unlock();
+ err = netlink_dump_start(net->genl_sock, skb, nlh,
+ ops->dumpit, ops->done);
+ genl_lock();
+ return err;
+ }
}
if (ops->doit == NULL)
next prev parent reply other threads:[~2011-01-18 20:07 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-18 17:23 inbound connection problems when "netlink: test for all flags of the NLM_F_DUMP composite" commit applied Jarek Poplawski
2011-01-18 18:10 ` Alessandro Suardi
2011-01-18 18:23 ` Jarek Poplawski
2011-01-18 18:24 ` Jan Engelhardt
2011-01-18 18:28 ` Jarek Poplawski
2011-01-18 18:47 ` Jarek Poplawski
2011-01-18 19:26 ` Alessandro Suardi
2011-01-18 20:07 ` Jarek Poplawski [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-01-16 8:54 Arthur Marsh
2011-01-16 9:21 ` Eric Dumazet
2011-01-16 10:50 ` Jan Engelhardt
2011-01-16 12:39 ` Arthur Marsh
[not found] ` <4D32E3BA.5040008@internode.on.net>
2011-01-16 21:17 ` Pablo Neira Ayuso
2011-01-17 1:03 ` Arthur Marsh
2011-01-18 9:38 ` Jarek Poplawski
2011-01-18 10:07 ` David Miller
2011-01-18 10:24 ` Jarek Poplawski
2011-01-18 14:05 ` jamal
2011-01-18 14:07 ` jamal
2011-01-18 17:22 ` Jarek Poplawski
2011-01-18 18:11 ` Jarek Poplawski
2011-01-18 20:39 ` David Miller
2011-01-18 20:31 ` Pablo Neira Ayuso
2011-01-18 20:50 ` David Miller
2011-01-19 17:42 ` Pablo Neira Ayuso
2011-01-19 21:34 ` David Miller
2011-01-18 20:55 ` Jarek Poplawski
2011-01-19 14:28 ` jamal
2011-01-19 16:54 ` Jarek Poplawski
2011-01-19 16:59 ` jamal
2011-01-19 17:19 ` Jarek Poplawski
2011-01-19 17:33 ` Jarek Poplawski
2011-01-19 18:04 ` Jan Engelhardt
2011-01-19 19:24 ` Jarek Poplawski
2011-01-19 19:47 ` Jan Engelhardt
2011-01-19 20:12 ` Jarek Poplawski
2011-01-18 21:14 ` Jarek Poplawski
2011-01-19 14:53 ` Pablo Neira Ayuso
2011-01-19 16:18 ` Jarek Poplawski
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=20110118200716.GA4288@del.dom.local \
--to=jarkao2@gmail.com \
--cc=alessandro.suardi@gmail.com \
--cc=arthur.marsh@internode.on.net \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=hadi@cyberus.ca \
--cc=jengelh@medozas.de \
--cc=netdev@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).