[Swan-dev] crash after pluto: Fix addresspool reference count

Wolfgang Nothdurft wolfgang at linogate.de
Thu Oct 5 12:52:06 UTC 2017


Am 05.10.2017 um 10:13 schrieb Antony Antony:
> Hi Wolfgang,
> 
> Thanks for the config so far I only looked at test run result.
> 
> Test run shutdown crash after Paul applied the patch bd3a5f01e7c5c7ced
> Here is the backtrace I see:
> https://swantest.libreswan.fi/results/blackswan/2017-10-03-swantest-3.22dr2-487-gaa90cdeb8-master/xauth-pluto-16/OUTPUT/east.core.txt
> 
> Could please get some more information?
> Are you running 3.21 + patch or librewan master? Could you do a quick test
> with your patch "ipsec stop". Does it crash?
> 
> If it does not crash not crash for you, please another test with
> "plutodebug=all"
> 
> Just bring up the connection and "ipsec stop"

The problem is that now with the removed leaking reference_addresspool 
in connections.c the address pool is freed to early and therefore 
crashed on stop.

So it needs another references when a lease is given (see attached patch).

But there is another problem. A pending connection from the initiator 
can delete the addresspool, because the unreference_addresspool is 
called every time a instance is deleted, even if it haven't increased 
the pool_refcount by itself.
So if you restart the server the addresspool is initialised and the 
initiator can delete the addresspool when trying to reconnect without 
referencing it.

So the unreference_addresspool has to move from connection.c or called 
only if it is sure that the connection has referenced the addresspool.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: libreswan-fix-addresspool-references.patch
Type: text/x-patch
Size: 674 bytes
Desc: not available
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20171005/9877102c/attachment.bin>


More information about the Swan-dev mailing list