Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Johannes Berg
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] > > ... > > .

Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Johannes Berg
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

Re: Genetlink per cmd policies

2020-10-01 Thread Johannes Berg
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

Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Johannes Berg
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

Re: [RFC net-next 8/9] genetlink: use per-op policy for CTRL_CMD_GETPOLICY

2020-10-01 Thread Johannes Berg
y with attributes which CTRL_CMD_GETFAMILY does not > support. Reviewed-by: Johannes Berg johannes

Re: [RFC net-next 7/9] genetlink: bring back per op policy

2020-10-01 Thread Johannes Berg
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

Re: [RFC net-next 6/9] genetlink: use .start callback for dumppolicy

2020-10-01 Thread Johannes Berg
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

Re: [RFC net-next 5/9] genetlink: add a structure for dump state

2020-10-01 Thread Johannes Berg
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

Re: [RFC net-next 4/9] genetlink: move to smaller ops wherever possible

2020-10-01 Thread Johannes Berg
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

Re: [RFC net-next 3/9] genetlink: add small version of ops

2020-10-01 Thread Johannes Berg
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

Re: [RFC net-next 2/9] genetlink: reorg struct genl_family

2020-10-01 Thread Johannes Berg
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

Re: Genetlink per cmd policies

2020-09-30 Thread Johannes Berg
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

Re: Genetlink per cmd policies

2020-09-30 Thread Johannes Berg
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

Re: Genetlink per cmd policies

2020-09-30 Thread Johannes Berg
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. > > >

Re: Genetlink per cmd policies

2020-09-30 Thread Johannes Berg
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

Re: Genetlink per cmd policies

2020-09-30 Thread Johannes Berg
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

Re: Genetlink per cmd policies

2020-09-30 Thread Johannes Berg
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

Re: Genetlink per cmd policies

2020-09-30 Thread Johannes Berg
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

Re: [PATCH] [v2] wireless: Initial driver submission for pureLiFi devices

2020-09-30 Thread Johannes Berg
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

pull-request: mac80211-next 2020-09-21

2020-09-21 Thread Johannes Berg
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

pull-request: mac80211 2020-09-21

2020-09-21 Thread Johannes Berg
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

[PATCH] netlink: policy: correct validation type check

2020-08-31 Thread Johannes Berg
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

pull-request: mac80211-next 2020-08-28

2020-08-28 Thread Johannes Berg
- 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

pull-request: mac80211 2020-08-28

2020-08-28 Thread Johannes Berg
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.

Re: [PATCH v2 3/6] netlink/compat: Append NLMSG_DONE/extack to frag_list

2020-08-26 Thread Johannes Berg
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

[PATCH 1/3] libnetlink: add rtattr_for_each_nested() iteration macro

2020-08-24 Thread Johannes Berg
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

[PATCH 2/3] libnetlink: add nl_print_policy() helper

2020-08-24 Thread Johannes Berg
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

[PATCH 3/3] genl: ctrl: support dumping netlink policy

2020-08-24 Thread Johannes Berg
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

Re: [PATCH 2/2] genl: ctrl: support dumping netlink policy

2020-08-24 Thread Johannes Berg
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

Re: WARNING in __cfg80211_connect_result

2020-08-20 Thread Johannes Berg
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:

[PATCH v2] netlink: fix state reallocation in policy export

2020-08-19 Thread Johannes Berg
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

Re: [PATCH] netlink: fix state reallocation in policy export

2020-08-19 Thread Johannes Berg
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

[PATCH 2/2] genl: ctrl: support dumping netlink policy

2020-08-19 Thread Johannes Berg
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

[PATCH 1/2] libnetlink: add rtattr_for_each_nested() iteration macro

2020-08-19 Thread Johannes Berg
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

[PATCH] netlink: fix state reallocation in policy export

2020-08-19 Thread Johannes Berg
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

Re: [PATCH] cfg80211: switch from WARN() to pr_warn() in is_user_regdom_saved()

2020-08-19 Thread Johannes Berg
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

