Skip to content

sn/storage: Fix payload overflow in combined FSTree.Get()#3801

Open
cthulhu-rider wants to merge 1 commit intomasterfrom
fstree-combined-get
Open

sn/storage: Fix payload overflow in combined FSTree.Get()#3801
cthulhu-rider wants to merge 1 commit intomasterfrom
fstree-combined-get

Conversation

@cthulhu-rider
Copy link
Contributor

@cthulhu-rider cthulhu-rider commented Feb 4, 2026

i did not try to reproduce this on a cluster. For example, it might show up with

err := c.storage.PutBatch(objs)

@cthulhu-rider cthulhu-rider added bug Something isn't working neofs-storage Storage node application issues labels Feb 4, 2026
To avoid exceeding the payload's boundaries, all callers would have to
perform checks on their side. Although it's more natural to just read
until EOF, and this is what's happening now.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.57%. Comparing base (58f146c) to head (5908cc2).

Files with missing lines Patch % Lines
pkg/local_object_storage/blobstor/fstree/head.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3801   +/-   ##
=======================================
  Coverage   25.57%   25.57%           
=======================================
  Files         660      660           
  Lines       42663    42672    +9     
=======================================
+ Hits        10909    10912    +3     
- Misses      30750    30753    +3     
- Partials     1004     1007    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cthulhu-rider cthulhu-rider marked this pull request as ready for review February 4, 2026 10:04
@roman-khimov roman-khimov added this to the v0.51.1 milestone Feb 4, 2026

if combined {
if full := obj.PayloadSize(); full > uint64(len(payloadPrefix)) {
rem := full - uint64(len(payloadPrefix))
Copy link
Contributor Author

@cthulhu-rider cthulhu-rider Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also use the length tag from the combined file as the limit, it is read anyway. This would also work when the actual and in-header payload lengths differ. In practice, such objects should not be

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an additional argument can be #3783 and movement towards FSTree abstraction from the object structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working neofs-storage Storage node application issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants