netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: Jakub Kicinski <kuba@kernel.org>,
	davem@davemloft.net, netdev@vger.kernel.org, kernel-team@fb.com,
	jiri@resnulli.us, andrew@lunn.ch, dsahern@gmail.com,
	pablo@netfilter.org
Subject: Re: [PATCH net-next 5/6] netlink: add mask validation
Date: Mon, 05 Oct 2020 21:31:13 +0200	[thread overview]
Message-ID: <93103e3d9496ea0e3e3b9e7f9850c9b12f2397b6.camel@sipsolutions.net> (raw)
In-Reply-To: <20201005192857.2pvd6oj3nzps6n2y@lion.mk-sys.cz>

On Mon, 2020-10-05 at 21:28 +0200, Michal Kubecek wrote:

> > > +	if (value & ~(u64)pt->mask) {
> > > +		NL_SET_ERR_MSG_ATTR(extack, nla, "reserved bit set");
> > > +		return -EINVAL;
> > 
> > You had an export of the valid bits there in ethtool, using the cookie.
> > Just pointing out you lost it now. I'm not sure I like using the cookie,
> > that seems a bit strange, but we could easily define a different attr?
> 
> The idea behind the cookie was that if new userspace sends a request
> with multiple flags which may not be supported by an old kernel, getting
> only -EOPNOTSUPP (and badattr pointing to the flags) would not be very
> helpful as multiple iteration would be necessary to find out which flags
> are supported and which not.

Message crossing, I guess.

I completely agree. I just don't like using the (somewhat vague)
_cookie_ for that vs. adding a new explicit NLMSGERR_ATTR_SOMETHING :)

I would totally support doing that here in the general validation code,
but (again) don't really think NLMSGERR_ATTR_COOKIE is an appropriate
attribute for it.

johannes



  reply	other threads:[~2020-10-05 19:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 15:57 [PATCH net-next 0/6] ethtool: allow dumping policies to user space Jakub Kicinski
2020-10-05 15:57 ` [PATCH net-next 1/6] ethtool: wire up get policies to ops Jakub Kicinski
2020-10-05 18:56   ` Johannes Berg
2020-10-05 19:16     ` Jakub Kicinski
2020-10-05 19:21       ` Johannes Berg
2020-10-05 19:31         ` Jakub Kicinski
2020-10-05 19:33           ` Johannes Berg
2020-10-05 19:41             ` Jakub Kicinski
2020-10-05 19:46               ` Johannes Berg
2020-10-05 19:51                 ` Jakub Kicinski
2020-10-05 21:52             ` Jacob Keller
2020-10-05 21:33           ` Jacob Keller
2020-10-05 15:57 ` [PATCH net-next 2/6] ethtool: use the attributes parsed by the core in get commands Jakub Kicinski
2020-10-05 15:57 ` [PATCH net-next 3/6] ethtool: wire up set policies to ops Jakub Kicinski
2020-10-05 15:57 ` [PATCH net-next 4/6] ethtool: link up ethnl_header_policy as a nested policy Jakub Kicinski
2020-10-05 15:57 ` [PATCH net-next 5/6] netlink: add mask validation Jakub Kicinski
2020-10-05 19:05   ` Johannes Berg
2020-10-05 19:22     ` Jakub Kicinski
2020-10-05 19:25       ` Johannes Berg
2020-10-05 19:34         ` Jakub Kicinski
2020-10-05 19:37           ` Johannes Berg
2020-10-05 19:47           ` Michal Kubecek
2020-10-05 19:28     ` Michal Kubecek
2020-10-05 19:31       ` Johannes Berg [this message]
2020-10-05 19:40         ` Jakub Kicinski
2020-10-05 19:53           ` Johannes Berg
2020-10-05 20:12             ` Johannes Berg
2020-10-05 22:21               ` Jakub Kicinski
2020-10-06  6:37                 ` Johannes Berg
2020-10-06 11:52                   ` Johannes Berg
2020-10-05 15:57 ` [PATCH net-next 6/6] ethtool: specify which header flags are supported per command Jakub Kicinski
2020-10-05 18:58   ` Johannes Berg
2020-10-05 19:25     ` Jakub Kicinski
2020-10-05 19:28       ` 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=93103e3d9496ea0e3e3b9e7f9850c9b12f2397b6.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kernel-team@fb.com \
    --cc=kuba@kernel.org \
    --cc=mkubecek@suse.cz \
    --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).