[PATCH v2 1/3] netlink: consistently use NLA_POLICY_EXACT_LEN()

2020-08-18 Thread 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

[PATCH v2 0/3] netlink: allow NLA_BINARY length range validation

2020-08-18 Thread Johannes Berg
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

[PATCH v2 3/3] netlink: make NLA_BINARY validation more flexible

2020-08-18 Thread Johannes Berg
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

[PATCH v2 2/3] netlink: consistently use NLA_POLICY_MIN_LEN()

2020-08-18 Thread Johannes Berg
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

Re: [PATCH 3/3] netlink: make NLA_BINARY validation more flexible

2020-08-18 Thread Johannes Berg
> + 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

[PATCH 1/3] netlink: consistently use NLA_POLICY_EXACT_LEN()

2020-08-18 Thread 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

[PATCH 2/3] netlink: consistently use NLA_POLICY_MIN_LEN()

2020-08-18 Thread Johannes Berg
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

[PATCH 0/3] netlink: allow NLA_BINARY length range validation

2020-08-18 Thread Johannes Berg
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

[PATCH 3/3] netlink: make NLA_BINARY validation more flexible

2020-08-18 Thread Johannes Berg
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

Re: [PATCH 3/8] net: mac80211: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Johannes Berg
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

[PATCH] ipv4: tunnel: fix compilation on ARCH=um

2020-08-12 Thread Johannes Berg
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

[RFC 0/4] netlink: binary attribute range validation

2020-08-05 Thread Johannes Berg
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

[RFC 2/4] netlink: consistently use NLA_POLICY_MIN_LEN()

2020-08-05 Thread Johannes Berg
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

[RFC 3/4] netlink: make NLA_BINARY validation more flexible

2020-08-05 Thread Johannes Berg
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

[RFC 4/4] nl80211: use NLA_POLICY_RANGE(NLA_BINARY, ...) for a few attributes

2020-08-05 Thread Johannes Berg
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

[RFC 1/4] netlink: consistently use NLA_POLICY_EXACT_LEN()

2020-08-05 Thread 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

pull-request: mac80211-next 2020-08-03

2020-08-03 Thread Johannes Berg
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 ------

pull-request: mac80211-next 2020-07-31

2020-07-31 Thread Johannes Berg
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'

pull-request: mac80211 2020-07-30

2020-07-30 Thread Johannes Berg
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

Re: [RFC 1/2] devlink: add simple fw crash helpers

2020-07-30 Thread Johannes Berg
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

Re: [RFC 1/7] mac80211: Add check for napi handle before WARN_ON

2020-07-30 Thread Johannes Berg
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 >

Re: [RFC 1/7] mac80211: Add check for napi handle before WARN_ON

2020-07-23 Thread Johannes Berg
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

Re: [PATCH][next] wil6210: Avoid the use of one-element array

2020-07-22 Thread Johannes Berg
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

Re: [RFC 1/7] mac80211: Add check for napi handle before WARN_ON

2020-07-22 Thread Johannes Berg
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

Re: [RFC 2/7] ath10k: Add support to process rx packet in thread

2020-07-22 Thread Johannes Berg
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

Re: [PATCH 01/13 net-next] net: nl80211.h: drop duplicate words in comments

2020-07-15 Thread Johannes Berg
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

Re: [PATCH net] genetlink: take netlink table lock when (un)registering

2020-06-30 Thread Johannes Berg
rise, given the age, that would've landed in the tree long ago). So: Acked-by: Johannes Berg johannes

pull-request: mac80211 2020-06-29

2020-06-29 Thread Johannes Berg
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

pull-request: mac80211 2020-06-08

2020-06-08 Thread Johannes Berg
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

Re: Hang on wireless removal..

2020-06-08 Thread Johannes Berg
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

Re: Hang on wireless removal..

2020-06-06 Thread Johannes Berg
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

pull-request: mac80211-next 2020-05-31

2020-05-31 Thread Johannes Berg
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

