On Thu, 2020-10-01 at 09:24 -0700, Jakub Kicinski wrote:
> > I guess the most compact representation, that also preserves the most
> > data about sharing, would be to do something like
> >
> > [ATTR_FAMILY_ID]
> > [ATTR_POLICY]
> > [policy idx, 0 = main policy]
> > [bla]
> > ...
> > .
On Thu, 2020-10-01 at 08:41 -0700, Jakub Kicinski wrote:
> > Even if I don't have a good idea now on how to avoid the duplication, it
> > might be nicer to have a (flag) attribute here for "CTRL_ATTR_ALL_OPS"?
>
> Hm. How would you see the dump structured?
Yeah, that's the tricky part ... Hence
On Thu, 2020-10-01 at 08:50 -0700, Jakub Kicinski wrote:
> > > > > > > + memcpy(op, &family->ops[i], sizeof(*op));
> > > > > >
> > > > > > What's wrong with struct assignment? :)
> FWIW the 400 was without the -Os with -Os it's more like 50. So I'll
> just go for it and do the struct assig
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote:
> Right now CTRL_CMD_GETPOLICY can only dump the family-wide
> policy. Support dumping policy of a specific op.
So, hmm.
Yeah, I guess this is fine, but you could end up having to do a lot of
dumps, and with e.g. ethtool you'd end up with a
y with attributes which CTRL_CMD_GETFAMILY does not
> support.
Reviewed-by: Johannes Berg
johannes
is way"
> code does not have to worry if the policy is per op
> or global.
Maybe make 'taskstats', which I munged a bit in commit 3b0f31f2b8c9
("genetlink: make policy common to family") go back to using per-command
policy - properly this time with maxattr?
But the
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote:
> The structure of ctrl_dumppolicy() is clearly split into
> init and dumping. Move the init to a .start callback
> for clarity, it's a more idiomatic netlink dump code structure.
Yep, makes sense.
Reviewed-by: Johannes Berg
johannes
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote:
> Whenever netlink dump uses more than 2 cb->args[] entries
> code gets hard to read. We're about to add more state to
> ctrl_dumppolicy() so create a structure.
>
> Since the structure is typed and clearly named we can remove
> the local fa
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote:
> Bulk of the genetlink users can use smaller ops, move them.
Reviewed-by: Johannes Berg
johannes
the size of genl_ops). Translate
> these smaller ops into a full blown struct before use in the
> core.
LGTM. That part about the WARN_ON was even easier than I thought :)
Reviewed-by: Johannes Berg
johannes
whole table - and we'll hopefully never run more than 2**16 multicast
groups across all genetlink families :)
But it also doesn't matter much.
Reviewed-by: Johannes Berg
johannes
On Wed, 2020-09-30 at 12:46 -0700, Jakub Kicinski wrote:
> This builds (I think) - around 100 extra LoC:
Looks good to me, couple of comments below.
> +/**
> + * struct genl_light_ops - generic netlink operations (small version)
> + * @cmd: command identifier
> + * @internal_flags: flags used by
On Wed, 2020-09-30 at 12:14 -0700, Jakub Kicinski wrote:
> > Hm. I guess you could even have both?
> >
> > struct genl_ops *ops;
> > struct genl_ops_ext *extops;
> >
> > and then search both arrays, no need for memcpy/pointer assignment?
>
> Yup, both should work quite nicely, too. No r
On Wed, 2020-09-30 at 12:01 -0700, Jakub Kicinski wrote:
> On Wed, 30 Sep 2020 20:36:24 +0200 Johannes Berg wrote:
> > On Wed, 2020-09-30 at 09:44 -0700, Jakub Kicinski wrote:
> >
> > > I started with a get_policy() callback, but I didn't like it much.
> > >
On Wed, 2020-09-30 at 20:42 +0200, Michal Kubecek wrote:
>
> Not really good either but how about embedding struct genl_ops as first
> member of struct genl_ops_ext like we do with sockets?
That won't work, we need to make an *array* out of these...
johannes
On Wed, 2020-09-30 at 09:44 -0700, Jakub Kicinski wrote:
> I started with a get_policy() callback, but I didn't like it much.
> Static data is much more pleasant for a client of the API IMHO.
Yeah, true.
> What do you think about "ops light"? Insufficiently flexible?
TBH, I'm not really sure ho
On Wed, 2020-09-30 at 18:06 +0200, Johannes Berg wrote:
>
> That's the historic info I guess - I'll take a look at ethtool later and
> see what it's doing there.
Oh, ok, I see how that works ... you *do* have a sort of common/aliased
attribute inside each per-op family
Hi Jakub,
> I'd like to be able to dump ethtool nl policies, but right now policy
> dumping is only supported for "global" family policies.
Did ethtool add per-command policies?
> Is there any reason not to put the policy in struct genl_ops,
> or just nobody got to it, yet?
>
> I get the feeli
On Wed, 2020-09-30 at 12:55 +0300, Leon Romanovsky wrote:
> On Wed, Sep 30, 2020 at 11:01:27AM +0300, Kalle Valo wrote:
> > Leon Romanovsky writes:
> >
> > > > diff --git a/drivers/net/wireless/purelifi/Kconfig
> > > b/drivers/net/wireless/purelifi/Kconfig
> > > > new file mode 100644
> > > > ind
211_tx_status_ext to support bulk free
mac80211: reorganize code to remove a forward declaration
mac80211: allow bigger A-MSDU sizes in VHT, even if HT is limited
Johannes Berg (2):
cfg80211: add missing kernel-doc for S1G band capabilities
mac80211: fix some encapsulation of
E and fix unit mismatch
mac80211: add AQL support for VHT160 tx rates
mac80211: do not allow bigger VHT MPDUs than the hardware supports
Johannes Berg (1):
cfg80211: fix 6 GHz channel conversion
John Crispin (1):
mac80211: fix 80 MHz association to 160/80+80 AP on 6 GH
From: Johannes Berg
In the policy export for binary attributes I erroneously used
a != NLA_VALIDATE_NONE comparison instead of checking for the
two possible values, which meant that if a validation function
pointer ended up aliasing the min/max as negatives, we'd hit
a warni
-
Chung-Hsien Hsu (1):
nl80211: support SAE authentication offload in AP mode
James Prestwood (1):
nl80211: fix PORT_AUTHORIZED wording to reflect behavior
Johannes Berg (2):
nl80211: clean up code/policy a bit
nl80211: use NLA_POLICY_RANGE(NLA_BINARY, ...) for a few attribu
timation for low data rates
mac80211: reduce packet loss event false positives
Johannes Berg (2):
nl80211: fix NL80211_ATTR_HE_6GHZ_CAPABILITY usage
cfg80211: regulatory: reject invalid hints
Shay Bar (1):
wireless: fix wrong 160/80+80 MHz setting
net/mac80211/airtime.
box :)
> In such a case, netlink_recvmsg will use this 2nd skb instead of the
> original one.
>
> Without this patch, such compat applications will retrieve
> all netlink dump data, but will then get an unexpected EOF.
>
> Cc: Johannes Berg
> Signed-off-by: Florian Westpha
This is useful for iterating elements in a nested attribute,
if they're not parsed with a strict length limit or such.
Signed-off-by: Johannes Berg
---
include/libnetlink.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index e27516f
This prints out the data from the given nested attribute
to the given FILE pointer, interpreting the firmware that
the kernel has for showing netlink policies.
Signed-off-by: Johannes Berg
---
include/libnetlink.h | 2 ++
lib/libnetlink.c | 73
Support dumping the netlink policy of a given generic netlink
family, the policy (with any sub-policies if appropriate) is
exported by the kernel in a general fashion.
Signed-off-by: Johannes Berg
---
genl/ctrl.c | 24 ++--
1 file changed, 18 insertions(+), 6 deletions
On Sun, 2020-08-23 at 19:45 -0600, David Ahern wrote:
> On 8/19/20 4:29 AM, Johannes Berg wrote:
> > @@ -100,6 +102,30 @@ static int print_ctrl_grp(FILE *fp, struct rtattr
> > *arg, __u32 ctrl_ver)
> >
> > }
> >
> > +static const c
On Thu, 2020-08-20 at 11:47 +0200, Jason A. Donenfeld wrote:
> On Wed, Aug 19, 2020 at 8:42 PM syzbot
> wrote:
> > syzbot has bisected this issue to:
> >
> > commit e7096c131e5161fa3b8e52a650d7719d2857adfd
> > Author: Jason A. Donenfeld
> > Date: Sun Dec 8 23:27:34 2019 +
> >
> > net:
From: Johannes Berg
Evidently, when I did this previously, we didn't have more than
10 policies and didn't run into the reallocation path, because
it's missing a memset() for the unused policies. Fix that.
Fixes: d07dcf9aadd6 ("netlink: add infrastructure to expose po
On Wed, 2020-08-19 at 12:10 -0700, Jakub Kicinski wrote:
> > + memset(&state->policies[state->n_alloc], 0,
> > + sizeof(state->policies[0]) * (n_alloc - state->n_alloc));
>
> [flex_]array_size() ? To avoid the inevitable follow up from a bot..
Yeah, hmm.
I suppose you know this but
Support dumping the netlink policy of a given generic netlink
family, the policy (with any sub-policies if appropriate) is
exported by the kernel in a general fashion.
Signed-off-by: Johannes Berg
---
genl/ctrl.c | 91 +
1 file changed, 85
This is useful for iterating elements in a nested attribute,
if they're not parsed with a strict length limit or such.
Signed-off-by: Johannes Berg
---
include/libnetlink.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index e27516f
From: Johannes Berg
Evidently, when I did this previously, we didn't have more than
10 policies and didn't run into the reallocation path, because
it's missing a memset() for the unused policies. Fix that.
Fixes: d07dcf9aadd6 ("netlink: add infrastructure to expose po
On Tue, 2020-08-04 at 14:05 -0700, Rustam Kovhaev wrote:
> this warning can be triggered by userspace, so it should not cause a
> panic if panic_on_warn is set
This is incorrect, it just addresses a particular symptom. I'll make a
proper fix.
johannes
From: Johannes Berg
Change places that open-code NLA_POLICY_EXACT_LEN() to
use the macro instead, giving us flexibility in how we
handle the details of the macro.
Signed-off-by: Johannes Berg
---
drivers/net/wireguard/netlink.c | 10 +-
net/bridge/br_netlink.c | 4 ++--
net
In quite a few places (perhaps particularly in wireless) we need to
validation an NLA_BINARY attribute with both a minimum and a maximum
length. Currently, we can do either of the two, but not both, given
that we have NLA_MIN_LEN (minimum length) and NLA_BINARY (maximum).
Extend the range mechanis
From: Johannes Berg
Add range validation for NLA_BINARY, allowing validation of any
combination of combination minimum or maximum lengths, using the
existing NLA_POLICY_RANGE()/NLA_POLICY_FULL_RANGE() macros, just
like for integers where the value is checked.
Also make NLA_POLICY_EXACT_LEN
From: Johannes Berg
Change places that open-code NLA_POLICY_MIN_LEN() to
use the macro instead, giving us flexibility in how we
handle the details of the macro.
Signed-off-by: Johannes Berg
---
drivers/net/macsec.c| 2 +-
drivers/net/wireguard/netlink.c | 4 ++--
net/wireless
> + if (pt->validation_type == NLA_VALIDATE_RANGE_WARN_TOO_LONG &&
> + pt->type == NLA_BINARY && value > range.max) {
> + pr_warn_ratelimited("netlink: '%s': attribute type %d has an
> invalid length.\n",
> + current->comm, pt->type
From: Johannes Berg
Change places that open-code NLA_POLICY_EXACT_LEN() to
use the macro instead, giving us flexibility in how we
handle the details of the macro.
Signed-off-by: Johannes Berg
---
drivers/net/wireguard/netlink.c | 10 +-
net/bridge/br_netlink.c | 4 ++--
net
From: Johannes Berg
Change places that open-code NLA_POLICY_MIN_LEN() to
use the macro instead, giving us flexibility in how we
handle the details of the macro.
Signed-off-by: Johannes Berg
---
drivers/net/macsec.c| 2 +-
drivers/net/wireguard/netlink.c | 4 ++--
net/wireless
In quite a few places (perhaps particularly in wireless) we need to
validation an NLA_BINARY attribute with both a minimum and a maximum
length. Currently, we can do either of the two, but not both, given
that we have NLA_MIN_LEN (minimum length) and NLA_BINARY (maximum).
Extend the range mechanis
From: Johannes Berg
Add range validation for NLA_BINARY, allowing validation of any
combination of combination minimum or maximum lengths, using the
existing NLA_POLICY_RANGE()/NLA_POLICY_FULL_RANGE() macros, just
like for integers where the value is checked.
Also make NLA_POLICY_EXACT_LEN
ct ieee80211_local *local = from_tasklet(local, t, tasklet);
Yay, thank you!
Reviewed-by: Johannes Berg
Dave, if you want to take this patch, I have no objections - I have
nothing in my mac80211-next tree (yet).
johannes
From: Johannes Berg
With certain configurations, a 64-bit ARCH=um errors
out here with an unknown csum_ipv6_magic() function.
Include the right header file to always have it.
Signed-off-by: Johannes Berg
---
net/ipv4/ip_tunnel_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net
Hi,
This is something I'd been thinking about for a while; we already
have NLA_MIN_LEN, NLA_BINARY (with a max len), and NLA_EXACT_LEN,
but in quite a few places (as you can see in the last patch here)
we need a range, and we already have a way to encode ranges for
integer ranges, so it's pretty e
From: Johannes Berg
Change places that open-code NLA_POLICY_MIN_LEN() to
use the macro instead, giving us flexibility in how we
handle the details of the macro.
Signed-off-by: Johannes Berg
---
drivers/net/macsec.c| 2 +-
drivers/net/wireguard/netlink.c | 4 ++--
net/wireless
From: Johannes Berg
Add range validation for NLA_BINARY, allowing validation of any
combination of combination minimum or maximum lengths, using the
existing NLA_POLICY_RANGE()/NLA_POLICY_FULL_RANGE() macros, just
like for integers where the value is checked.
Also make NLA_POLICY_EXACT_LEN
From: Johannes Berg
We have a few attributes with minimum and maximum lengths that are
not the same, use the new feature of being able to specify both in
the policy to validate them, removing code and allowing this to be
advertised to userspace in the policy export.
Signed-off-by: Johannes Berg
From: Johannes Berg
Change places that open-code NLA_POLICY_EXACT_LEN() to
use the macro instead, giving us flexibility in how we
handle the details of the macro.
Signed-off-by: Johannes Berg
---
drivers/net/wireguard/netlink.c | 10 +-
net/bridge/br_netlink.c | 4 ++--
net
0-08-03
13:02:06 +0200)
A few more changes, notably:
* handle new SAE (WPA3 authentication) status codes in the correct way
* fix a while that should be an if instead, avoiding infinite loops
* handle beacon filtering changing better
------
alculate skb hash early when using itxq
mac80211: add a function for running rx without passing skbs to the stack
Gustavo A. R. Silva (1):
mac80211: Use fallthrough pseudo-keyword
Johannes Berg (2):
cfg80211: invert HE BSS color 'disabled' to 'enabled'
Hi Dave,
It's been a while, sorry. I have a few more fix that'd be nice
to get in, though I don't think they affect a majority of users.
Please pull and let me know if there's any problem.
Thanks,
johannes
The following changes since commit 27a2145d6f826d1fad9de06ac541b1016ced3427:
ibmvnic
Hi,
Sorry ... long delay.
> > The reason I'm asking is that it's starting to sound like we really
> > ought to be implementing devlink, but we've got a bunch of
> > infrastructure that uses the devcoredump, and it'll take time
> > (significantly so) to change all that...
>
> In devlink world pur
On Sun, 2020-07-26 at 21:49 +0530, Rakesh Pillai wrote:
> We do have the usage of napi_gro_receive and netif_receive_skb in mac80211.
> /* deliver to local stack */
> if (rx->napi)
> napi_gro_receive(rx->napi, skb);
> else
>
On Thu, 2020-07-23 at 23:56 +0530, Rakesh Pillai wrote:
> > > - WARN_ON_ONCE(softirq_count() == 0);
> > > + WARN_ON_ONCE(napi && softirq_count() == 0);
> >
> > FWIW, I'm pretty sure this is incorrect - we make assumptions on
> > softirqs being disabled in mac80211 for serialization and in place o
On Wed, 2020-07-15 at 16:57 -0500, Gustavo A. R. Silva wrote:
> One-element arrays are being deprecated[1]. Replace the one-element
> array with a simple value type 'u8 reserved'[2], once this is just
> a placeholder for alignment.
>
> [1] https://github.com/KSPP/linux/issues/79
> [2] https://gith
On Tue, 2020-07-21 at 22:44 +0530, Rakesh Pillai wrote:
> The function ieee80211_rx_napi can be now called
> from a thread context as well, with napi context
> being NULL.
>
> Hence add the napi context check before giving out
> a warning for softirq count being 0.
>
> Tested-on: WCN3990 hw1.0 SN
On Wed, 2020-07-22 at 14:27 +0200, Felix Fietkau wrote:
> I'm considering testing a different approach (with mt76 initially):
> - Add a mac80211 rx function that puts processed skbs into a list
> instead of handing them to the network stack directly.
Would this be *after* all the mac80211 process
On Wed, 2020-07-15 at 08:48 -0700, Jakub Kicinski wrote:
> On Tue, 14 Jul 2020 19:59:02 -0700 Randy Dunlap wrote:
> > Drop doubled words in several comments.
> >
> > Signed-off-by: Randy Dunlap
> > Cc: "David S. Miller"
> > Cc: Jakub Kicinski
> > Cc: netdev@vger.kernel.org
>
> Hi Randy, the Wi
rise, given the age, that would've
landed in the tree long ago).
So:
Acked-by: Johannes Berg
johannes
Hi Dave,
We've got a couple of fixes here, and I took the liberty to include a
small code cleanup of some really stupid code, and a patch that adds
new AKM suites so we can use them in the drivers more easily.
Please pull and let me know if there's any problem.
Thanks,
johannes
The following
URLs
Flavio Suligoi (3):
doc: networking: wireless: fix wiki website url
include: fix wiki website url in netlink interface header
net: fix wiki website url mac80211 and wireless files
Johannes Berg (2):
cfg80211: fix management registrations dea
On Mon, 2020-06-08 at 09:14 +0200, Sedat Dilek wrote:
> On Sat, Jun 6, 2020 at 9:56 AM Johannes Berg
> wrote:
> > Hi, sorry for the top post, on my phone.
> >
> > Yes, your analysis is spot on I think. I've got a fix for this in my
> > jberg/mac80211 tree, th
Hi, sorry for the top post, on my phone.
Yes, your analysis is spot on I think. I've got a fix for this in my
jberg/mac80211 tree, there's a deadlock with a work struct and the rtnl.
Sorry about that. My testing should've caught it, but that exact scenario
didn't happen, and lockdep for disabl
array with flexible-array
Hauke Mehrtens (1):
wireless: Use linux/stddef.h instead of stddef.h
Ilan Peer (2):
mac80211: Add HE 6GHz capabilities element to probe request
mac80211: Consider 6 GHz band when handling power constraint
Johannes Berg (15):
mac80211: allow SA-QUER
On Tue, 2020-05-26 at 08:36 -0300, Ramon Fontes wrote:
> > Not sure this is enough? How about wmediumd, for example?
>
> It works with wmediumd too. At least I was able to enable 5 / 10MHz
> via iw with 5.9GHz
Yeah, but wmediumd won't know that it's not 20 MHz, I guess :-)
> > And also, 5/10 MHz
arious improvements/fixes
Andrei Otcheretianski (1):
mac80211: Don't destroy auth data in case of anti-clogging
Ilan Peer (3):
cfg80211: Parse HE membership selector
mac80211: Skip entries with HE membership selector
mac80211: Fail association when AP has no l
esh timer crash
----
Johannes Berg (1):
cfg80211: fix debugfs rename crash
Linus Lüssing (1):
mac80211: mesh: fix discovery timer re-arming issue / crash
Pradeep Kumar Chitrapu (1):
ieee80211: Fix incorrect mask for default PE duration
include/linux/ieee80211.h | 2 +
On Fri, 2020-05-15 at 13:46 -0300, Ramon Fontes wrote:
> Signed-off-by: Ramon Fontes
> ---
> drivers/net/wireless/mac80211_hwsim.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/mac80211_hwsim.c
> b/drivers/net/wireless/mac80211_hwsim.c
> index 0528d4cb4..67f97ac3
On Fri, 2020-05-22 at 10:17 -0700, Jakub Kicinski wrote:
> > > --- a/net/core/Makefile
> > > +++ b/net/core/Makefile
> > > @@ -31,7 +31,7 @@ obj-$(CONFIG_LWTUNNEL_BPF) += lwt_bpf.o
> > > obj-$(CONFIG_BPF_STREAM_PARSER) += sock_map.o
> > > obj-$(CONFIG_DST_CACHE) += dst_cache.o
> > > obj-$(CONFI
On Mon, 2020-05-18 at 13:35 -0700, Jakub Kicinski wrote:
>
> It's intended to be a generic netlink channel for configuring devices.
>
> All the firmware-related interfaces have no dependencies on netdevs,
> in fact that's one of the reasons we moved to devlink - we don't want
> to hold rtnl lock
On Mon, 2020-05-18 at 13:28 -0700, Jakub Kicinski wrote:
> On Mon, 18 May 2020 21:25:09 +0200 Johannes Berg wrote:
> > It's pretty clear, but even then, first of all I doubt this is the case
> > for many of the places that you've sprinkled the annotation on, and
>
On Mon, 2020-05-18 at 19:59 +, Luis Chamberlain wrote:
> > Err, no. Those two are most definitely related. Have you looked at (most
> > or some or whatever) staging drivers recently? Those contain all kinds
> > of garbage that might do whatever with your kernel.
>
> No, I stay away :)
:)
>
On Mon, 2020-05-18 at 19:09 +, Luis Chamberlain wrote:
> > Unfortunately a "taint" is interpreted by many users as: "your kernel
> > is really F#*D up, you better do something about it right now."
> > Assuming they're paying attention at all in the first place of course.
>
> Taint historicall
On Sat, 2020-05-16 at 15:24 +0200, Johannes Berg wrote:
> Instead of the kernel taint, IMHO you should provide an annotation in
> sysfs (or somewhere else) for the *struct device* that had its firmware
> crash. Or maybe, if it's too complex to walk the entire hierarchy
> checking
On Fri, 2020-05-15 at 21:28 +, Luis Chamberlain wrote:>
module_firmware_crashed
You didn't CC me or the wireless list on the rest of the patches, so I'm
replying to a random one, but ...
What is the point here?
This should in no way affect the integrity of the system/kernel, for
most device
From: Johannes Berg
Now that we have limited recursive policy validation to avoid
stack overflows, change nl80211 to actually link the nested
policy (linking back to itself eventually), which allows some
code cleanups.
Signed-off-by: Johannes Berg
---
net/wireless/nl80211.c | 10
From: Johannes Berg
Add, and use in generic netlink, helpers to dump out a netlink
policy to userspace, including all the range validation data,
nested policies etc.
This lets userspace discover what the kernel understands.
For families/commands other than generic netlink, the helpers
need to
From: Johannes Berg
Since NLA_MSECS is really equivalent to NLA_U64, allow
it to have range validation as well.
Signed-off-by: Johannes Berg
---
include/net/netlink.h | 6 --
lib/nlattr.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/net/netlink.h
From: Johannes Berg
Add helpers to get the policy's signed/unsigned range
validation data.
Signed-off-by: Johannes Berg
---
v2:
- context-only conflict fix for the warn condition change
---
include/net/netlink.h | 5 +++
lib/nlattr.c
From: Johannes Berg
In the netlink policy, we currently have a void *validation_data
that's pointing to different things:
* a u32 value for bitfield32,
* the netlink policy for nested/nested array
* the string for NLA_REJECT
Remove the pointer and place appropriate type-safe items i
From: Johannes Berg
Now that we have nested policies, we can theoretically
recurse forever parsing attributes if a (sub-)policy
refers back to a higher level one. This is a situation
that has happened in nl80211, and we've avoided it there
by not linking it.
Add some code to netlink parsi
Hi,
Alright, this is the resend now, really just changing
- the WARN_ON_ONCE() as spotted by Jakub;
- mark the export patch no longer RFC.
I wasn't actually sure if you meant this one too, and I really
should dig out and polish the code that showed it in userspace.
johannes
From: Johannes Berg
Use a validation type instead, so we can later expose
the NLA_* values to userspace for policy descriptions.
Some transformations were done with this spatch:
@@
identifier p;
expression X, L, A;
@@
struct nla_policy p[X] = {
[A] =
-{ .type
From: Johannes Berg
Using a pointer to a struct indicating the min/max values,
extend the ability to do range validation for arbitrary
values. Small values in the s16 range can be kept in the
policy directly.
Signed-off-by: Johannes Berg
---
v2:
- fix WARN_ON condition as spotted by Jakub
On Wed, 2020-04-29 at 11:10 -0700, Jakub Kicinski wrote:
> > +static int nla_validate_int_range_unsigned(const struct nla_policy *pt,
> > + const struct nlattr *nla,
> > + struct netlink_ext_ack *extack)
> > {
> > - bool
Hi,
Sorry - again, I got distracted/interrupted before I could send this.
I made this a little more than a year ago, and then forgot it. Antonio
asked me something a couple of weeks ago, and that reminded me of this
so I'm finally sending it out now (rebased & adjusted).
Basically this just does
From: Johannes Berg
Use a validation type instead, so we can later expose
the NLA_* values to userspace for policy descriptions.
Some transformations were done with this spatch:
@@
identifier p;
expression X, L, A;
@@
struct nla_policy p[X] = {
[A] =
-{ .type
From: Johannes Berg
Using a pointer to a struct indicating the min/max values,
extend the ability to do range validation for arbitrary
values. Small values in the s16 range can be kept in the
policy directly.
Signed-off-by: Johannes Berg
---
include/net/netlink.h | 45 +
lib
From: Johannes Berg
Since NLA_MSECS is really equivalent to NLA_U64, allow
it to have range validation as well.
Signed-off-by: Johannes Berg
---
include/net/netlink.h | 6 --
lib/nlattr.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/net/netlink.h
From: Johannes Berg
Add, and use in generic netlink, helpers to dump out a netlink
policy to userspace, including all the range validation data,
nested policies etc.
This lets userspace discover what the kernel understands.
For families/commands other than generic netlink, the helpers
need to
From: Johannes Berg
Now that we have nested policies, we can theoretically
recurse forever parsing attributes if a (sub-)policy
refers back to a higher level one. This is a situation
that has happened in nl80211, and we've avoided it there
by not linking it.
Add some code to netlink parsi
From: Johannes Berg
Add helpers to get the policy's signed/unsigned range
validation data.
Signed-off-by: Johannes Berg
---
include/net/netlink.h | 5 +++
lib/nlattr.c | 95 +--
2 files changed, 79 insertions(+), 21 deletions(-)
diff --
From: Johannes Berg
Now that we have limited recursive policy validation to avoid
stack overflows, change nl80211 to actually link the nested
policy (linking back to itself eventually), which allows some
code cleanups.
Signed-off-by: Johannes Berg
---
net/wireless/nl80211.c | 10
From: Johannes Berg
In the netlink policy, we currently have a void *validation_data
that's pointing to different things:
* a u32 value for bitfield32,
* the netlink policy for nested/nested array
* the string for NLA_REJECT
Remove the pointer and place appropriate type-safe items i
On Thu, 2019-10-10 at 19:04 -0700, Jakub Kicinski wrote:
> > if (reporter->auto_recover)
> > - return devlink_health_reporter_recover(reporter, priv_ctx);
> > + return devlink_health_reporter_recover(reporter,
> > + priv_ctx,
On Thu, 2019-10-10 at 20:04 +0200, Michal Kubecek wrote:
>
> The only thing I don't like about the genetlink infrastructure is the
> design decision that policy and corresponding maxattr is an attribute of
> the family rather than a command. This forces anyone who wants to use it
> to essentially
201 - 300 of 1980 matches
Mail list logo