<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/l2tp/l2tp_core.c, branch linux-5.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-07-30T23:45:31Z</updated>
<entry>
<title>l2tp: tweak exports for l2tp_recv_common and l2tp_ioctl</title>
<updated>2020-07-30T23:45:31Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-28T17:20:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca7885dbcd899e63e47c33707c1615d9dd281c7f'/>
<id>urn:sha1:ca7885dbcd899e63e47c33707c1615d9dd281c7f</id>
<content type='text'>
All of the l2tp subsystem's exported symbols are exported using
EXPORT_SYMBOL_GPL, except for l2tp_recv_common and l2tp_ioctl.

These functions alone are not useful without the rest of the l2tp
infrastructure, so there's no practical benefit to these symbols using a
different export policy.

Change these exports to use EXPORT_SYMBOL_GPL for consistency with the
rest of l2tp.

Signed-off-by: Tom Parkin &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: remove build_header callback in struct l2tp_session</title>
<updated>2020-07-30T23:45:31Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-28T17:20:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2dedab6ff57edd29848391fa917a8f96c4f82583'/>
<id>urn:sha1:2dedab6ff57edd29848391fa917a8f96c4f82583</id>
<content type='text'>
The structure of an L2TP data packet header varies depending on the
version of the L2TP protocol being used.

struct l2tp_session used to have a build_header callback to abstract
this difference away.  It's clearer to simply choose the correct
function to use when building the data packet (and 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 &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: return void from l2tp_session_delete</title>
<updated>2020-07-30T23:45:31Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-28T17:20:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=628703f59dcc832a0bd04b4fa41d856e5df98112'/>
<id>urn:sha1:628703f59dcc832a0bd04b4fa41d856e5df98112</id>
<content type='text'>
l2tp_session_delete is used to schedule a session instance for deletion.
The function itself always returns zero, and none of its direct callers
check its return value, so have the function return void.

This change de-facto changes the l2tp netlink session_delete callback
prototype since all pseudowires currently use l2tp_session_delete for
their implementation of that operation.

Signed-off-by: Tom Parkin &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: don't export tunnel and session free functions</title>
<updated>2020-07-30T23:45:31Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-28T17:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52016e259bab98613453e29d42f2ffe456feee11'/>
<id>urn:sha1:52016e259bab98613453e29d42f2ffe456feee11</id>
<content type='text'>
Tunnel and session instances are reference counted, and shouldn't be
directly freed by pseudowire code.

Rather than exporting l2tp_tunnel_free and l2tp_session_free, make them
private to l2tp_core.c, and export the refcount functions instead.

In order to do this, the refcount functions cannot 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 &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: don't export __l2tp_session_unhash</title>
<updated>2020-07-30T23:45:31Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-28T17:20:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2aecfe8e49059a69379a521aa68b4f55516780f'/>
<id>urn:sha1:b2aecfe8e49059a69379a521aa68b4f55516780f</id>
<content type='text'>
When __l2tp_session_unhash was first added it was used outside of
l2tp_core.c, but that's no longer the case.

As such, there's no longer a need to export the function.  Make it
private inside l2tp_core.c, and relocate it to avoid having to declare
the function prototype in l2tp_core.h.

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 &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: WARN_ON rather than BUG_ON in l2tp_session_free</title>
<updated>2020-07-25T00:19:14Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-24T15:31:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ab6934e084e5eee665adf6e834e5096ebae4a95f'/>
<id>urn:sha1:ab6934e084e5eee665adf6e834e5096ebae4a95f</id>
<content type='text'>
l2tp_session_free called BUG_ON if the tunnel magic feather value wasn't
correct.  The intent of this was to catch lifetime bugs; for example
early tunnel free due to incorrect use of reference counts.

Since the tunnel magic feather being wrong indicates either early free
or structure corruption, 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 &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: remove BUG_ON refcount value in l2tp_session_free</title>
<updated>2020-07-25T00:19:14Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-24T15:31:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0dd62f69d898de3cf31a2f8b59e9a62bb5448457'/>
<id>urn:sha1:0dd62f69d898de3cf31a2f8b59e9a62bb5448457</id>
<content type='text'>
l2tp_session_free is only called by l2tp_session_dec_refcount when the
reference count reaches zero, so it's of limited value to validate the
reference count value in l2tp_session_free itself.

Signed-off-by: Tom Parkin &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: WARN_ON rather than BUG_ON in l2tp_session_queue_purge</title>
<updated>2020-07-25T00:19:14Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-24T15:31:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=493048f5dfcd0093880414928717f68613ba9157'/>
<id>urn:sha1:493048f5dfcd0093880414928717f68613ba9157</id>
<content type='text'>
l2tp_session_queue_purge is used during session shutdown to drop any
skbs queued for reordering purposes according to L2TP dataplane rules.

The BUG_ON in this function checks the session magic feather in an
attempt to catch lifetime bugs.

Rather than crashing the kernel with a BUG_ON, we can simply WARN_ON and
refuse to do anything more -- in the worst case this could result in a
leak.  However this is highly unlikely given that the session purge only
occurs from codepaths which have obtained the session by means of a lookup
via. the parent tunnel and which check the session "dead" 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 &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: remove BUG_ON in l2tp_tunnel_closeall</title>
<updated>2020-07-25T00:19:14Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-24T15:31:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd3e29b333cc2571a5875d1b45c460dc948a2f95'/>
<id>urn:sha1:cd3e29b333cc2571a5875d1b45c460dc948a2f95</id>
<content type='text'>
l2tp_tunnel_closeall is only called from l2tp_core.c, and it's easy
to statically analyse the code path calling it to validate that it
should never be passed a NULL tunnel pointer.

Having a BUG_ON checking the tunnel pointer triggers a checkpatch
warning.  Since the BUG_ON is of no value, remove it to avoid the
warning.

Signed-off-by: Tom Parkin &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>l2tp: remove BUG_ON in l2tp_session_queue_purge</title>
<updated>2020-07-25T00:19:14Z</updated>
<author>
<name>Tom Parkin</name>
</author>
<published>2020-07-24T15:31:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce2f86ae253de3f3e961d4f91438604a97c29752'/>
<id>urn:sha1:ce2f86ae253de3f3e961d4f91438604a97c29752</id>
<content type='text'>
l2tp_session_queue_purge is only called from l2tp_core.c, and it's easy
to statically analyse the code paths calling it to validate that it
should never be passed a NULL session pointer.

Having a BUG_ON checking the session pointer triggers a checkpatch
warning.  Since the BUG_ON is of no value, remove it to avoid the
warning.

Signed-off-by: Tom Parkin &lt;tparkin@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
