Skip to content

Validate the written chunks when using a seed#214

Merged
folbricht merged 1 commit intofolbricht:masterfrom
RyuzakiKK:validate_written_data
Feb 25, 2022
Merged

Validate the written chunks when using a seed#214
folbricht merged 1 commit intofolbricht:masterfrom
RyuzakiKK:validate_written_data

Conversation

@RyuzakiKK
Copy link
Copy Markdown
Contributor

The seed values are validated at the beginning when we create the
extraction "plan".

However a seed might point to a location where is possible to read and
write data. In that case, even if at the beginning we validated the seed
data, the assumption that when we use WriteInto() the seed data is
still valid might not be true anymore.

For this reason we should also re-validate the written data to ensure
that what ended up in the destination is exactly what we were expecting.

@RyuzakiKK
Copy link
Copy Markdown
Contributor Author

This should have a negligible impact on performance. However if you prefer I can move this additional check under a launch option.

Comment thread assemble.go Outdated
@folbricht
Copy link
Copy Markdown
Owner

I agree that it shouldn't add to much overhead since the data was just written and it should be read back from buffered memory.

The seed values are validated at the beginning when we create the
extraction "plan".

However a seed might point to a location where is possible to read and
write data. In that case, even if at the beginning we validated the seed
data, the assumption that when we use `WriteInto()` the seed data is
still valid might not be true anymore.

For this reason we should also re-validate the written data to ensure
that what ended up in the destination is exactly what we were expecting.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
@RyuzakiKK RyuzakiKK force-pushed the validate_written_data branch from 0f2c999 to 80b0f9c Compare February 25, 2022 21:07
@folbricht folbricht merged commit 16ddd74 into folbricht:master Feb 25, 2022
JeremieA pushed a commit to InSimo/desync that referenced this pull request Apr 10, 2026
The seed values are validated at the beginning when we create the
extraction "plan".

However a seed might point to a location where is possible to read and
write data. In that case, even if at the beginning we validated the seed
data, the assumption that when we use `WriteInto()` the seed data is
still valid might not be true anymore.

For this reason we should also re-validate the written data to ensure
that what ended up in the destination is exactly what we were expecting.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
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.

2 participants