<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 9 October 2017 at 05:49, Antony Antony <span dir="ltr"><<a href="mailto:antony@phenome.org" target="_blank">antony@phenome.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I link with Electric Fence. It will detect double free, and cause<br>
Segmentation fault. It kicks in before libreswan magic is executed.<br>
<br>
Here is an example. The passert in pfree(), before your patch is applied, do<br>
not provide any extra info in when linked with efnece.<br>
<br>
I just tried a double free, forced.<br>
<br>
(gdb) bt<br>
#0  0x0000559283461279 in pfree (ptr=0x7f36f14a4fe8) at<br>
/home/build/libreswan/lib/<wbr>libswan/alloc.c:132<br>
#1  0x00005592833e5db7 in free_pluto_main () at<br>
/home/build/libreswan/<wbr>programs/pluto/plutomain.c:161<br>
#2  0x00005592833e8dc3 in exit_pluto (status=0) at<br>
/home/build/libreswan/<wbr>programs/pluto/plutomain.c:<wbr>1858<br>
#3  0x0000559283444b90 in whack_handle (whackctlfd=4)<br>
    at /home/build/libreswan/<wbr>programs/pluto/rcv_whack.c:750<br>
#4  0x0000559283444908 in whack_handle_cb (fd=4, event=2, arg=0x0)<br>
<br>
Note the passert, libreswan magic stuff we added did not execute.<br>
<br>
If we go down path to add layers magical things to protect double free they<br>
seems to compete and resulting logs will depend how many layres active.<br>
This confuse me, just sharing my thought.<br><br></blockquote><div>Thats why I'm posting this.</div><div><br></div><div>But remember, we've already gone down this path with the existing code.  And it is very unlikely that end users will enable electric fence.</div><div><br></div><div>I'll push the LEAK_MAGIC change, but with more specific wording.</div><div><br></div><div>Andrew</div><div><br></div></div><br></div></div>