On Tue, Apr 13, 2021 at 17:30:17 +, Gong, Sishuai wrote:
> Hi,
>
> We found a concurrency bug in linux 5.12-rc3 and we are able to reproduce it
> under x86. This bug happens when two l2tp functions l2tp_tunnel_register()
> and l2tp_xmit_core() are running in parallel. In general,
> l2tp_tu
On Mon, Mar 15, 2021 at 13:18:24 +0100, Guillaume Nault wrote:
> On Fri, Mar 12, 2021 at 10:47:53PM +0800, lyl2...@mail.ustc.edu.cn wrote:
> >
> >
> >
> > > -原始邮件-
> > > 发件人: "Tom Parkin"
> > > 发送时间: 2021-03-12 18:12:
On Fri, Mar 12, 2021 at 22:47:53 +0800, lyl2...@mail.ustc.edu.cn wrote:
>
>
>
> > -原始邮件-----
> > 发件人: "Tom Parkin"
> > 发送时间: 2021-03-12 18:12:58 (星期五)
> > 收件人: lyl2...@mail.ustc.edu.cn
> > 抄送: pau...@samba.org, da...@davemloft.net, linux
Thanks for the report!
On Thu, Mar 11, 2021 at 20:34:44 +0800, lyl2...@mail.ustc.edu.cn wrote:
> File: drivers/net/ppp/ppp_generic.c
>
> In ppp_unregister_channel, pch could be freed in ppp_unbridge_channels()
> but after that pch is still in use. Inside the function ppp_unbridge_channels,
> if
On Wed, Mar 03, 2021 at 16:50:49 +0100, Matthias Schiffer wrote:
> Commit 5ee759cda51b ("l2tp: use standard API for warning log messages")
> changed a number of warnings about invalid packets in the receive path
> so that they are always shown, instead of only when a special L2TP debug
> flag is s
On Mon, Feb 22, 2021 at 14:31:38 -0800, Jakub Kicinski wrote:
> On Mon, 22 Feb 2021 17:40:16 +0100 Matthias Schiffer wrote:
> > >> This will not be sufficient for my usecase: To stay compatible with older
> > >> versions of fastd, I can't set the T flag in the first packet of the
> > >> handshake,
On Mon, Feb 22, 2021 at 17:40:16 +0100, Matthias Schiffer wrote:
> On 2/22/21 12:49 PM, Tom Parkin wrote:
> > On Sat, Feb 20, 2021 at 10:56:33 +0100, Matthias Schiffer wrote:
> > > On 2/19/21 9:12 PM, Tom Parkin wrote:
> > > > On Fri, Feb 19, 2021 at 20:06:15
On Sat, Feb 20, 2021 at 10:56:33 +0100, Matthias Schiffer wrote:
> On 2/19/21 9:12 PM, Tom Parkin wrote:
> > On Fri, Feb 19, 2021 at 20:06:15 +0100, Matthias Schiffer wrote:
> > > Before commit 5ee759cda51b ("l2tp: use standard API for warning log
> > > messages&
Hi Matthias,
Thanks for your patch!
On Fri, Feb 19, 2021 at 20:06:15 +0100, Matthias Schiffer wrote:
> Before commit 5ee759cda51b ("l2tp: use standard API for warning log
> messages"), it was possible for userspace applications to use their own
> control protocols on the backing sockets of an L2
t;ddp_crc != nskb->ddp_crc)
> + goto end;
> #endif
> }
> }
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 777306b5bc22..b114fc870513 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1810,6 +1810,9 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff
> *skb)
> TCP_SKB_CB(skb)->tcp_flags) & (TCPHDR_ECE | TCPHDR_CWR)) ||
> #ifdef CONFIG_TLS_DEVICE
> tail->decrypted != skb->decrypted ||
> +#endif
> +#ifdef CONFIG_TCP_DDP
> + tail->ddp_crc != skb->ddp_crc ||
> #endif
> thtail->doff != th->doff ||
> memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th)))
> diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
> index e09147ac9a99..3ce196375d94 100644
> --- a/net/ipv4/tcp_offload.c
> +++ b/net/ipv4/tcp_offload.c
> @@ -262,6 +262,9 @@ struct sk_buff *tcp_gro_receive(struct list_head *head,
> struct sk_buff *skb)
> #ifdef CONFIG_TLS_DEVICE
> flush |= p->decrypted ^ skb->decrypted;
> #endif
> +#ifdef CONFIG_TCP_DDP
> + flush |= p->ddp_crc ^ skb->ddp_crc;
> +#endif
>
> if (flush || skb_gro_receive(p, skb)) {
> mss = 1;
> --
> 2.24.1
>
--
Tom Parkin
Katalix Systems Ltd
https://katalix.com
Catalysts for your Embedded Linux software development
signature.asc
Description: PGP signature
On Fri, Jan 08, 2021 at 21:57:50 +0100, Guillaume Nault wrote:
> On Thu, Jan 07, 2021 at 06:13:15PM +0000, Tom Parkin wrote:
> > When setting up a channel bridge, ppp_bridge_channels sets the
> > pch->bridge field before taking the associated reference on the bridge
before it is unset by the error path, it will erroneously drop the
reference on the bridged channel and cause a refcount underflow.
To avoid this, ensure that ppp_bridge_channels holds a reference on
each channel in advance of setting the bridge pointers.
Signed-off-by: Tom Parkin
Fixes: 4cf4
When setting up a channel bridge, ppp_bridge_channels sets the
pch->bridge field before taking the associated reference on the bridge
file instance.
This opens up a refcount underflow bug if ppp_bridge_channels called
via. iotcl runs concurrently with ppp_unbridge_channels executing via.
file rele
On Thu, Dec 24, 2020 at 11:28:18 +0100, Guillaume Nault wrote:
> On Wed, Dec 23, 2020 at 06:47:30PM +0000, Tom Parkin wrote:
> > Channels are bridged using the PPPIOCBRIDGECHAN ioctl, which executes
> > with the ppp_mutex held.
> >
> > Unbridging may occur in two code
underflow.
To avoid this, hold the ppp_mutex while calling ppp_unbridge_channels in
the shutdown path. This serialises the unbridge operation with any
concurrently executing ioctl.
Signed-off-by: Tom Parkin
---
drivers/net/ppp/ppp_generic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/driv
On Thu, Dec 10, 2020 at 14:21:34 -0800, David Miller wrote:
> From: Tom Parkin
> Date: Thu, 10 Dec 2020 17:16:45 +
>
> > On Thu, Dec 10, 2020 at 18:13:09 +0100, Guillaume Nault wrote:
> >> On Thu, Dec 10, 2020 at 03:50:56PM +, Tom Parkin wrote:
> >> &g
On Thu, Dec 10, 2020 at 18:13:09 +0100, Guillaume Nault wrote:
> On Thu, Dec 10, 2020 at 03:50:56PM +0000, Tom Parkin wrote:
> > Following on from my previous RFC[1], this series adds two ioctl calls
> > to the ppp code to implement "channel bridging".
> >
> &
rather than adding a new lock.
The 'upl' lock is used to protect the existing unit pointer. Since the
bridge effectively replaces the unit (they're mutually exclusive for a
channel) it makes coding easier to use the same lock to cover them
both.
Signed-off-by: Tom Park
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 16
1 file changed, 16 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
ppp_disconnect_channel.
* Improve docs update by including information on ioctl arguments
and error return codes.
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_generic.rst to document new ioctls
Documentation/networking/ppp_generi
On Mon, Dec 07, 2020 at 17:22:28 +0100, Guillaume Nault wrote:
> On Fri, Dec 04, 2020 at 04:36:55PM +0000, Tom Parkin wrote:
> > + case PPPIOCBRIDGECHAN:
> > + if (get_user(unit, p))
> > + break;
> > +
rather than adding a new lock.
The 'upl' lock is used to protect the existing unit pointer. Since the
bridge effectively replaces the unit (they're mutually exclusive for a
channel) it makes coding easier to use the same lock to cover them
both.
Signed-off-by: Tom Park
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 16
1 file changed, 16 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
part of a bridge: this better aligns with the return code from
ppp_disconnect_channel.
* Improve docs update by including information on ioctl arguments
and error return codes.
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_gen
On Thu, Dec 03, 2020 at 01:23:18 +0100, Guillaume Nault wrote:
> On Tue, Dec 01, 2020 at 11:52:49AM +0000, Tom Parkin wrote:
> > +static int ppp_bridge_channels(struct channel *pch, struct channel *pchb)
> > +{
> > + write_lock_bh(&pch->upl);
> > + if (pch
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 16
1 file changed, 16 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
rather than adding a new lock.
The 'upl' lock is used to protect the existing unit pointer. Since the
bridge effectively replaces the unit (they're mutually exclusive for a
channel) it makes coding easier to use the same lock to cover them
both.
Signed-off-by: Tom Park
27;t
part of a bridge: this better aligns with the return code from
ppp_disconnect_channel.
* Improve docs update by including information on ioctl arguments
and error return codes.
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_g
On Fri, Nov 27, 2020 at 20:31:34 +0100, Guillaume Nault wrote:
> On Thu, Nov 26, 2020 at 12:24:25PM +0000, Tom Parkin wrote:
> > This new ioctl pair allows two ppp channels to be bridged together:
> > frames arriving in one channel are transmitted in the other channel
>
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 9 +
1 file changed, 9 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
(rather than adding a new lock).
Order of lock acquisition is maintained: i.e. the channel 'upl' lock is
always acquired before 'downl' in code paths that need to hold both.
Signed-off-by: Tom Parkin
---
drivers/net/ppp/ppp_generic.c | 147 -
inclu
p_ac_pppoe_tests_2
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_generic.rst to document new ioctls
Documentation/networking/ppp_generic.rst | 9 ++
drivers/net/ppp/ppp_generic.c| 143 ++-
include/uapi
On Wed, Nov 18, 2020 at 16:44:11 +0530, siddhant gupta wrote:
> On Wed, 18 Nov 2020 at 15:53, Tom Parkin wrote:
> >
> > On Tue, Nov 17, 2020 at 15:22:07 +0530, Siddhant Gupta wrote:
> > > Fix Column span alignment problem warnings in the file
> > >
>
On Tue, Nov 17, 2020 at 15:22:07 +0530, Siddhant Gupta wrote:
> Fix Column span alignment problem warnings in the file
>
Thanks for the patch, Siddhant.
Could you provide some information on how these warnings were
triggered? Using Sphinx 2.4.4 I can't reproduce any warnings for
l2tp.rst using
On Tue, Nov 10, 2020 at 08:47:40 -0800, Jakub Kicinski wrote:
> On Tue, 10 Nov 2020 10:28:34 +0100 Guillaume Nault wrote:
> > On Mon, Nov 09, 2020 at 03:52:37PM -0800, Jakub Kicinski wrote:
> > > On Fri, 6 Nov 2020 18:16:45 + Tom Parkin wrote:
> > > > This
On Sun, Nov 15, 2020 at 17:28:38 +0100, Guillaume Nault wrote:
> On Tue, Nov 10, 2020 at 12:04:29PM +0000, Tom Parkin wrote:
> > On Tue, Nov 10, 2020 at 00:24:01 +0100, Guillaume Nault wrote:
> > > On Fri, Nov 06, 2020 at 06:16:46PM +
On Sun, Nov 15, 2020 at 12:59:59 +0100, Guillaume Nault wrote:
> On Tue, Nov 10, 2020 at 11:54:07AM +0000, Tom Parkin wrote:
> > On Mon, Nov 09, 2020 at 23:51:53 +0100, Guillaume Nault wrote:
> > > BTW, shouldn't we have an "UNBRIDGE" command to remove the
On Tue, Nov 10, 2020 at 10:28:34 +0100, Guillaume Nault wrote:
> On Mon, Nov 09, 2020 at 03:52:37PM -0800, Jakub Kicinski wrote:
> > On Fri, 6 Nov 2020 18:16:45 + Tom Parkin wrote:
> > > This small RFC series implements a suggestion from Guillaume Nault in
> > &
On Tue, Nov 10, 2020 at 00:24:01 +0100, Guillaume Nault wrote:
> On Fri, Nov 06, 2020 at 06:16:46PM +0000, Tom Parkin wrote:
> > + case PPPIOCBRIDGECHAN:
> > + if (get_user(unit, p))
> > + break;
> > +
On Mon, Nov 09, 2020 at 23:51:53 +0100, Guillaume Nault wrote:
> > * I believe that the fact we're not explicitly locking anything in the
> >ppp_input path for access to the channel bridge field is OK since:
> >
> > - ppp_input is called from the socket backlog recv
> >
> > - ppp
---
Documentation/networking/ppp_generic.rst | 5 +
1 file changed, 5 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking/ppp_generic.rst
index e60504377900..aea950ce953f 100644
--- a/Documentation/networking/ppp_generic.rst
+++ b/Documentation/netw
This new ioctl allows two ppp channels to be bridged together: frames
arriving in one channel are transmitted in the other channel and vice
versa.
The practical use for this is primarily to support the L2TP Access
Concentrator use-case. The end-user session is presented as a ppp
channel (typicall
branch:
https://github.com/katalix/go-l2tp/tree/tp_002_pppoe_2
[3]. l2tp-ktest: a test suite for the Linux Kernel L2TP subsystem
https://github.com/katalix/l2tp-ktest
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN ioctl
docs: update ppp_generic.rst to describe ioctl PPPIOCBRIDGECHAN
Documentation/netwo
On Thu, Oct 01, 2020 at 07:56:40 -0700, Jakub Kicinski wrote:
> On Wed, 30 Sep 2020 22:07:06 +0100 Tom Parkin wrote:
> > The AC/PPPoE driver implements pseudowire type L2TP_PWTYPE_PPP_AC, for
> > use in a PPPoE Access Concentrator configuration. Rather than
> > termin
On Thu, Oct 01, 2020 at 14:26:17 +0200, Guillaume Nault wrote:
> On Wed, Sep 30, 2020 at 10:07:01PM +0100, Tom Parkin wrote:
> > L2TPv2 tunnels are often used as a part of a home broadband connection,
> > using a PPP link to connect the subscriber network into the Internet
> &g
handled by l2tp_netlink for L2TPv2 sessions.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_netlink.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 8ef1a579a2b1..2abfea82203d 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b
Alongside this, add a bit more of a description of the PPP and ETH
pseudowire types.
Signed-off-by: Tom Parkin
---
Documentation/networking/l2tp.rst | 69 ++-
1 file changed, 49 insertions(+), 20 deletions(-)
diff --git a/Documentation/networking/l2tp.rst
b
in L2TPv2 tunnels.
Extend the l2tp_netlink sanity check to support PPP_AC.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_netlink.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 7045eb105e6a..8ef1a579a2b1 100644
ff-by: Tom Parkin
---
net/l2tp/l2tp_core.h| 4 +++-
net/l2tp/l2tp_eth.c | 3 ++-
net/l2tp/l2tp_netlink.c | 3 ++-
net/l2tp/l2tp_ppp.c | 3 ++-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index cb21d906343e..bd62a3e2c98d 100644
ks it into the kernel
configuration and build system.
* Patch 6 updates the l2tp documentation under Documentation/ to
include information about the new driver.
Tom Parkin (6):
l2tp: add netlink info to session create callback
l2tp: tweak netlink session create to allow L2TPv2 ac_pp
The AC PPPoE driver will require userspace to pass in both the PPPoE
session ID and the PPPoE peer's MAC address.
Add netlink attributes to allow this to be conveyed in the session
create command.
Signed-off-by: Tom Parkin
---
include/uapi/linux/l2tp.h | 2 ++
net/l2tp/l2tp_netlink.c
, to specify the name of the interface associated
with the PPPoE session;
* L2TP_ATTR_PPPOE_SESSION_ID, to specify the PPPoE session ID assigned
to the session;
* L2TP_ATTR_PPPOE_PEER_MAC_ADDR, to specify the MAC address of the
PPPoE peer
Signed-off-by: Tom Parkin
---
net/l2tp/Kconfig
instances.
Include the statistic in the netlink get response.
Signed-off-by: Tom Parkin
---
include/uapi/linux/l2tp.h | 1 +
net/l2tp/l2tp_netlink.c | 6 ++
2 files changed, 7 insertions(+)
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
index 88a0d32b8c07..30c80d5ba4bf 100644
On Mon, Sep 28, 2020 at 18:46:25 -0700, David Miller wrote:
> From: Tom Parkin
> Date: Mon, 28 Sep 2020 13:46:34 +0100
>
> > --- a/include/uapi/linux/l2tp.h
> > +++ b/include/uapi/linux/l2tp.h
> > @@ -143,6 +143,7 @@ enum {
> > L2TP_
instances.
Include the statistic in the netlink get response.
Signed-off-by: Tom Parkin
---
include/uapi/linux/l2tp.h | 1 +
net/l2tp/l2tp_netlink.c | 6 ++
2 files changed, 7 insertions(+)
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
index 88a0d32b8c07..7bf92e0606af 100644
updated correctly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 7de05be4fc33..7be5103ff2a8 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1006,7
The argument is unused, so remove it.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c| 2 +-
net/l2tp/l2tp_core.h| 2 +-
net/l2tp/l2tp_netlink.c | 2 +-
net/l2tp/l2tp_ppp.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp
rence count
sanity checking
* Add session magic validation in pppol2tp_ioctl. On failure return
-EBADF, which mirrors the approach in pppol2tp_[sg]etsockopt.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 40 ++--
net/l2tp/l2tp_core.h | 5 +
net
The data_len argument passed to l2tp_xmit_core is no longer used, so
remove it.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index c95b58b2ab3c..4a8fb285fada 100644
--- a
is very minor potential
loss of efficiency to avoid duplication of the session delete code.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 14 +-
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index b02b3cc67df0..7de05be4fc33
All callers pass the session structure's hdr_len field as the header
length parameter to l2tp_xmit_skb.
Since we're passing a pointer to the session structure to l2tp_xmit_skb
anyway, there's not much point breaking the header length out as a
separate argument.
Signed-off
magic feather" validation in l2tp to check for
sk_user_data (ab)use as opposed to refcount debugging
* remove some duplicated code
Tom Parkin (6):
l2tp: remove header length param from l2tp_xmit_skb
l2tp: drop data_len argument from l2tp_xmit_core
l2tp: drop net argument from l2tp_tun
error paths.
l2tp_xmit_skb now leaves all the actual work of transmission to
l2tp_xmit_core, and updates the statistics based on l2tp_xmit_core's
return code.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 71 +++-
1 file changed, 37 inser
messages
handle the getting and setting of debug flags. To avoid userspace
breakage don't modify the API of these calls; simply ignore set
requests, and send dummy data for get requests.
Signed-off-by: Tom Parkin
---
include/uapi/linux/if_pppol2tp.h | 2 +-
include/uapi/linux/l2tp.h
Update l2tp.rst to:
* remove information about the obsolete debug flags and their use
* include information about tracepoints for l2tp
Signed-off-by: Tom Parkin
---
Documentation/networking/l2tp.rst | 37 ---
1 file changed, 14 insertions(+), 23 deletions(-)
diff
.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h | 6 +-
net/l2tp/trace.h | 196 +++
2 files changed, 200 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index 3468d6b177a0..835c4645a0ec 100644
--- a/net/l2tp
Add lifetime event tracing for tunnel and session instances, tracking
tunnel and session registration, deletion, and eventual freeing.
Port the data path sequence number debug logging to use trace points
rather than custom debug macros.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 83
l2tp had logging to trace data frame receipt and transmission, including
code to dump packet contents. This was originally intended to aid
debugging of core l2tp packet handling, but is of limited use now that
code is stable.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 58
apath warnings without
needing to tweak the debug flags setting for a given tunnel or session
instance.
Modify l2tp_warn callsites to use pr_warn_ratelimited instead for
unconditional output of warning messages.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c
v1 -> v2
* Fix up a build warning found by the kernel test robot
Tom Parkin (9):
l2tp: don't log data frames
l2tp: remove noisy logging, use appropriate log levels
l2tp: use standard API for warning log messages
l2tp: add tracepoint infrastructure to core
l2tp: add tracepoint defi
All l2tp's informational and warning logging is now carried out using
standard kernel APIs.
Debugging information is now handled using tracepoints.
Now that no code is using the custom logging macros, remove them from
l2tp_core.h.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h
l2tp_ppp in particular had a lot of log messages for tracing
[get|set]sockopt calls. These aren't especially useful, so remove
these messages.
Several log messages flagging error conditions were logged using
l2tp_info: they're better off as l2tp_warn.
Signed-off-by: Tom Parkin
---
The l2tp subsystem doesn't currently make use of tracepoints.
As a starting point for adding tracepoints, add skeleton infrastructure
for defining tracepoints for the subsystem, and for having them build
appropriately whether compiled into the kernel or built as a module.
Signed-off-by
On Fri, Aug 21, 2020 at 20:28:59 +0800, kernel test robot wrote:
> Hi Tom,
>
> Thank you for the patch! Perhaps something to improve:
>
[snip]
>
>net/l2tp/l2tp_core.c: In function 'l2tp_recv_common':
> >> net/l2tp/l2tp_core.c:663:14: warning: variable 'nr' set but not used
> >> [-Wunused-b
apath warnings without
needing to tweak the debug flags setting for a given tunnel or session
instance.
Modify l2tp_warn callsites to use pr_warn_ratelimited instead for
unconditional output of warning messages.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c
All l2tp's informational and warning logging is now carried out using
standard kernel APIs.
Debugging information is now handled using tracepoints.
Now that no code is using the custom logging macros, remove them from
l2tp_core.h.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h
messages
handle the getting and setting of debug flags. To avoid userspace
breakage don't modify the API of these calls; simply ignore set
requests, and send dummy data for get requests.
Signed-off-by: Tom Parkin
---
include/uapi/linux/if_pppol2tp.h | 2 +-
include/uapi/linux/l2tp.h
The l2tp subsystem doesn't currently make use of tracepoints.
As a starting point for adding tracepoints, add skeleton infrastructure
for defining tracepoints for the subsystem, and for having them build
appropriately whether compiled into the kernel or built as a module.
Signed-off-by
.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h | 6 +-
net/l2tp/trace.h | 196 +++
2 files changed, 200 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index 3468d6b177a0..835c4645a0ec 100644
--- a/net/l2tp
l2tp_ppp in particular had a lot of log messages for tracing
[get|set]sockopt calls. These aren't especially useful, so remove
these messages.
Several log messages flagging error conditions were logged using
l2tp_info: they're better off as l2tp_warn.
Signed-off-by: Tom Parkin
---
Add lifetime event tracing for tunnel and session instances, tracking
tunnel and session registration, deletion, and eventual freeing.
Port the data path sequence number debug logging to use trace points
rather than custom debug macros.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 83
Update l2tp.rst to:
* remove information about the obsolete debug flags and their use
* include information about tracepoints for l2tp
Signed-off-by: Tom Parkin
---
Documentation/networking/l2tp.rst | 37 ---
1 file changed, 14 insertions(+), 23 deletions(-)
diff
l2tp had logging to trace data frame receipt and transmission, including
code to dump packet contents. This was originally intended to aid
debugging of core l2tp packet handling, but is of limited use now that
code is stable.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 44
file net/l2tp/trace.h. When adding this file I followed the
example(s) of other tracepoint files in the net/ subtree since it seemed
preferable to adhere to the prevailing style rather than follow
checkpatch.pl's advice in this instance. If that's the wrong
approach please let me know.
Tom
On Tue, Jul 28, 2020 at 11:08:45 -0700, Joe Perches wrote:
> On Tue, 2020-07-28 at 09:21 -0700, Joe Perches wrote:
> > On Tue, 2020-07-21 at 18:32 +0100, Tom Parkin wrote:
> > > checkpatch warned about the L2TP_SKB_CB macro's use of its argument: add
> >
On Tue, Jul 28, 2020 at 18:20:27 +0100, Tom Parkin wrote:
> This short series makes some minor tidyup changes to the L2TP core API.
I'm sorry, I forgot the "net-next" prefix in the subject line.
Please let me know if I should resubmit.
signature.asc
Description: PGP signature
This short series makes some minor tidyup changes to the L2TP core API.
Tom Parkin (6):
l2tp: don't export __l2tp_session_unhash
l2tp: don't export tunnel and session free functions
l2tp: return void from l2tp_session_delete
l2tp: remove build_header callback in struct l2tp_sess
pseudowires currently use l2tp_session_delete for
their implementation of that operation.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c| 9 ++---
net/l2tp/l2tp_core.h| 4 ++--
net/l2tp/l2tp_netlink.c | 2 +-
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/net/l2tp
ot be declared as
inline. Since the codepaths which take and drop tunnel and session
references are not directly in the datapath this shouldn't cause
performance issues.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 60 ++--
net/l2tp/l2tp_c
ort policy.
Change these exports to use EXPORT_SYMBOL_GPL for consistency with the
rest of l2tp.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 2 +-
net/l2tp/l2tp_ip.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 39
* Improve the description of the key l2tp subsystem data structures.
* Add high-level description of the main APIs for interacting with l2tp
core.
* Add documentation for the l2tp netlink session command callbacks.
* Document the session pseudowire callbacks.
Signed-off-by: Tom Parkin
Since the function is no longer used outside l2tp_core.c, remove the
"__" prefix since we don't need to indicate anything special about its
expected use to callers.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 57
net/l2tp/l2
nd we save on the
function pointer in the session structure).
This approach does mean dereferencing the parent tunnel structure in
order to determine the tunnel version, but we're doing that in the
transmit path in any case.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 10 --
emove it to avoid the
warning.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index a1ed8baa5aaa..6be3f2e69efd 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1188,8 +1188,6 @@ s
l2tp hasn't been kept up to date with the static analysis checks offered
by checkpatch.pl.
This patchset builds on the series: "l2tp: cleanup checkpatch.pl
warnings" and "l2tp: further checkpatch.pl cleanups" to resolve some of
the remaining checkpatch warnings in l2tp
l2tp_dfs_seq_start had a BUG_ON to catch a possible programming error in
l2tp_dfs_seq_open.
Since we can easily bail out of l2tp_dfs_seq_start, prefer to do that
and flag the error with a WARN_ON rather than crashing the kernel.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_debugfs.c | 5
eturn NULL in
order to terminate the seq file processing in much the same way as we do
when reaching the end of tunnel/session instances to render.
Retain a WARN_ON to help trace possible bugs in this area.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_ppp.c | 6 +-
1 file changed, 5 inser
ption, we can avoid doing more damage by simply
leaving the tunnel structure alone. If the tunnel refcount isn't
dropped when it should be, the tunnel instance will remain in the
kernel, resulting in the tunnel structure and socket leaking.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_
t; flag to
protect against shutdown races.
While we're here, have l2tp_session_queue_purge return void rather than
an integer, since neither of the callsites checked the return value.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 7 ---
1 file changed, 4 insertions(+), 3 del
checkpatch warns about multiple assignments.
Update l2tp accordingly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 6 +++---
net/l2tp/l2tp_ip.c | 12
net/l2tp/l2tp_ip6.c | 6 --
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b
1 - 100 of 156 matches
Mail list logo