Re: [PATCH] mac80211_hwsim: report the WIPHY_FLAG_SUPPORTS_5_10_MHZ capability

2020-05-27 Thread Johannes Berg
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

pull-request: mac80211-next next-2020-04-25

2020-05-25 Thread Johannes Berg
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

pull-request: mac80211 2020-05-25

2020-05-25 Thread Johannes Berg
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 +

Re: [PATCH] mac80211_hwsim: report the WIPHY_FLAG_SUPPORTS_5_10_MHZ capability

2020-05-25 Thread Johannes Berg
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

Re: [RFC 1/2] devlink: add simple fw crash helpers

2020-05-22 Thread Johannes Berg
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

Re: [PATCH v2 12/15] ath10k: use new module_firmware_crashed()

2020-05-18 Thread Johannes Berg
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

Re: [PATCH v2 12/15] ath10k: use new module_firmware_crashed()

2020-05-18 Thread Johannes Berg
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 >

Re: [PATCH v2 12/15] ath10k: use new module_firmware_crashed()

2020-05-18 Thread Johannes Berg
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 :) :) >

Re: [PATCH v2 12/15] ath10k: use new module_firmware_crashed()

2020-05-18 Thread Johannes Berg
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

Re: [PATCH v2 12/15] ath10k: use new module_firmware_crashed()

2020-05-16 Thread Johannes Berg
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

Re: [PATCH v2 12/15] ath10k: use new module_firmware_crashed()

2020-05-16 Thread Johannes Berg
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

[PATCH v2 3/8] nl80211: link recursive netlink nested policy

2020-04-30 Thread Johannes Berg
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

[PATCH v2 8/8] netlink: add infrastructure to expose policies to userspace

2020-04-30 Thread Johannes Berg
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

[PATCH v2 5/8] netlink: allow NLA_MSECS to have range validation

2020-04-30 Thread Johannes Berg
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

[PATCH v2 7/8] netlink: factor out policy range helpers

2020-04-30 Thread Johannes Berg
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

[PATCH v2 1/8] netlink: remove type-unsafe validation_data pointer

2020-04-30 Thread Johannes Berg
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

[PATCH v2 2/8] netlink: limit recursion depth in policy validation

2020-04-30 Thread Johannes Berg
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

[PATCH v2 0/8] netlink validation improvements/refactoring

2020-04-30 Thread Johannes Berg
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

[PATCH v2 6/8] netlink: remove NLA_EXACT_LEN_WARN

2020-04-30 Thread Johannes Berg
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

[PATCH v2 4/8] netlink: extend policy range validation

2020-04-30 Thread Johannes Berg
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

Re: [PATCH 4/7] netlink: extend policy range validation

2020-04-29 Thread Johannes Berg
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

[PATCH 0/7] netlink validation improvements/refactoring

2020-04-29 Thread Johannes Berg
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

[PATCH 6/7] netlink: remove NLA_EXACT_LEN_WARN

2020-04-29 Thread Johannes Berg
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

[PATCH 4/7] netlink: extend policy range validation

2020-04-29 Thread Johannes Berg
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

[PATCH 5/7] netlink: allow NLA_MSECS to have range validation

2020-04-29 Thread Johannes Berg
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

[RFC PATCH] netlink: add infrastructure to expose policies to userspace

2020-04-29 Thread Johannes Berg
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

[PATCH 2/7] netlink: limit recursion depth in policy validation

2020-04-29 Thread Johannes Berg
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

[PATCH 7/7] netlink: factor out policy range helpers

2020-04-29 Thread Johannes Berg
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 --

[PATCH 3/7] nl80211: link recursive netlink nested policy

2020-04-29 Thread Johannes Berg
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

[PATCH 1/7] netlink: remove type-unsafe validation_data pointer

2020-04-29 Thread Johannes Berg
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

Re: [patch net-next v2 2/4] devlink: propagate extack down to health reporter ops

2019-10-10 Thread Johannes Berg
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,

Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-10 Thread Johannes Berg
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

<    1   2   3   4   5   6   7   8   9   10   >