Skip to content

Commit ecb1b82

Browse files
committed
Merge tag 'net-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from bpf, netfilter and WiFi. Jakub is doing a lot of work to include the self-tests in our CI, as a result a significant amount of self-tests related fixes is flowing in (and will likely continue in the next few weeks). Current release - regressions: - bpf: fix a kernel crash for the riscv 64 JIT - bnxt_en: fix memory leak in bnxt_hwrm_get_rings() - revert "net: macsec: use skb_ensure_writable_head_tail to expand the skb" Previous releases - regressions: - core: fix removing a namespace with conflicting altnames - tc/flower: fix chain template offload memory leak - tcp: - make sure init the accept_queue's spinlocks once - fix autocork on CPUs with weak memory model - udp: fix busy polling - mlx5e: - fix out-of-bound read in port timestamping - fix peer flow lists corruption - iwlwifi: fix a memory corruption Previous releases - always broken: - netfilter: - nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain - nft_limit: reject configurations that cause integer overflow - bpf: fix bpf_xdp_adjust_tail() with XSK zero-copy mbuf, avoiding a NULL pointer dereference upon shrinking - llc: make llc_ui_sendmsg() more robust against bonding changes - smc: fix illegal rmb_desc access in SMC-D connection dump - dpll: fix pin dump crash for rebound module - bnxt_en: fix possible crash after creating sw mqprio TCs - hv_netvsc: calculate correct ring size when PAGE_SIZE is not 4kB Misc: - several self-tests fixes for better integration with the netdev CI - added several missing modules descriptions" * tag 'net-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (88 commits) tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring tsnep: Remove FCS for XDP data path net: fec: fix the unhandled context fault from smmu selftests: bonding: do not test arp/ns target with mode balance-alb/tlb fjes: fix memleaks in fjes_hw_setup i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue i40e: set xdp_rxq_info::frag_size xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers ice: remove redundant xdp_rxq_info registration i40e: handle multi-buffer packets that are shrunk by xdp prog ice: work on pre-XDP prog frag count xsk: fix usage of multi-buffer BPF helpers for ZC XDP xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags xsk: recycle buffer in case Rx queue was full net: fill in MODULE_DESCRIPTION()s for rvu_mbox net: fill in MODULE_DESCRIPTION()s for litex net: fill in MODULE_DESCRIPTION()s for fsl_pq_mdio net: fill in MODULE_DESCRIPTION()s for fec ...
2 parents bdc0102 + 0a5bd0f commit ecb1b82

File tree

120 files changed

+928
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+928
-341
lines changed

arch/riscv/net/bpf_jit_comp64.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
795795
struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY];
796796
struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT];
797797
struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN];
798+
bool is_struct_ops = flags & BPF_TRAMP_F_INDIRECT;
798799
void *orig_call = func_addr;
799800
bool save_ret;
800801
u32 insn;
@@ -878,7 +879,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
878879

879880
stack_size = round_up(stack_size, 16);
880881

881-
if (func_addr) {
882+
if (!is_struct_ops) {
882883
/* For the trampoline called from function entry,
883884
* the frame of traced function and the frame of
884885
* trampoline need to be considered.
@@ -998,7 +999,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
998999

9991000
emit_ld(RV_REG_S1, -sreg_off, RV_REG_FP, ctx);
10001001

1001-
if (func_addr) {
1002+
if (!is_struct_ops) {
10021003
/* trampoline called from function entry */
10031004
emit_ld(RV_REG_T0, stack_size - 8, RV_REG_SP, ctx);
10041005
emit_ld(RV_REG_FP, stack_size - 16, RV_REG_SP, ctx);

drivers/dpll/dpll_core.c

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ static u32 dpll_pin_xa_id;
2929
WARN_ON_ONCE(!xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
3030
#define ASSERT_DPLL_NOT_REGISTERED(d) \
3131
WARN_ON_ONCE(xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
32-
#define ASSERT_PIN_REGISTERED(p) \
33-
WARN_ON_ONCE(!xa_get_mark(&dpll_pin_xa, (p)->id, DPLL_REGISTERED))
3432

3533
struct dpll_device_registration {
3634
struct list_head list;
@@ -425,6 +423,53 @@ void dpll_device_unregister(struct dpll_device *dpll,
425423
}
426424
EXPORT_SYMBOL_GPL(dpll_device_unregister);
427425

426+
static void dpll_pin_prop_free(struct dpll_pin_properties *prop)
427+
{
428+
kfree(prop->package_label);
429+
kfree(prop->panel_label);
430+
kfree(prop->board_label);
431+
kfree(prop->freq_supported);
432+
}
433+
434+
static int dpll_pin_prop_dup(const struct dpll_pin_properties *src,
435+
struct dpll_pin_properties *dst)
436+
{
437+
memcpy(dst, src, sizeof(*dst));
438+
if (src->freq_supported && src->freq_supported_num) {
439+
size_t freq_size = src->freq_supported_num *
440+
sizeof(*src->freq_supported);
441+
dst->freq_supported = kmemdup(src->freq_supported,
442+
freq_size, GFP_KERNEL);
443+
if (!src->freq_supported)
444+
return -ENOMEM;
445+
}
446+
if (src->board_label) {
447+
dst->board_label = kstrdup(src->board_label, GFP_KERNEL);
448+
if (!dst->board_label)
449+
goto err_board_label;
450+
}
451+
if (src->panel_label) {
452+
dst->panel_label = kstrdup(src->panel_label, GFP_KERNEL);
453+
if (!dst->panel_label)
454+
goto err_panel_label;
455+
}
456+
if (src->package_label) {
457+
dst->package_label = kstrdup(src->package_label, GFP_KERNEL);
458+
if (!dst->package_label)
459+
goto err_package_label;
460+
}
461+
462+
return 0;
463+
464+
err_package_label:
465+
kfree(dst->panel_label);
466+
err_panel_label:
467+
kfree(dst->board_label);
468+
err_board_label:
469+
kfree(dst->freq_supported);
470+
return -ENOMEM;
471+
}
472+
428473
static struct dpll_pin *
429474
dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
430475
const struct dpll_pin_properties *prop)
@@ -441,20 +486,24 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
441486
if (WARN_ON(prop->type < DPLL_PIN_TYPE_MUX ||
442487
prop->type > DPLL_PIN_TYPE_MAX)) {
443488
ret = -EINVAL;
444-
goto err;
489+
goto err_pin_prop;
445490
}
446-
pin->prop = prop;
491+
ret = dpll_pin_prop_dup(prop, &pin->prop);
492+
if (ret)
493+
goto err_pin_prop;
447494
refcount_set(&pin->refcount, 1);
448495
xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC);
449496
xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
450497
ret = xa_alloc_cyclic(&dpll_pin_xa, &pin->id, pin, xa_limit_32b,
451498
&dpll_pin_xa_id, GFP_KERNEL);
452499
if (ret)
453-
goto err;
500+
goto err_xa_alloc;
454501
return pin;
455-
err:
502+
err_xa_alloc:
456503
xa_destroy(&pin->dpll_refs);
457504
xa_destroy(&pin->parent_refs);
505+
dpll_pin_prop_free(&pin->prop);
506+
err_pin_prop:
458507
kfree(pin);
459508
return ERR_PTR(ret);
460509
}
@@ -514,6 +563,7 @@ void dpll_pin_put(struct dpll_pin *pin)
514563
xa_destroy(&pin->dpll_refs);
515564
xa_destroy(&pin->parent_refs);
516565
xa_erase(&dpll_pin_xa, pin->id);
566+
dpll_pin_prop_free(&pin->prop);
517567
kfree(pin);
518568
}
519569
mutex_unlock(&dpll_lock);
@@ -564,8 +614,6 @@ dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin,
564614
WARN_ON(!ops->state_on_dpll_get) ||
565615
WARN_ON(!ops->direction_get))
566616
return -EINVAL;
567-
if (ASSERT_DPLL_REGISTERED(dpll))
568-
return -EINVAL;
569617

