cln/plugins
Rusty Russell aac8905afd plugins/renepay/test: fix access-after-free.
We cannot carry pointers into the gossmap across localmod addition
or removal.

We didn't notice because the map->chan_arr is not normally resized,
but if we change gossmap.c line 689 to only allocate 1 to start, we see this:

```
VALGRIND=1 valgrind -q --error-exitcode=7 --track-origins=yes --leak-check=full --show-reachable=yes --errors-for-leak-kinds=all plugins/renepay/test/run-mcf > /dev/null
==2349744== Invalid read of size 4
==2349744==    at 0x1788C2: gossmap_chan_scid (gossmap.c:558)
==2349744==    by 0x1872A2: get_chan_extra_half_by_chan (flow.c:346)
==2349744==    by 0x187797: remove_completed_flow (flow.c:488)
==2349744==    by 0x187927: remove_completed_flow_set (flow.c:518)
==2349744==    by 0x18DF4D: main (run-mcf.c:393)
==2349744==  Address 0x4b80f38 is 88 bytes inside a block of size 136 free'd
==2349744==    at 0x4848C63: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2349744==    by 0x173D71: tal_resize_ (tal.c:744)
==2349744==    by 0x177E36: next_free_chan (gossmap.c:336)
==2349744==    by 0x177ED3: new_channel (gossmap.c:351)
==2349744==    by 0x178441: add_channel (gossmap.c:458)
==2349744==    by 0x1798D4: gossmap_apply_localmods (gossmap.c:904)
==2349744==    by 0x18DEDB: main (run-mcf.c:388)
==2349744==  Block was alloc'd at
==2349744==    at 0x4848C63: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2349744==    by 0x173D71: tal_resize_ (tal.c:744)
==2349744==    by 0x177E36: next_free_chan (gossmap.c:336)
==2349744==    by 0x177ED3: new_channel (gossmap.c:351)
==2349744==    by 0x178441: add_channel (gossmap.c:458)
==2349744==    by 0x178B6D: map_catchup (gossmap.c:635)
==2349744==    by 0x178F45: load_gossip_store (gossmap.c:697)
==2349744==    by 0x179D71: gossmap_load (gossmap.c:978)
==2349744==    by 0x18D22F: main (run-mcf.c:295)
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-08-15 05:32:22 +09:30
..
bkpr common/utils: add tal_strdup_or_null helper. 2023-07-26 06:55:48 +09:30
clnrest plugin/clnrest: Downgrading pyln-proto versino from 23.08 to 23.5.2 2023-08-06 12:34:19 +09:30
examples pytest: Highlight the re-entrancy issue for cln-plugin events 2023-04-13 18:13:28 -07:00
grpc-plugin grpc: The plugin needs to use the server feature on cln-grpc 2023-06-01 13:41:21 +09:30
renepay plugins/renepay/test: fix access-after-free. 2023-08-15 05:32:22 +09:30
spender Support p2tr deposit addresses 2023-07-11 11:41:15 +09:30
src Fix: Remove Sync requirements on Futures returned in the Rust plugin library. 2023-08-08 09:45:42 +09:30
test renepay: make pay_plugin a tal object. 2023-08-12 09:41:24 +09:30
.gitignore ignore sql binary plugin 2023-02-08 14:38:58 -06:00
autoclean.c autoclean: allow dynamic changes to autoclean-cycle. 2023-06-20 20:08:25 +09:30
bcli.c plugins: fix error report from bitcoin-cli exec failure. 2023-08-09 19:53:47 +09:30
Cargo.toml rs: Bump version of cln-plugin 2023-06-02 14:47:13 +02:00
chanbackup.c chanbackup: even if they enable experimental-peer-storage, check peers 2023-03-08 18:46:21 -06:00
commando.c commando: pass through commands to lightningd. 2023-07-25 14:47:12 +09:30
fetchinvoice.c listconfigs: show plugin options in 'configs' with normal options. 2023-06-03 10:50:29 +09:30
funder.c funder: don't re-reserve utxos on retries 2023-07-30 15:20:04 +09:30
funder_policy.c libplugin: make set callback for options take plugin ptr, check correct type. 2023-06-20 20:08:25 +09:30
funder_policy.h libplugin: make set callback for options take plugin ptr, check correct type. 2023-06-20 20:08:25 +09:30
keysend.c config: replace accept-htlc-tlv-types with accept-htlc-tlv-type 2023-06-03 10:50:29 +09:30
libplugin-pay.c splicing: Add channel state AWAITING_SPLICE 2023-07-31 21:00:22 +09:30
libplugin-pay.h libplugin/pay: allow shortcut for self-pay. 2023-07-26 06:55:48 +09:30
libplugin.c libplugin: support wildcard subscriptions. 2023-07-13 18:59:37 +09:30
libplugin.h libplugin: support wildcard subscriptions. 2023-07-13 18:59:37 +09:30
Makefile renepay: an experimental payment plugin 2023-07-31 12:58:56 +09:30
offers.c listconfigs: show plugin options in 'configs' with normal options. 2023-06-03 10:50:29 +09:30
offers.h common: update to latest onion message spec. 2022-10-26 11:29:06 +10:30
offers_inv_hook.c lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
offers_inv_hook.h lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
offers_invreq_hook.c offers: fix pay where we are using deprecated apis. 2023-02-03 16:59:51 +01:00
offers_invreq_hook.h offers: create a real blinded path, if necessary. 2022-11-09 15:08:03 +01:00
offers_offer.c offers: enable label for invoicerequest 2023-03-09 06:56:06 -06:00
offers_offer.h lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
pay.c libplugin/pay: allow shortcut for self-pay. 2023-07-26 06:55:48 +09:30
README.md doc: fix wording in plugins/README.md 2020-01-06 12:57:59 +01:00
sql.c libplugin: make set callback for options take plugin ptr, check correct type. 2023-06-20 20:08:25 +09:30
topology.c splicing: Add channel state AWAITING_SPLICE 2023-07-31 21:00:22 +09:30
txprepare.c Support p2tr deposit addresses 2023-07-11 11:41:15 +09:30

Plugin Directory

Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).