Skip to content

[backport 3.4] box: fix crash while nil-uuid subscribe request#11633

Merged
sergepetrenko merged 1 commit intorelease/3.4from
backport/release/3.4/11593
Jul 8, 2025
Merged

[backport 3.4] box: fix crash while nil-uuid subscribe request#11633
sergepetrenko merged 1 commit intorelease/3.4from
backport/release/3.4/11593

Conversation

@TarantoolBot
Copy link
Collaborator

@TarantoolBot TarantoolBot commented Jul 4, 2025

(This PR is a backport of #11593 to release/3.4 to a future 3.4.1 release.)


Before this patch a master node could crash when it processed an
anonymous iproto subscribe request which had a nil instance uuid.
The reason of this error is that in box_connect_replica we didn't
throw an error when non-exist replica tried to connect to node. It
led to a situation when the nullified replica object was tried to
dereferenced while iproto subscribe request. Now, we raise an
ER_NIL_UUID error if we get an iproto request with nil instance_uuid.

After this change test_fetch_snapshot_no_uuid and
test_checkpoint_join start fail. The reason of these failures is an
incorrect err.type and err.msg of iproto response when we try to send
an iproto request with nil instance_uuid. Now, these tests are fixed
by changing an err.type and err.msg to appropriate values.

Also we change gh_10155_make_iproto_resistant_to_misusage test because
write_fetch_snapshot wasn't be able to send iproto fetch_snapshot
request with uuid. It led to situation when ER_NIL_UUID error was raised
during fetch_snapshot and as a result we weren't be able to read
snapshot after this. It broke
test_iproto_crash_fetch_snapshot_subscribe and
test_iproto_crash_fetch_snapshot_subscribe_not_anon.

Closes #11531

Before this patch a master node could crash when it processed an
anonymous iproto subscribe request which had a nil instance uuid.
The reason of this error is that in `box_connect_replica` we didn't
throw an error when non-exist replica tried to connect to node. It
led to a situation when the nullified replica object was tried to
dereferenced while iproto subscribe request. Now, we raise an
ER_NIL_UUID error if we get an iproto request with nil `instance_uuid`.

After this change `test_fetch_snapshot_no_uuid` and
`test_checkpoint_join` start fail. The reason of these failures is an
incorrect err.type and err.msg of iproto response when we try to send
an iproto request with nil `instance_uuid`. Now, these tests are fixed
by changing an err.type and err.msg to appropriate values.

Also we change `gh_10155_make_iproto_resistant_to_misusage` test because
`write_fetch_snapshot` wasn't be able to send iproto fetch_snapshot
request with uuid. It led to situation when ER_NIL_UUID error was raised
during fetch_snapshot and as a result we weren't be able to read
snapshot after this. It broke
`test_iproto_crash_fetch_snapshot_subscribe` and
`test_iproto_crash_fetch_snapshot_subscribe_not_anon`.

Closes #11531

NO_DOC=bugfix

(cherry picked from commit 0ba7505)
@TarantoolBot TarantoolBot requested a review from a team as a code owner July 4, 2025 10:23
@TarantoolBot TarantoolBot changed the title [Backport release/3.4] box: fix crash while nil-uuid subscribe request [backport 3.4] box: fix crash while nil-uuid subscribe request Jul 4, 2025
@coveralls
Copy link

Coverage Status

coverage: 87.53% (+0.02%) from 87.51%
when pulling 2ccc5f2 on backport/release/3.4/11593
into a59dd43
on release/3.4
.

@sergepetrenko sergepetrenko merged commit 8a0654a into release/3.4 Jul 8, 2025
25 checks passed
@sergepetrenko sergepetrenko deleted the backport/release/3.4/11593 branch July 8, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants