Skip to content

Commit

Permalink
tgupdate: merge t/mptcp-fix-possible-memory-leak-on-syn_recv-race bas…
Browse files Browse the repository at this point in the history
…e into t/mptcp-fix-possible-memory-leak-on-syn_recv-race
  • Loading branch information
jenkins-tessares committed Mar 8, 2023
2 parents 272ba3a + 4188a0b commit 413207f
Show file tree
Hide file tree
Showing 29 changed files with 59 additions and 31 deletions.
7 changes: 6 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ Mauro Carvalho Chehab <[email protected]> <[email protected]>
Mauro Carvalho Chehab <[email protected]> <[email protected]>
Mauro Carvalho Chehab <[email protected]> <[email protected]>
Mauro Carvalho Chehab <[email protected]> <[email protected]>
Maxim Mikityanskiy <[email protected]> <[email protected]>
Maxim Mikityanskiy <[email protected]> <[email protected]>
Maxime Ripard <[email protected]> <[email protected]>
Maxime Ripard <[email protected]> <[email protected]>
Mayuresh Janorkar <[email protected]>
Expand Down Expand Up @@ -409,7 +411,10 @@ Shuah Khan <[email protected]> <[email protected]>
Simon Arlott <[email protected]> <[email protected]>
Simon Kelley <[email protected]>
Stéphane Witzmann <[email protected]>
Stephen Hemminger <[email protected]>
Stephen Hemminger <[email protected]> <[email protected]>
Stephen Hemminger <[email protected]> <[email protected]>
Stephen Hemminger <[email protected]> <[email protected]>
Stephen Hemminger <[email protected]> <[email protected]>
Steve Wise <[email protected]> <[email protected]>
Steve Wise <[email protected]> <[email protected]>
Subash Abhinov Kasiviswanathan <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion Documentation/netlink/genetlink-c.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
%YAML 1.2
---
$id: http://kernel.org/schemas/netlink/genetlink-c.yaml#
Expand Down
2 changes: 1 addition & 1 deletion Documentation/netlink/genetlink-legacy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
%YAML 1.2
---
$id: http://kernel.org/schemas/netlink/genetlink-legacy.yaml#
Expand Down
2 changes: 1 addition & 1 deletion Documentation/netlink/genetlink.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
%YAML 1.2
---
$id: http://kernel.org/schemas/netlink/genetlink-legacy.yaml#
Expand Down
2 changes: 2 additions & 0 deletions Documentation/netlink/specs/ethtool.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

name: ethtool

protocol: genetlink-legacy
Expand Down
2 changes: 2 additions & 0 deletions Documentation/netlink/specs/fou.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

name: fou

protocol: genetlink-legacy
Expand Down
2 changes: 2 additions & 0 deletions Documentation/netlink/specs/netdev.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

name: netdev

doc:
Expand Down
3 changes: 3 additions & 0 deletions Documentation/userspace-api/netlink/specs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ YAML specifications can be found under ``Documentation/netlink/specs/``
This document describes details of the schema.
See :doc:`intro-specs` for a practical starting guide.

All specs must be licensed under ``GPL-2.0-only OR BSD-3-Clause``
to allow for easy adoption in user space code.

Compatibility levels
====================

Expand Down
5 changes: 5 additions & 0 deletions drivers/net/usb/cdc_mbim.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,11 @@ static const struct usb_device_id mbim_devs[] = {
.driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle,
},

/* Telit FE990 */
{ USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x1081, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle,
},

/* default entry */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&cdc_mbim_info_zlp,
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/qmi_wwan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,7 @@ static const struct usb_device_id products[] = {
{QMI_QUIRK_SET_DTR(0x1bc7, 0x1057, 2)}, /* Telit FN980 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x1070, 2)}, /* Telit FN990 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x1080, 2)}, /* Telit FE990 */
{QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */
{QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */
{QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
Expand Down
7 changes: 7 additions & 0 deletions include/net/netfilter/nf_tproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ static inline bool nf_tproxy_sk_is_transparent(struct sock *sk)
return false;
}

static inline void nf_tproxy_twsk_deschedule_put(struct inet_timewait_sock *tw)
{
local_bh_disable();
inet_twsk_deschedule_put(tw);
local_bh_enable();
}

/* assign a socket to the skb -- consumes sk */
static inline void nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)
{
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/linux/fou.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/fou.yaml */
/* YNL-GEN uapi header */
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/linux/netdev.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/netdev.yaml */
/* YNL-GEN uapi header */
Expand Down
2 changes: 1 addition & 1 deletion net/core/netdev-genl-gen.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/netdev.yaml */
/* YNL-GEN kernel source */
Expand Down
2 changes: 1 addition & 1 deletion net/core/netdev-genl-gen.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/netdev.yaml */
/* YNL-GEN kernel header */
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/fou_nl.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/fou.yaml */
/* YNL-GEN kernel source */
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/fou_nl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/fou.yaml */
/* YNL-GEN kernel header */
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/nf_tproxy_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ nf_tproxy_handle_time_wait4(struct net *net, struct sk_buff *skb,
hp->source, lport ? lport : hp->dest,
skb->dev, NF_TPROXY_LOOKUP_LISTENER);
if (sk2) {
inet_twsk_deschedule_put(inet_twsk(sk));
nf_tproxy_twsk_deschedule_put(inet_twsk(sk));
sk = sk2;
}
}
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/nf_tproxy_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ nf_tproxy_handle_time_wait6(struct sk_buff *skb, int tproto, int thoff,
lport ? lport : hp->dest,
skb->dev, NF_TPROXY_LOOKUP_LISTENER);
if (sk2) {
inet_twsk_deschedule_put(inet_twsk(sk));
nf_tproxy_twsk_deschedule_put(inet_twsk(sk));
sk = sk2;
}
}
Expand Down
4 changes: 2 additions & 2 deletions net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ static DEFINE_MUTEX(nf_conntrack_mutex);
#define GC_SCAN_MAX_DURATION msecs_to_jiffies(10)
#define GC_SCAN_EXPIRED_MAX (64000u / HZ)

#define MIN_CHAINLEN 8u
#define MAX_CHAINLEN (32u - MIN_CHAINLEN)
#define MIN_CHAINLEN 50u
#define MAX_CHAINLEN (80u - MIN_CHAINLEN)

static struct conntrack_gc_work conntrack_gc_work;

Expand Down
14 changes: 7 additions & 7 deletions net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,12 @@ ctnetlink_dump_timestamp(struct sk_buff *skb, const struct nf_conn *ct)
}

