rgb-cln/channeld
Rusty Russell 378d73cd96 channeld: fix dev_disconnect doublefree crash.
We shouldn't unconditionally free msg in enqueue_peer_msg:

DEBUG: lightning_channeld-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1: dev_disconnect: @WIRE_REVOKE_AND_ACK
BROKEN: lightning_channeld-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1: FATAL SIGNAL 6 (version 8aae6a8)
...
BROKEN: lightning_channeld-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1: backtrace: ccan/ccan/tal/tal.c:98 (call_error) 0x80855d1
BROKEN: lightning_channeld-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1: backtrace: ccan/ccan/tal/tal.c:170 (check_bounds) 0x8085730
BROKEN: lightning_channeld-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1: backtrace: ccan/ccan/tal/tal.c:181 (to_tal_hdr) 0x8085791
BROKEN: lightning_channeld-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1: backtrace: ccan/ccan/tal/tal.c:504 (tal_free) 0x8085fe6
BROKEN: lightning_channeld-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1: backtrace: channeld/channel.c:2651 (main) 0x8050639

For additional safety, handle each msg allocation separately, rather than
freeing at bottom of large branch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-07-26 14:33:23 +02:00
..
test channeld: make channel_fulfill_htlc return the HTLC it fulfulled. 2018-07-08 15:56:34 +02:00
Makefile gossipd: handle ping messages for remote peers too. 2018-07-25 02:13:52 +00:00
channel.c channeld: fix dev_disconnect doublefree crash. 2018-07-26 14:33:23 +02:00
channel_wire.csv gossipd: handle ping messages for remote peers too. 2018-07-25 02:13:52 +00:00
channeld_htlc.h channeld: handle HTLCs failed by failcode uniformly. 2018-07-08 15:56:34 +02:00
commit_tx.c channeld: fix up BOLT references. 2018-06-18 12:31:09 +02:00
commit_tx.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00
full_channel.c common/keyset: use struct basepoints rather than open-coding fields. 2018-07-24 00:40:01 +02:00
full_channel.h channeld: make channel_fulfill_htlc return the HTLC it fulfulled. 2018-07-08 15:56:34 +02:00
full_channel_error.h channeld: map htlc add/remove errors to names. 2018-02-19 02:56:51 +00:00