Re: [PATCH v2 net-next 17/23] net/namespace: Update rtnl_net_dumpid for strict data checking

2018-10-08 Thread Christian Brauner
On Mon, Oct 08, 2018 at 07:28:33AM -0600, David Ahern wrote: > On 10/8/18 4:54 AM, Christian Brauner wrote: > > On Sun, Oct 07, 2018 at 08:16:38PM -0700, David Ahern wrote: > >> From: David Ahern > >> > >> Update rtnl_net_dumpid for strict data checking. If th

Re: [PATCH v2 net-next 00/23] rtnetlink: Add support for rigid checking of data in dump request

2018-10-08 Thread Christian Brauner
_rules: Update fib_nl_dumprule for strict data checking > net/ipv6: Update ip6addrlbl_dump for strict data checking > net: Update netconf dump handlers for strict data checking > net/bridge: Update br_mdb_dump for strict data checking > rtnetlink: Move input checking for rt

Re: [PATCH v2 net-next 23/23] rtnetlink: Update rtnl_fdb_dump for strict data checking

2018-10-08 Thread Christian Brauner
igned-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/rtnetlink.c | 62 > ++-- > 1 file changed, 60 insertions(+), 2 deletions(-) > > diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c > index c7509c789fb6..c8

Re: [PATCH v2 net-next 22/23] rtnetlink: Move input checking for rtnl_fdb_dump to helper

2018-10-08 Thread Christian Brauner
t; allowed to send up to this point. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/rtnetlink.c | 53 > > 1 file changed, 33 insertions(+), 20 deletions(-) > > diff --git a/net/core/

Re: [PATCH v2 net-next 21/23] net/bridge: Update br_mdb_dump for strict data checking

2018-10-08 Thread Christian Brauner
no > attributes can be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/bridge/br_mdb.c | 30 ++ > 1 file changed, 30 insertions(+) > > diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c > index a4a

Re: [PATCH v2 net-next 17/23] net/namespace: Update rtnl_net_dumpid for strict data checking

2018-10-08 Thread Christian Brauner
On Sun, Oct 07, 2018 at 08:16:38PM -0700, David Ahern wrote: > From: David Ahern > > Update rtnl_net_dumpid for strict data checking. If the flag is set, > the dump request is expected to have an rtgenmsg struct as the header > which has the family as the only element. No data may be appended. >

Re: [PATCH v2 net-next 19/23] net/ipv6: Update ip6addrlbl_dump for strict data checking

2018-10-08 Thread Christian Brauner
xpected to be 0 and no > attributes can be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv6/addrlabel.c | 34 +- > 1 file changed, 33 insertions(+), 1 deletion(-) > > diff --git a/net/ipv6/addrlabel.c b/ne

Re: [PATCH v2 net-next 20/23] net: Update netconf dump handlers for strict data checking

2018-10-08 Thread Christian Brauner
tconfmsg struct as the header. > The struct only has the family member and no attributes can be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv4/devinet.c | 22 +++--- > net/ipv6/addrconf.c | 22 +

Re: [PATCH v2 net-next 18/23] net/fib_rules: Update fib_nl_dumprule for strict data checking

2018-10-08 Thread Christian Brauner
d no attributes can > be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/fib_rules.c | 36 +++- > 1 file changed, 35 insertions(+), 1 deletion(-) > > diff --git a/net/core/fib_rules.c b/ne

Re: [PATCH v2 net-next 16/23] net/neighbor: Update neightbl_dump_info for strict data checking

2018-10-08 Thread Christian Brauner
d no attributes can > be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/neighbour.c | 38 +++--- > 1 file changed, 35 insertions(+), 3 deletions(-) > > diff --git a/net/core/neighbour.c b/ne

Re: [PATCH v2 net-next 15/23] net/neighbor: Update neigh_dump_info for strict data checking

2018-10-08 Thread Christian Brauner
sting code does not fail the dump if nlmsg_parse fails. That behavior > is kept for non-strict checking. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/neighbour.c | 82 > ++-- > 1 file changed, 67 ins

Re: [PATCH v2 net-next 13/23] rtnetlink: Update ipmr_rtm_dumplink for strict data checking

2018-10-08 Thread Christian Brauner
xpected to be 0 and no attributes can > be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv4/ipmr.c | 32 > 1 file changed, 32 insertions(+) > > diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c > index 5660adcf

Re: [PATCH v2 net-next 12/23] rtnetlink: Update inet6_dump_ifinfo for strict data checking

2018-10-08 Thread Christian Brauner
xpected to be 0 and no > attributes can be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv6/addrconf.c | 35 +++ > 1 file changed, 35 insertions(+) > > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c &g

Re: [PATCH v2 net-next 11/23] rtnetlink: Update rtnl_stats_dump for strict data checking

2018-10-08 Thread Christian Brauner
On Sun, Oct 07, 2018 at 08:16:32PM -0700, David Ahern wrote: > From: David Ahern > > Update rtnl_stats_dump for strict data checking. If the flag is set, > the dump request is expected to have an if_stats_msg struct as the header. > All elements of the struct are expected to be 0 except

Re: [PATCH v2 net-next 10/23] rtnetlink: Update rtnl_bridge_getlink for strict data checking

2018-10-08 Thread Christian Brauner
Any data passed in the > header or as an attribute is taken as a request to influence the data > returned. Only values supported by the dump handler are allowed to be > non-0 or set in the request. At the moment only the IFLA_EXT_MASK > attribute is supported. > > Signed-off-by:

Re: [PATCH v2 net-next 09/23] rtnetlink: Update rtnl_dump_ifinfo for strict data checking

2018-10-08 Thread Christian Brauner
FO attributes are supported. > > Existing code does not fail the dump if nlmsg_parse fails. That behavior > is kept for non-strict checking. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/rtnetlink.c | 113 > +

Re: [PATCH v2 net-next 08/23] net/ipv6: Update inet6_dump_addr for strict data checking

2018-10-08 Thread Christian Brauner
dd support for other fields > (e.g., honor ifa_index and only return data for the given device index). > > Signed-off-by: David Ahern Same as ipv4, looks way cleaner with the new *_strict() helper! :) Acked-by: Christian Brauner > --- > net/ipv6/addrconf.c | 69 > +

Re: [PATCH v2 net-next 07/23] net/ipv4: Update inet_dump_ifaddr for strict data checking

2018-10-08 Thread Christian Brauner
an support for other fields > (e.g., honor ifa_index and only return data for the given device index). > > Signed-off-by: David Ahern Thanks, with the *_strict() it looks way cleaner now. Acked-by: Christian Brauner > --- > net/ipv4/devinet.c | 72 > +++

Re: [PATCH v2 net-next 06/23] netlink: Add new socket option to enable strict checking on dumps

2018-10-08 Thread Christian Brauner
an potentially be leveraged for tighter > checking on the NEW, DEL, and SET commands. > > Signed-off-by: David Ahern Thanks for the bool. :) Acked-by: Christian Brauner > --- > include/linux/netlink.h | 1 + > include/uapi/linux/netlink.h | 1 + > net/netlink/

Re: [PATCH v2 net-next 04/23] netlink: Add strict version of nlmsg_parse and nla_parse

2018-10-08 Thread Christian Brauner
lly fails with EINVAL if there are any > bytes remaining after the parsing loop completes, if the atttrbitue type > is 0 or greater than max expected. > > Signed-off-by: David Ahern +1 Acked-by: Christian Brauner > --- > include/ne

Re: [PATCH net-next 08/20] rtnetlink: Update rtnl_dump_ifinfo for strict data checking

2018-10-08 Thread Christian Brauner
On Sun, Oct 07, 2018 at 07:29:13PM -0600, David Ahern wrote: > On 10/7/18 4:29 AM, Christian Brauner wrote: > >> I thought about that, but there is so much overlap - they are mostly > >> common. Besides, ifinfomsg is the header for link dumps, and ifinfomsg > >> is

Re: [PATCH net-next 17/20] net/fib_rules: Update fib_nl_dumprule for strict data checking

2018-10-07 Thread Christian Brauner
d no attributes can > be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/fib_rules.c | 36 +++- > 1 file changed, 35 insertions(+), 1 deletion(-) > > diff --git a/net/core/fib_rules.c b/ne

Re: [PATCH net-next 18/20] net/ipv6: Update ip6addrlbl_dump for strict data checking

2018-10-07 Thread Christian Brauner
xpected to be 0 and no > attributes can be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv6/addrlabel.c | 35 ++- > 1 file changed, 34 insertions(+), 1 deletion(-) > > diff --git a/net/ipv6/addrlabel.c b/ne

Re: [PATCH net-next 19/20] net: Update netconf dump handlers for strict data checking

2018-10-07 Thread Christian Brauner
tconfmsg struct as the header. > The struct only has the family member and no attributes can be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv4/devinet.c | 22 +++--- > net/ipv6/addrconf.c | 22 +

Re: [PATCH net-next 15/20] net/neighbor: Update neightbl_dump_info for strict data checking

2018-10-07 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:50PM -0700, David Ahern wrote: > From: David Ahern > > Update neightbl_dump_info for strict data checking. If the flag is set, > the dump request is expected to have an ndtmsg struct as the header. > All elements of the struct are expected to be 0 and no attributes

Re: [PATCH net-next 14/20] net/neighbor: Update neigh_dump_info for strict data checking

2018-10-07 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:49PM -0700, David Ahern wrote: > From: David Ahern > > Update neigh_dump_info for strict data checking. If the flag is set, > the dump request is expected to have an ndmsg struct as the header > potentially followed by one or more attributes. Any data passed in the

Re: [PATCH net-next 13/20] rtnetlink: Update fib dumps for strict data checking

2018-10-07 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:48PM -0700, David Ahern wrote: > From: David Ahern > > Add helper to check netlink message for route dumps. If the strict flag > is set the dump request is expected to have an rtmsg struct as the header. > All elements of the struct are expected to be 0 with the

Re: [PATCH net-next 12/20] rtnetlink: Update ipmr_rtm_dumplink for strict data checking

2018-10-07 Thread Christian Brauner
xpected to be 0 and no attributes can > be appended. > > Signed-off-by: David Ahern Just one really tiny nit below. :) Acked-by: Christian Brauner > --- > net/ipv4/ipmr.c | 32 > 1 file changed, 32 insertions(+) > > diff --git a/net/ipv4/ipmr.c

Re: [PATCH net-next 10/20] rtnetlink: Update rtnl_stats_dump for strict data checking

2018-10-07 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:45PM -0700, David Ahern wrote: > From: David Ahern > > Update rtnl_stats_dump for strict data checking. If the flag is set, > the dump request is expected to have an if_stats_msg struct as the header. > All elements of the struct are expected to be 0 except

Re: [PATCH net-next 09/20] rtnetlink: Update rtnl_bridge_getlink for strict data checking

2018-10-07 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:44PM -0700, David Ahern wrote: > From: David Ahern > > Update rtnl_bridge_getlink for strict data checking. If the flag is set, > the dump request is expected to have an ifinfomsg struct as the header > potentially followed by one or more attributes. Any data passed

Re: [PATCH net-next 08/20] rtnetlink: Update rtnl_dump_ifinfo for strict data checking