#ifdef CONFIG_NF_CONNTRACK_MARK
static int ctnetlink_dump_mark(struct sk_buff *skb, const struct nf_conn *ct)
static int ctnetlink_dump_mark(struct sk_buff *skb, const struct nf_conn *ct,
bool dump)
{
u32 mark = READ_ONCE(ct->mark);

if (!mark)
if (!mark && !dump)
return 0;

if (nla_put_be32(skb, CTA_MARK, htonl(mark)))
Expand All @@ -343,7 +344,7 @@ static int ctnetlink_dump_mark(struct sk_buff *skb, const struct nf_conn *ct)
return -1;
}
#else
#define ctnetlink_dump_mark(a, b) (0)
#define ctnetlink_dump_mark(a, b, c) (0)
#endif

#ifdef CONFIG_NF_CONNTRACK_SECMARK
Expand Down Expand Up @@ -548,7 +549,7 @@ static int ctnetlink_dump_extinfo(struct sk_buff *skb,
static int ctnetlink_dump_info(struct sk_buff *skb, struct nf_conn *ct)
{
if (ctnetlink_dump_status(skb, ct) < 0 ||
ctnetlink_dump_mark(skb, ct) < 0 ||
ctnetlink_dump_mark(skb, ct, true) < 0 ||
ctnetlink_dump_secctx(skb, ct) < 0 ||
ctnetlink_dump_id(skb, ct) < 0 ||
ctnetlink_dump_use(skb, ct) < 0 ||
Expand Down Expand Up @@ -831,8 +832,7 @@ ctnetlink_conntrack_event(unsigned int events, const struct nf_ct_event *item)
}

#ifdef CONFIG_NF_CONNTRACK_MARK
if (events & (1 << IPCT_MARK) &&
ctnetlink_dump_mark(skb, ct) < 0)
if (ctnetlink_dump_mark(skb, ct, events & (1 << IPCT_MARK)))
goto nla_put_failure;
#endif
nlmsg_end(skb, nlh);
Expand Down Expand Up @@ -2735,7 +2735,7 @@ static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct)
goto nla_put_failure;

#ifdef CONFIG_NF_CONNTRACK_MARK
if (ctnetlink_dump_mark(skb, ct) < 0)
if (ctnetlink_dump_mark(skb, ct, true) < 0)
goto nla_put_failure;
#endif
if (ctnetlink_dump_labels(skb, ct) < 0)
Expand Down
2 changes: 1 addition & 1 deletion net/nfc/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,8 @@ static int nfc_se_io(struct nfc_dev *dev, u32 se_idx,
return rc;

error:
kfree(cb_context);
device_unlock(&dev->dev);
kfree(cb_context);
return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/include/uapi/linux/netdev.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/netdev.yaml */
/* YNL-GEN uapi header */
Expand Down
2 changes: 1 addition & 1 deletion tools/net/ynl/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

import argparse
import json
Expand Down
2 changes: 1 addition & 1 deletion tools/net/ynl/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

from .nlspec import SpecAttr, SpecAttrSet, SpecFamily, SpecOperation
from .ynl import YnlFamily
Expand Down
2 changes: 1 addition & 1 deletion tools/net/ynl/lib/nlspec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

import collections
import importlib
Expand Down
2 changes: 1 addition & 1 deletion tools/net/ynl/lib/ynl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

import functools
import os
Expand Down
7 changes: 4 additions & 3 deletions tools/net/ynl/ynl-gen-c.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

import argparse
import collections
Expand Down Expand Up @@ -2127,12 +2128,12 @@ def main():

_, spec_kernel = find_kernel_root(args.spec)
if args.mode == 'uapi':
cw.p('/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */')
cw.p('/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause */')
else:
if args.header:
cw.p('/* SPDX-License-Identifier: BSD-3-Clause */')
cw.p('/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */')
else:
cw.p('// SPDX-License-Identifier: BSD-3-Clause')
cw.p('// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause')
cw.p("/* Do not edit directly, auto-generated from: */")
cw.p(f"/*\t{spec_kernel} */")
cw.p(f"/* YNL-GEN {args.mode} {'header' if args.header else 'source'} */")
Expand Down
2 changes: 1 addition & 1 deletion tools/net/ynl/ynl-regen.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

TOOL=$(dirname $(realpath $0))/ynl-gen-c.py

Expand Down

0 comments on commit 413207f

Please sign in to comment.