From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org
Subject: Re: [RFC 0/3] netlink: extended error reporting
Date: Fri, 07 Apr 2017 20:59:12 +0200 [thread overview]
Message-ID: <1491591552.5800.1.camel@sipsolutions.net> (raw)
In-Reply-To: <20170407.115315.23470877439489670.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Fri, 2017-04-07 at 11:53 -0700, David Miller wrote:
> > Alexander Shishkin had a nice way of reporting static extended
> > error data, but that isn't really suitable for reporting the
> > offset or even reporting the broken attribute from nla_parse().
> >
> > Speaking of nla_parse(), that'll be somewhat complicated to do
> > since we'll have to track the offsets of where we're parsing,
> > but it might be possible since the nlattrs are just pointers
> > into the message, so (optionally?) passing the skb as well can
> > allow us to fill the offset information.
>
> I like it, nice work.
I don't like it all that much ;-)
Alexander Shishkin's patch
https://patchwork.kernel.org/patch/7162421/
was nice in a way because you could get away without passing the error
structure down all the time, but like I said it doesn't deal with
dynamic errors (even the offset/attr from nla_parse) and if it's not
done *everywhere* it risks leaking those exterr numbers (-1024..-4095)
to userspace through syscalls if it's used in a non-netlink path for
some reason (e.g. a single driver call being called through both
netlink and ioctl, and trying to return an extended error)
> I know people want dynamically generated strings and stuff, and we
> can get there, but I prefer that the first thing we commit is super
> simple.
>
> Someone gave me a hard time about the fact that we've been talking
> about this idea for years but nothing ever happens.
>
> I'm tempted to apply this as-is just to show that person that things
> do in fact happen.... eventually :-)
Heh. I think I really want to solve - at least partially - nla_parse()
to see that it can be done this way. It'd be nice to even transform all
the callers (I generated half of these patches with spatch anyway) to
have at least that.
johannes
next prev parent reply other threads:[~2017-04-07 18:59 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-07 18:26 [RFC 0/3] netlink: extended error reporting Johannes Berg
2017-04-07 18:26 ` [RFC 1/3] " Johannes Berg
2017-04-07 19:41 ` Johannes Berg
2017-04-07 18:26 ` [RFC 2/3] genetlink: pass extended error report down Johannes Berg
2017-04-07 18:37 ` Ben Greear
[not found] ` <25e1fb8c-22e0-d7a2-13a7-d0def5432c9e-my8/4N5VtI7c+919tysfdA@public.gmane.org>
2017-04-07 19:12 ` Johannes Berg
2017-04-07 19:27 ` Ben Greear
[not found] ` <20170407182620.6438-1-johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-04-07 18:26 ` [RFC 3/3] nl80211: add a few extended error strings Johannes Berg
2017-04-07 18:53 ` [RFC 0/3] netlink: extended error reporting David Miller
[not found] ` <20170407.115315.23470877439489670.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-04-07 18:59 ` Johannes Berg [this message]
[not found] ` <1491591552.5800.1.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-04-07 19:06 ` Pablo Neira Ayuso
2017-04-07 19:09 ` Johannes Berg
2017-04-07 19:21 ` Pablo Neira Ayuso
2017-04-07 19:29 ` Johannes Berg
[not found] ` <1491593357.5800.13.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-04-07 19:45 ` Pablo Neira Ayuso
2017-04-07 19:47 ` Johannes Berg
2017-04-07 19:34 ` David Miller
2017-04-07 19:22 ` David Miller
[not found] ` <20170407.122223.385211483743191711.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-04-07 19:27 ` Pablo Neira Ayuso
2017-04-07 19:29 ` Johannes Berg
2017-04-07 19:34 ` David Miller
2017-04-07 19:20 ` David Miller
2017-04-07 19:26 ` Johannes Berg
2017-04-07 19:35 ` Pablo Neira Ayuso
2017-04-07 19:43 ` David Miller
[not found] ` <20170407.124327.626442219286333933.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-04-07 19:46 ` Johannes Berg
[not found] ` <1491594406.5800.18.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-04-07 19:55 ` David Miller
[not found] ` <20170407.125511.1233528940652477012.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-04-07 20:27 ` Johannes Berg
2017-04-07 19:02 ` Pablo Neira Ayuso
2017-04-07 19:06 ` Johannes Berg
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=1491591552.5800.1.camel@sipsolutions.net \
--to=johannes-cdvu00un1vgdhxzaddlk8q@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.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).