Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>, gorcunov@gmail.com
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] relay: fix use after free in subscribe_f
Date: Wed, 12 May 2021 22:25:59 +0200	[thread overview]
Message-ID: <e1c915fa-2086-72d6-e11b-9b0736017d82@tarantool.org> (raw)
In-Reply-To: <20210512113907.12968-1-sergepetrenko@tarantool.org>

Hi! Thanks for the patch!

> diff --git a/src/box/relay.cc b/src/box/relay.cc
> index ff43c2fc7..32d3a58dd 100644
> --- a/src/box/relay.cc
> +++ b/src/box/relay.cc
> @@ -756,6 +755,8 @@ relay_subscribe_f(va_list ap)
>  	if (!relay->replica->anon)
>  		relay_send_is_raft_enabled(relay, &raft_enabler, true);
>  
> +	struct recovery *r = relay->r;
> +

There is another cbus_process() on line 808. Won't it lead to the same issue
if recovery would be restarted? I see it is for version < 1.7.4 so probably
not. Another option would be to simply inline relay->r in its usage places
and not remember it into a variable.

Anyway LGTM. Up to you if want to inline.

  parent reply	other threads:[~2021-05-12 20:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 11:39 Serge Petrenko via Tarantool-patches
2021-05-12 11:48 ` Cyrill Gorcunov via Tarantool-patches
2021-05-13 10:36   ` Serge Petrenko via Tarantool-patches
2021-05-12 20:25 ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-05-13 10:34   ` Serge Petrenko via Tarantool-patches
2021-05-13 11:23     ` Vladislav Shpilevoy via Tarantool-patches
2021-05-13 11:44     ` Cyrill Gorcunov via Tarantool-patches
2021-05-14  7:44 ` Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1c915fa-2086-72d6-e11b-9b0736017d82@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] relay: fix use after free in subscribe_f' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox