sd-netlink: fix possible use-after-free
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 24 Nov 2022 18:36:39 +0000 (03:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 26 Nov 2022 02:28:27 +0000 (11:28 +0900)
commitbc1a8e2b6ea5477fb662f032f0ac553f319b711e
treef0e85a66cef49671af828fa55723539da1dc729e
parentb491454dfc5d8081ef429af1d1a01aed0b83bd25
sd-netlink: fix possible use-after-free

When we receive a multi-part message and fail to parse it, then
the prviously received message is freed with the _cleanup_ attribute,
but still referenced by sd_netlink.rqueue_partial. That causes
use-after-free when we receive another multi-part message.
src/libsystemd/sd-netlink/netlink-socket.c