2018-10-07 Thread Christian Brauner
On Fri, Oct 05, 2018 at 01:22:24PM -0600, David Ahern wrote: > On 10/5/18 11:59 AM, Christian Brauner wrote: > >> + err = nlmsg_parse(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, extack); > >> + if (err < 0) { > >> + if (cb->strict_check) &g

Re: [PATCH net-next 11/20] rtnetlink: Update inet6_dump_ifinfo for strict data checking

2018-10-07 Thread Christian Brauner
On Fri, Oct 05, 2018 at 01:25:22PM -0600, David Ahern wrote: > On 10/5/18 11:48 AM, Christian Brauner wrote: > > On Thu, Oct 04, 2018 at 02:33:46PM -0700, David Ahern wrote: > >> From: David Ahern > >> > >> Update inet6_dump_ifinfo for strict data checkin

Re: [PATCH net-next 11/20] rtnetlink: Update inet6_dump_ifinfo for strict data checking

2018-10-07 Thread Christian Brauner
On Fri, Oct 05, 2018 at 01:26:31PM -0600, David Ahern wrote: > On 10/5/18 11:54 AM, Christian Brauner wrote: > >> +static int inet6_valid_dump_ifinfo(const struct nlmsghdr *nlh, > >> + struct netlink_ext_ack *extack) > >> +{

Re: [PATCH net-next 05/20] netlink: Add new socket option to enable strict checking on dumps

2018-10-05 Thread Christian Brauner
On October 5, 2018 8:43:55 PM GMT+02:00, David Ahern wrote: >On 10/5/18 11:36 AM, Christian Brauner wrote: >>> diff --git a/include/linux/netlink.h b/include/linux/netlink.h >>> index 88c8a2d83eb3..36bdca2aa42d 100644 >>> --- a/include/linux/netlink.h >

Re: [PATCH net-next 06/20] net/ipv4: Update inet_dump_ifaddr for strict data checking

2018-10-05 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:41PM -0700, David Ahern wrote: > From: David Ahern > > Update inet_dump_ifaddr for strict data checking. If the flag is set, > the dump request is expected to have an ifaddrmsg struct as the header > potentially followed by one or more attributes. Any data passed in

Re: [PATCH net-next 08/20] rtnetlink: Update rtnl_dump_ifinfo for strict data checking

2018-10-05 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:43PM -0700, David Ahern wrote: > From: David Ahern > > Update rtnl_dump_ifinfo for strict data checking. If the flag is set, > the dump request is expected to have an ifinfomsg struct as the header > potentially followed by one or more attributes. Any data passed in

Re: [PATCH net-next 11/20] rtnetlink: Update inet6_dump_ifinfo for strict data checking

2018-10-05 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:46PM -0700, David Ahern wrote: > From: David Ahern > > Update inet6_dump_ifinfo for strict data checking. If the flag is > set, the dump request is expected to have an ifinfomsg struct as > the header. All elements of the struct are expected to be 0 and no >

Re: [PATCH net-next 07/20] net/ipv6: Update inet6_dump_addr for strict data checking

2018-10-05 Thread Christian Brauner
dd support for other fields > (e.g., honor ifa_index and only return data for the given device index). > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv6/addrconf.c | 51 ++- > 1 file changed, 42 insertions(

Re: [PATCH net-next 11/20] rtnetlink: Update inet6_dump_ifinfo for strict data checking

2018-10-05 Thread Christian Brauner
On Fri, Oct 05, 2018 at 07:48:27PM +0200, Christian Brauner wrote: > On Thu, Oct 04, 2018 at 02:33:46PM -0700, David Ahern wrote: > > From: David Ahern > > > > Update inet6_dump_ifinfo for strict data checking. If the flag is > > set, the dump request is expected

Re: [PATCH net-next 11/20] rtnetlink: Update inet6_dump_ifinfo for strict data checking

2018-10-05 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:46PM -0700, David Ahern wrote: > From: David Ahern > > Update inet6_dump_ifinfo for strict data checking. If the flag is > set, the dump request is expected to have an ifinfomsg struct as > the header. All elements of the struct are expected to be 0 and no >

Re: [PATCH net-next 16/20] net/namespace: Update rtnl_net_dumpid for strict data checking

2018-10-05 Thread Christian Brauner
may be appended. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/core/net_namespace.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c > index 670c84b1bfc2..63659c512ba8 100644 &

Re: [PATCH net-next 02/20] netlink: Add extack message to nlmsg_parse for invalid header length

2018-10-05 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:37PM -0700, David Ahern wrote: > From: David Ahern > > Give a user a reason why EINVAL is returned in nlmsg_parse. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > include/net/netlink.h | 4 +++- > 1 file changed, 3 i

Re: [PATCH net-next 01/20] netlink: Pass extack to dump handlers

2018-10-05 Thread Christian Brauner
l when > strict checking is done on dump requests, returning why the dump > fails EINVAL. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > include/linux/netlink.h | 1 + > net/netlink/af_netlink.c | 12 +++- > 2 files changed, 12 insertions(+),

Re: [PATCH net-next 03/20] net: Add extack to nlmsg_parse

2018-10-05 Thread Christian Brauner
having extack in dump requests sounds really useful to me! Acked-by: Christian Brauner > --- > net/core/devlink.c | 2 +- > net/core/neighbour.c | 3 ++- > net/core/rtnetlink.c | 4 ++-- > net/ipv4/devinet.c | 9 + > net/i

Re: [PATCH net-next 05/20] netlink: Add new socket option to enable strict checking on dumps

2018-10-05 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:40PM -0700, David Ahern wrote: > From: David Ahern > > Add a new socket option, NETLINK_DUMP_STRICT_CHK, that userspace > can use via setsockopt to request strict checking of headers and > attributes on dump requests. > > To get dump features such as kernel side

Re: [PATCH net-next 20/20] net/bridge: Update br_mdb_dump for strict data checking

2018-10-05 Thread Christian Brauner
On Thu, Oct 04, 2018 at 02:33:55PM -0700, David Ahern wrote: > From: David Ahern > > Update br_mdb_dump for strict data checking. If the flag is set, > the dump request is expected to have a br_port_msg struct as the > header. All elements of the struct are expected to be 0 and no > attributes

Re: [PATCH RFC v2 net-next 03/25] netlink: introduce NLM_F_DUMP_PROPER_HDR flag

2018-10-02 Thread Christian Brauner
On Tue, Oct 02, 2018 at 01:06:14PM +0200, Jiri Benc wrote: > On Mon, 1 Oct 2018 17:28:29 -0700, David Ahern wrote: > > Add a new flag, NLM_F_DUMP_PROPER_HDR, for userspace to indicate to the > > kernel that it believes it is sending the right header struct for the > > dump message type

Re: [PATCH RFC v2 net-next 02/25] net/ipv6: Refactor address dump to push inet6_fill_args to in6_dump_addrs

2018-10-02 Thread Christian Brauner
On Tue, Oct 02, 2018 at 01:07:49PM +0200, Jiri Benc wrote: > On Tue, 2 Oct 2018 13:03:00 +0200, Christian Brauner wrote: > > Well, it's a namespace filter that's how I saw it. > > That would imply that without it, you get data from all name spaces > (= unfiltered by

Re: [PATCH RFC v2 net-next 01/25] net/netlink: Pass extack to dump callbacks

2018-10-02 Thread Christian Brauner
On Mon, Oct 01, 2018 at 05:28:27PM -0700, David Ahern wrote: > From: David Ahern > > Pass extack to dump callbacks by adding extack to netlink_dump_control, > transferring to netlink_callback and adding to the netlink_dump. Update > rtnetlink as the first user. Update netlink_dump to add any

Re: [PATCH RFC v2 net-next 02/25] net/ipv6: Refactor address dump to push inet6_fill_args to in6_dump_addrs

2018-10-02 Thread Christian Brauner
On Tue, Oct 02, 2018 at 12:54:25PM +0200, Jiri Benc wrote: > On Mon, 1 Oct 2018 17:28:28 -0700, David Ahern wrote: > > Pull the inet6_fill_args arg up to in6_dump_addrs and move netnsid > > into it. Since IFA_TARGET_NETNSID is a kernel side filter add the > > NLM_F_DUMP_FILTERED flag so userspace

Re: [PATCH iproute2-next 00/11] Fix dump requests to use proper header for type

2018-09-30 Thread Christian Brauner
On Sat, Sep 29, 2018 at 10:59:20AM -0700, David Ahern wrote: > From: David Ahern > > iproute2 currently uses ifinfomsg as the header for all dumps using the > wilddump headers. This is wrong as each message type actually has its own > header type. While the kernel has traditionally let it go as

Re: [PATCH RFC net-next 0/5] rtnetlink: Add support for rigid checking of data in dump request

2018-09-28 Thread Christian Brauner
On Fri, Sep 28, 2018 at 08:44:57AM -0700, dsah...@kernel.org wrote: > From: David Ahern > > There are many use cases where a user wants to influence what is > returned in a dump for some rtnetlink command: one is wanting data > for a different namespace than the one the request is received and >

Re: [PATCH RFC net-next 2/5] net/ipv6: Refactor address dump to push inet6_fill_args to in6_dump_addrs

2018-09-28 Thread Christian Brauner
est was honored. > > Signed-off-by: David Ahern Acked-by: Christian Brauner > --- > net/ipv6/addrconf.c | 59 > + > 1 file changed, 32 insertions(+), 27 deletions(-) > > diff --git a/net/ipv6/addrconf.c b/n

Re: [PATCH RFC net-next 1/5] net/netlink: Pass extack to dump callbacks

2018-09-28 Thread Christian Brauner
ern I like the idea of passing down extack. Acked-by: Christian Brauner > --- > include/linux/netlink.h | 2 ++ > net/core/rtnetlink.c | 1 + > net/netlink/af_netlink.c | 1 + > 3 files changed, 4 insertions(+) > > diff --git a/include/linux/netlink.h b/include/linux/ne

Re: [PATCH RFC net-next 5/5] net/ipv6: Update inet6_dump_addr to support NLM_F_DUMP_PROPER_HDR

2018-09-28 Thread Christian Brauner
On Fri, Sep 28, 2018 at 08:45:02AM -0700, dsah...@kernel.org wrote: > From: David Ahern > > Update inet6_dump_addr to check for NLM_F_DUMP_PROPER_HDR in the netlink > message header. If the flag is set, the dump request is expected to have > an ifaddrmsg struct as the header potentially followed

Re: [PATCH RFC net-next 4/5] net/ipv4: Update inet_dump_ifaddr to support NLM_F_DUMP_PROPER_HDR

2018-09-28 Thread Christian Brauner
On Fri, Sep 28, 2018 at 08:45:01AM -0700, dsah...@kernel.org wrote: > From: David Ahern > > Update inet_dump_ifaddr to check for NLM_F_DUMP_PROPER_HDR in the netlink > message header. If the flag is set, the dump request is expected to have > an ifaddrmsg struct as the header potentially

Re: [PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
On September 27, 2018 10:24:36 PM GMT+02:00, David Ahern wrote: >On 9/27/18 11:58 AM, Christian Brauner wrote: >> Various userspace programs (e.g. iproute2) have sent RTM_GETADDR >> requests with struct ifinfomsg. This is wrong and should have been >> struct ifaddrmsg

[PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger Christian Brauner (7): rtnetlink: add RTM_GETADDR2 ipv4: add RTM_GETADDR2 ipv6: add RTM_GETADDR2

[PATCH net-next 1/7] rtnetlink: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger --- include/uapi/linux/rtnetlink.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi

[PATCH net-next 2/7] ipv4: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger --- net/ipv4/devinet.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions

[PATCH net-next 5/7] phonet: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger --- net/phonet/pn_netlink.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions

[PATCH net-next 6/7] selinux: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger --- security/selinux/nlmsgtab.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH net-next 3/7] ipv6: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger --- net/ipv6/addrconf.c | 30 -- 1 file changed, 24 insertions(+), 6

[PATCH net-next 7/7] rtnetlink: enable RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger --- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/rtnetlink.c b/net

[PATCH net-next 4/7] decnet: add RTM_GETADDR2

2018-09-27 Thread Christian Brauner
]: https://lists.openwall.net/netdev/2018/09/25/75 [3]: https://lists.openwall.net/netdev/2018/09/26/166 Signed-off-by: Christian Brauner Cc: David Ahern Cc: Jiri Benc Cc: Stephen Hemminger --- net/decnet/dn_dev.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions

Re: netlink: 16 bytes leftover after parsing attributes in process `ip'.

2018-09-26 Thread Christian Brauner
On Tue, Sep 25, 2018 at 02:16:12PM +0100, Stephen Hemminger wrote: > On Tue, 25 Sep 2018 14:34:08 +0200 > Christian Brauner wrote: > > > On Tue, Sep 25, 2018, 14:07 Stephen Hemminger > > wrote: > > > > > On Tue, 25 Sep 2018 11:49:10 +0200 > > > Chr

Re: netlink: 16 bytes leftover after parsing attributes in process `ip'.

2018-09-26 Thread Christian Brauner
On Tue, Sep 25, 2018 at 09:37:41AM -0600, David Ahern wrote: > On 9/25/18 8:47 AM, Jiri Benc wrote: > > On Tue, 25 Sep 2018 11:49:10 +0200, Christian Brauner wrote: > >> So if people really want to hide this issue as much as we can then we > >> can play the guessing

Re: netlink: 16 bytes leftover after parsing attributes in process `ip'.

2018-09-25 Thread Christian Brauner
On Mon, Sep 24, 2018 at 09:19:06PM -0600, David Ahern wrote: > On top of net-next I am see a dmesg error: > > netlink: 16 bytes leftover after parsing attributes in process `ip'. > > I traced it to address lists and commit: > > commit 6ecf4c37eb3e89b0832c9616089a5cdca3747da

Re: [PATCH net-next 0/5] rtnetlink: add IFA_IF_NETNSID for RTM_GETADDR

2018-08-31 Thread Christian Brauner
On Thu, Aug 30, 2018 at 04:45:45PM +0200, Christian Brauner wrote: > On Thu, Aug 30, 2018 at 11:49:31AM +0300, Kirill Tkhai wrote: > > On 29.08.2018 21:13, Christian Brauner wrote: > > > Hi Kirill, > > > > > > Thanks for the question! > > > > >

[PATCH] selftests: uevent filtering

2018-05-22 Thread Christian Brauner
/2018/4/4/739 [5]: https://lkml.org/lkml/2018/4/26/767 [6]: https://lkml.org/lkml/2018/4/26/738 Signed-off-by: Christian Brauner <christ...@brauner.io> --- tools/testing/selftests/uevent/Makefile | 17 + tools/testing/selftests/uevent/config | 2 + .../selftests/

[PATCH net-next 1/2 v5] uevent: add alloc_uevent_skb() helper

2018-04-29 Thread Christian Brauner
This patch adds alloc_uevent_skb() in preparation for follow up patches. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- v4->v5: * patch unchanged v3->v4: * non-functional changes: initialize some variables again explicitly to make it obvious

[PATCH net-next 0/2 v5] netns: uevent filtering

2018-04-29 Thread Christian Brauner
) KERNEL[655.333272] remove /devices/pci:00/:00:02.0/:01:00.1/net/eth1 (net) Thanks! Christian [1]: https://lkml.org/lkml/2018/4/4/739 [2]: https://lkml.org/lkml/2018/4/26/767 [3]: https://lkml.org/lkml/2018/4/26/738 Christian Brauner (2): uevent: add alloc_uevent_skb() helper

[PATCH net-next 2/2 v5] netns: restrict uevents

2018-04-29 Thread Christian Brauner
removes kobj_bcast_filter() and replaces netlink_broadcast_filtered() with the simpler netlink_broadcast() everywhere. [1]: https://lkml.org/lkml/2018/4/4/739 [2]: https://lkml.org/lkml/2018/4/26/767 [3]: https://lkml.org/lkml/2018/4/26/738 Signed-off-by: Christian Brauner <christian.brau...@ubunt

Re: [PATCH net-next 2/2 v4] netns: restrict uevents

2018-04-29 Thread Christian Brauner
On Sat, Apr 28, 2018 at 11:23:58PM -0500, Eric W. Biederman wrote: > > > + /* fix credentials */ > > + if (owning_user_ns != _user_ns) { > > + struct netlink_skb_parms *parms = _CB(skb); > > + kuid_t root_uid; > > + kgid_t root_gid; > > + > > + /* fix

[PATCH net-next 0/2 v4] netns: uevent filtering

2018-04-28 Thread Christian Brauner
) KERNEL[655.333272] remove /devices/pci:00/:00:02.0/:01:00.1/net/eth1 (net) Thanks! Christian [1]: https://lkml.org/lkml/2018/4/4/739 [2]: https://lkml.org/lkml/2018/4/26/767 [3]: https://lkml.org/lkml/2018/4/26/738 Christian Brauner (2): uevent: add alloc_uevent_skb() helper

[PATCH net-next 1/2 v4] uevent: add alloc_uevent_skb() helper

2018-04-28 Thread Christian Brauner
This patch adds alloc_uevent_skb() in preparation for follow up patches. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- v3->v4: * non-functional changes: initialize some variables again explicitly to make it obvious to readers that they are correctly set v2-&

[PATCH net-next 2/2 v4] netns: restrict uevents

2018-04-28 Thread Christian Brauner
removes kobj_bcast_filter() and replaces netlink_broadcast_filtered() with the simpler netlink_broadcast() everywhere. [1]: https://lkml.org/lkml/2018/4/4/739 [2]: https://lkml.org/lkml/2018/4/26/767 [3]: https://lkml.org/lkml/2018/4/26/738 Signed-off-by: Christian Brauner <christian.brau...@ubunt

Re: [PATCH net-next 2/2 v3] netns: restrict uevents

2018-04-28 Thread Christian Brauner
On Fri, Apr 27, 2018 at 11:30:26AM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@ubuntu.com> writes: > > --- > > lib/kobject_uevent.c | 140 ++- > > 1 file changed, 99 insertions(+), 41 deletions(

Re: [PATCH net-next 1/2 v3] uevent: add alloc_uevent_skb() helper

2018-04-28 Thread Christian Brauner
On Fri, Apr 27, 2018 at 11:39:44AM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@ubuntu.com> writes: > > > This patch adds alloc_uevent_skb() in preparation for follow up patches. > > > > Signed-off-by: Christian Brauner <christian.bra

[PATCH net-next 2/2 v3] netns: restrict uevents

2018-04-27 Thread Christian Brauner
removes kobj_bcast_filter() and replaces netlink_broadcast_filtered() with the simpler netlink_broadcast() everywhere. [1]: https://lkml.org/lkml/2018/4/4/739 [2]: https://lkml.org/lkml/2018/4/26/767 [3]: https://lkml.org/lkml/2018/4/26/738 Signed-off-by: Christian Brauner <christian.brau...@

[PATCH net-next 1/2 v3] uevent: add alloc_uevent_skb() helper

2018-04-27 Thread Christian Brauner
This patch adds alloc_uevent_skb() in preparation for follow up patches. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- lib/kobject_uevent.c | 39 ++- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/kobject_ueve

[PATCH net-next 0/2] netns: uevent filtering

2018-04-27 Thread Christian Brauner
/pci:00/:00:02.0/:01:00.1/net/eth1 (net) Thanks! Christian [1]: https://lkml.org/lkml/2018/4/4/739 [2]: https://lkml.org/lkml/2018/4/26/767 [3]: https://lkml.org/lkml/2018/4/26/738 Christian Brauner (2): uevent: add alloc_uevent_skb() helper netns: restrict uevents lib

Re: [PATCH net-next 1/2 v2] netns: restrict uevents

2018-04-27 Thread Christian Brauner
On Thu, Apr 26, 2018 at 07:35:47PM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@canonical.com> writes: > > > On Thu, Apr 26, 2018 at 12:10:30PM -0500, Eric W. Biederman wrote: > >> Christian Brauner <christian.brau...@canonical.com> wr

Re: [PATCH net-next 1/2 v2] netns: restrict uevents

2018-04-26 Thread Christian Brauner
On Thu, Apr 26, 2018 at 12:10:30PM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@canonical.com> writes: > > > On Thu, Apr 26, 2018 at 11:47:19AM -0500, Eric W. Biederman wrote: > >> Christian Brauner <christian.brau...@canonical.com> wr

Re: [PATCH net-next 1/2 v2] netns: restrict uevents

2018-04-26 Thread Christian Brauner
On Thu, Apr 26, 2018 at 11:47:19AM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@canonical.com> writes: > > > On Tue, Apr 24, 2018 at 06:00:35PM -0500, Eric W. Biederman wrote: > >> Christian Brauner <christian.brau...@canonical.com> wr

Re: [PATCH net-next 1/2 v2] netns: restrict uevents

2018-04-26 Thread Christian Brauner
On Tue, Apr 24, 2018 at 06:00:35PM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@canonical.com> writes: > > > On Wed, Apr 25, 2018, 00:41 Eric W. Biederman <ebied...@xmission.com> wrote: > > > > Bah. This code is obviously correct an

Re: [PATCH net-next 1/2 v2] netns: restrict uevents

2018-04-24 Thread Christian Brauner
ing logic to kobj_bcast_filter(). But since we care about performance improvements as well I can come up with a patch that moves this logic out of kobj_bcast_filter(). Christian [1]: https://www.spinics.net/lists/netdev/msg494487.html > > Eric > > Christian Brauner <christian.brau..

Re: [PATCH net-next 2/2 v2] netns: isolate seqnums to use per-netns locks

2018-04-24 Thread Christian Brauner
On Tue, Apr 24, 2018 at 04:52:20PM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@ubuntu.com> writes: > > > Now that it's possible to have a different set of uevents in different > > network namespaces, per-network namespace uevent sequence nu

Re: [PATCH net-next 2/2 v1] netns: isolate seqnums to use per-netns locks

2018-04-24 Thread Christian Brauner
On Tue, Apr 24, 2018 at 03:39:25PM -0400, David Miller wrote: > From: Christian Brauner <christian.brau...@ubuntu.com> > Date: Mon, 23 Apr 2018 12:24:43 +0200 > > > + #ifdef CONFIG_NET > > + seqnum = get_ns_uevent_seqnum_by_vpid(); > > + #else >

[PATCH net-next 0/2 v2] netns: uevent performance tweaks

2018-04-24 Thread Christian Brauner
it message for [PATCH 2/2] netns: isolate seqnums to use per-netns locks Thanks! Christian Christian Brauner (2): netns: restrict uevents netns: isolate seqnums to use per-netns locks include/linux/kobject.h | 2 + include/net/net_namespace.h | 3 + kernel/ksysfs.c | 11

[PATCH net-next 1/2 v2] netns: restrict uevents

2018-04-24 Thread Christian Brauner
ts. [1]: https://lkml.org/lkml/2018/4/4/739 Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- Changelog v1->v2: * patch unchanged Changelog v0->v1: * patch unchanged --- lib/kobject_uevent.c | 18 -- 1 file changed, 12 insertions(+), 6 d

[PATCH net-next 2/2 v2] netns: isolate seqnums to use per-netns locks

2018-04-24 Thread Christian Brauner
sample estimates: mean of x mean of y 207.2632 164.0330 Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- Changelog v1->v2: * non-functional change: fix indendation for C directives in kernel/ksysfs.c Changelog v0->v1: * add detailed test results to

[PATCH net-next 1/2 v1] netns: restrict uevents

2018-04-23 Thread Christian Brauner
ts. [1]: https://lkml.org/lkml/2018/4/4/739 Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- Changelog v0->v1: * patch unchanged --- lib/kobject_uevent.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/kobject_uevent.c b/lib/

[PATCH net-next 0/2 v1] netns: uevent performance tweaks

2018-04-23 Thread Christian Brauner
the global uevent socket list from the locking for network namespaces not in the global uevent socket list. A very detailed rationale including performance test results is present in the commit message for [PATCH 2/2] netns: isolate seqnums to use per-netns locks Thanks! Christian

[PATCH net-next 2/2 v1] netns: isolate seqnums to use per-netns locks

2018-04-23 Thread Christian Brauner
sample estimates: mean of x mean of y 207.2632 164.0330 Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- Changelog v0->v1: * add detailed test results to the commit message * account for kernels compiled without CONFIG_NET --- include/linux/kobject.h |

Re: [PATCH net-next 2/2] netns: isolate seqnums to use per-netns locks

2018-04-23 Thread Christian Brauner
On Mon, Apr 23, 2018 at 10:39:50AM +0800, kbuild test robot wrote: > Hi Christian, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on net-next/master] > > url: > https://github.com/0day-ci/linux/commits/Christian-Brauner/netns-u

Re: [PATCH net-next 2/2] netns: isolate seqnums to use per-netns locks

2018-04-21 Thread Christian Brauner
On Fri, Apr 20, 2018 at 06:16:44PM +0200, Christian Brauner wrote: > On Fri, Apr 20, 2018 at 03:56:28PM +0200, Christian Brauner wrote: > > On Wed, Apr 18, 2018 at 11:52:47PM +0200, Christian Brauner wrote: > > > On Wed, Apr 18, 2018 at 11:55:52AM -0500, Eric W. Biederman wrote:

Re: [PATCH net-next 2/2] netns: isolate seqnums to use per-netns locks

2018-04-20 Thread Christian Brauner
On Fri, Apr 20, 2018 at 03:56:28PM +0200, Christian Brauner wrote: > On Wed, Apr 18, 2018 at 11:52:47PM +0200, Christian Brauner wrote: > > On Wed, Apr 18, 2018 at 11:55:52AM -0500, Eric W. Biederman wrote: > > > Christian Brauner <christian.brau...@ubuntu.com> writes: >

Re: [PATCH net-next 2/2] netns: isolate seqnums to use per-netns locks

2018-04-20 Thread Christian Brauner
On Wed, Apr 18, 2018 at 11:52:47PM +0200, Christian Brauner wrote: > On Wed, Apr 18, 2018 at 11:55:52AM -0500, Eric W. Biederman wrote: > > Christian Brauner <christian.brau...@ubuntu.com> writes: > > > > > Now that it's possible to have a different set of ueve

Re: [PATCH net-next 2/2] netns: isolate seqnums to use per-netns locks

2018-04-18 Thread Christian Brauner
On Wed, Apr 18, 2018 at 11:55:52AM -0500, Eric W. Biederman wrote: > Christian Brauner <christian.brau...@ubuntu.com> writes: > > > Now that it's possible to have a different set of uevents in different > > network namespaces, per-network namespace uevent sequence nu

  1   2   >