570618
mutex_lock(&dpll_lock);
571619
if (WARN_ON(!(dpll->module == pin->module &&
@@ -636,15 +684,13 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin,
636684
unsigned long i, stop;
637685
int ret;
638686

639-
if (WARN_ON(parent->prop->type != DPLL_PIN_TYPE_MUX))
687+
if (WARN_ON(parent->prop.type != DPLL_PIN_TYPE_MUX))
640688
return -EINVAL;
641689

642690
if (WARN_ON(!ops) ||
643691
WARN_ON(!ops->state_on_pin_get) ||
644692
WARN_ON(!ops->direction_get))
645693
return -EINVAL;
646-
if (ASSERT_PIN_REGISTERED(parent))
647-
return -EINVAL;
648694

649695
mutex_lock(&dpll_lock);
650696
ret = dpll_xa_ref_pin_add(&pin->parent_refs, parent, ops, priv);

drivers/dpll/dpll_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct dpll_device {
4444
* @module: module of creator
4545
* @dpll_refs: hold referencees to dplls pin was registered with
4646
* @parent_refs: hold references to parent pins pin was registered with
47-
* @prop: pointer to pin properties given by registerer
47+
* @prop: pin properties copied from the registerer
4848
* @rclk_dev_name: holds name of device when pin can recover clock from it
4949
* @refcount: refcount
5050
**/
@@ -55,7 +55,7 @@ struct dpll_pin {
5555
struct module *module;
5656
struct xarray dpll_refs;
5757
struct xarray parent_refs;
58-
const struct dpll_pin_properties *prop;
58+
struct dpll_pin_properties prop;
5959
refcount_t refcount;
6060
};
6161

drivers/dpll/dpll_netlink.c

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,17 @@ dpll_msg_add_pin_freq(struct sk_buff *msg, struct dpll_pin *pin,
303303
if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY, sizeof(freq), &freq,
304304
DPLL_A_PIN_PAD))
305305
return -EMSGSIZE;
306-
for (fs = 0; fs < pin->prop->freq_supported_num; fs++) {
306+
for (fs = 0; fs < pin->prop.freq_supported_num; fs++) {
307307
nest = nla_nest_start(msg, DPLL_A_PIN_FREQUENCY_SUPPORTED);
308308
if (!nest)
309309
return -EMSGSIZE;
310-
freq = pin->prop->freq_supported[fs].min;
310+
freq = pin->prop.freq_supported[fs].min;
311311
if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY_MIN, sizeof(freq),
312312
&freq, DPLL_A_PIN_PAD)) {
313313
nla_nest_cancel(msg, nest);
314314
return -EMSGSIZE;
315315
}
316-
freq = pin->prop->freq_supported[fs].max;
316+
freq = pin->prop.freq_supported[fs].max;
317317
if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY_MAX, sizeof(freq),
318318
&freq, DPLL_A_PIN_PAD)) {
319319
nla_nest_cancel(msg, nest);
@@ -329,9 +329,9 @@ static bool dpll_pin_is_freq_supported(struct dpll_pin *pin, u32 freq)
329329
{
330330
int fs;
331331

332-
for (fs = 0; fs < pin->prop->freq_supported_num; fs++)
333-
if (freq >= pin->prop->freq_supported[fs].min &&
334-
freq <= pin->prop->freq_supported[fs].max)
332+
for (fs = 0; fs < pin->prop.freq_supported_num; fs++)
333+
if (freq >= pin->prop.freq_supported[fs].min &&
334+
freq <= pin->prop.freq_supported[fs].max)
335335
return true;
336336
return false;
337337
}
@@ -421,7 +421,7 @@ static int
421421
dpll_cmd_pin_get_one(struct sk_buff *msg, struct dpll_pin *pin,
422422
struct netlink_ext_ack *extack)
423423
{
424-
const struct dpll_pin_properties *prop = pin->prop;
424+
const struct dpll_pin_properties *prop = &pin->prop;
425425
struct dpll_pin_ref *ref;
426426
int ret;
427427

@@ -553,6 +553,24 @@ __dpll_device_change_ntf(struct dpll_device *dpll)
553553
return dpll_device_event_send(DPLL_CMD_DEVICE_CHANGE_NTF, dpll);
554554
}
555555

556+
static bool dpll_pin_available(struct dpll_pin *pin)
557+
{
558+
struct dpll_pin_ref *par_ref;
559+
unsigned long i;
560+
561+
if (!xa_get_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED))
562+
return false;
563+
xa_for_each(&pin->parent_refs, i, par_ref)
564+
if (xa_get_mark(&dpll_pin_xa, par_ref->pin->id,
565+
DPLL_REGISTERED))
566+
return true;
567+
xa_for_each(&pin->dpll_refs, i, par_ref)
568+
if (xa_get_mark(&dpll_device_xa, par_ref->dpll->id,
569+
DPLL_REGISTERED))
570+
return true;
571+
return false;
572+
}
573+
556574
/**
557575
* dpll_device_change_ntf - notify that the dpll device has been changed
558576
* @dpll: registered dpll pointer
@@ -579,7 +597,7 @@ dpll_pin_event_send(enum dpll_cmd event, struct dpll_pin *pin)
579597
int ret = -ENOMEM;
580598
void *hdr;
581599

582-
if (WARN_ON(!xa_get_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED)))
600+
if (!dpll_pin_available(pin))
583601
return -ENODEV;
584602

585603
msg = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
@@ -717,7 +735,7 @@ dpll_pin_on_pin_state_set(struct dpll_pin *pin, u32 parent_idx,
717735
int ret;
718736

719737
if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
720-
pin->prop->capabilities)) {
738+
pin->prop.capabilities)) {
721739
NL_SET_ERR_MSG(extack, "state changing is not allowed");
722740
return -EOPNOTSUPP;
723741
}
@@ -753,7 +771,7 @@ dpll_pin_state_set(struct dpll_device *dpll, struct dpll_pin *pin,
753771
int ret;
754772

755773
if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
756-
pin->prop->capabilities)) {
774+
pin->prop.capabilities)) {
757775
NL_SET_ERR_MSG(extack, "state changing is not allowed");
758776
return -EOPNOTSUPP;
759777
}
@@ -780,7 +798,7 @@ dpll_pin_prio_set(struct dpll_device *dpll, struct dpll_pin *pin,
780798
int ret;
781799

782800
if (!(DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE &
783-
pin->prop->capabilities)) {
801+
pin->prop.capabilities)) {
784802
NL_SET_ERR_MSG(extack, "prio changing is not allowed");
785803
return -EOPNOTSUPP;
786804
}
@@ -808,7 +826,7 @@ dpll_pin_direction_set(struct dpll_pin *pin, struct dpll_device *dpll,
808826
int ret;
809827

810828
if (!(DPLL_PIN_CAPABILITIES_DIRECTION_CAN_CHANGE &
811-
pin->prop->capabilities)) {
829+
pin->prop.capabilities)) {
812830
NL_SET_ERR_MSG(extack, "direction changing is not allowed");
813831
return -EOPNOTSUPP;
814832
}
@@ -838,8 +856,8 @@ dpll_pin_phase_adj_set(struct dpll_pin *pin, struct nlattr *phase_adj_attr,
838856
int ret;
839857

840858
phase_adj = nla_get_s32(phase_adj_attr);
841-
if (phase_adj > pin->prop->phase_range.max ||
842-
phase_adj < pin->prop->phase_range.min) {
859+
if (phase_adj > pin->prop.phase_range.max ||
860+
phase_adj < pin->prop.phase_range.min) {
843861
NL_SET_ERR_MSG_ATTR(extack, phase_adj_attr,
844862
"phase adjust value not supported");
845863
return -EINVAL;
@@ -1023,7 +1041,7 @@ dpll_pin_find(u64 clock_id, struct nlattr *mod_name_attr,
10231041
unsigned long i;
10241042

10251043
xa_for_each_marked(&dpll_pin_xa, i, pin, DPLL_REGISTERED) {
1026-
prop = pin->prop;
1044+
prop = &pin->prop;
10271045
cid_match = clock_id ? pin->clock_id == clock_id : true;
10281046
mod_match = mod_name_attr && module_name(pin->module) ?
10291047
!nla_strcmp(mod_name_attr,
@@ -1130,6 +1148,10 @@ int dpll_nl_pin_id_get_doit(struct sk_buff *skb, struct genl_info *info)
11301148
}
11311149
pin = dpll_pin_find_from_nlattr(info);
11321150
if (!IS_ERR(pin)) {
1151+
if (!dpll_pin_available(pin)) {
1152+
nlmsg_free(msg);
1153+
return -ENODEV;
1154+
}
11331155
ret = dpll_msg_add_pin_handle(msg, pin);
11341156
if (ret) {
11351157
nlmsg_free(msg);
@@ -1179,6 +1201,8 @@ int dpll_nl_pin_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
11791201

11801202
xa_for_each_marked_start(&dpll_pin_xa, i, pin, DPLL_REGISTERED,
11811203
ctx->idx) {
1204+
if (!dpll_pin_available(pin))
1205+
continue;
11821206
hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid,
11831207
cb->nlh->nlmsg_seq,
11841208
&dpll_nl_family, NLM_F_MULTI,
@@ -1441,7 +1465,8 @@ int dpll_pin_pre_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
14411465
}
14421466
info->user_ptr[0] = xa_load(&dpll_pin_xa,
14431467
nla_get_u32(info->attrs[DPLL_A_PIN_ID]));
1444-
if (!info->user_ptr[0]) {
1468+
if (!info->user_ptr[0] ||
1469+
!dpll_pin_available(info->user_ptr[0])) {
14451470
NL_SET_ERR_MSG(info->extack, "pin not found");
14461471
ret = -ENODEV;
14471472
goto unlock_dev;

drivers/net/ethernet/8390/8390.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,5 @@ static void __exit ns8390_module_exit(void)
100100
module_init(ns8390_module_init);
101101
module_exit(ns8390_module_exit);
102102
#endif /* MODULE */
103+
MODULE_DESCRIPTION("National Semiconductor 8390 core driver");
103104
MODULE_LICENSE("GPL");

drivers/net/ethernet/8390/8390p.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,5 @@ static void __exit NS8390p_cleanup_module(void)
102102

103103
module_init(NS8390p_init_module);
104104
module_exit(NS8390p_cleanup_module);
105+
MODULE_DESCRIPTION("National Semiconductor 8390 core for ISA driver");
105106
MODULE_LICENSE("GPL");

drivers/net/ethernet/8390/apne.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,5 @@ static int init_pcmcia(void)
610610
return 1;
611611
}
612612

613+
MODULE_DESCRIPTION("National Semiconductor 8390 Amiga PCMCIA ethernet driver");
613614
MODULE_LICENSE("GPL");

drivers/net/ethernet/8390/hydra.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,5 @@ static void __exit hydra_cleanup_module(void)
270270
module_init(hydra_init_module);
271271
module_exit(hydra_cleanup_module);
272272

273+
MODULE_DESCRIPTION("Zorro-II Hydra 8390 ethernet driver");
273274
MODULE_LICENSE("GPL");

drivers/net/ethernet/8390/stnic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,5 @@ static void __exit stnic_cleanup(void)
296296

297297
module_init(stnic_probe);
298298
module_exit(stnic_cleanup);
299+
MODULE_DESCRIPTION("National Semiconductor DP83902AV ethernet driver");
299300
MODULE_LICENSE("GPL");

drivers/net/ethernet/8390/zorro8390.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,4 +443,5 @@ static void __exit zorro8390_cleanup_module(void)
443443
module_init(zorro8390_init_module);
444444
module_exit(zorro8390_cleanup_module);
445445

446+
MODULE_DESCRIPTION("Zorro NS8390-based ethernet driver");
446447
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)