Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SIGSEGV in S3StorageInteractor.ListPath. #66

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

ostinru
Copy link
Contributor

@ostinru ostinru commented Oct 12, 2024

When source S3 bucket have been deleted we receive SignatureDoesNotMatch error when trying to list objects in bucket. This error wasn't handled properly, so it lead to nil-reference dereference in next line:

list error: SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
        status code: 403, request id: <edited>, host id:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb60386]
goroutine 40 [running]:
github.com/yezzey-gp/yproxy/pkg/storage.(*S3StorageInteractor).ListPath(0xc0004a2330, {0xc00003cc00, 0x2a})
        /root/build/yproxy/pkg/storage/s3storage.go:153 +0x2a6
github.com/yezzey-gp/yproxy/pkg/proc.ProcConn({0x10c9da0?, 0xc0004a2840}, {0x10c1f28?, 0xc0004921c0}, {0x10cb598, 0xc0004a2000})
        /root/build/yproxy/pkg/proc/interaction.go:286 +0xe62
github.com/yezzey-gp/yproxy/pkg/core.(*Instance).Run.func3({0x10cb820?, 0xc000066068})
        /root/build/yproxy/pkg/core/core.go:137 +0x147
created by github.com/yezzey-gp/yproxy/pkg/core.(*Instance).DispatchServer.func1 in goroutine 7
        /root/build/yproxy/pkg/core/core.go:44 +0x198

Also, yp-client showed failed to read params: EOF to client.

With this patch:
Server: no errors
Client: Error: message too big 7377293578888028276

When source S3 bucket have been deleted we receive SignatureDoesNotMatch error when trying to
list objects in bucket. This error wasn't handled properly, so it lead to nil-reference dereference
in next line. (Also, yp-client showed `failed to read params: EOF` to client)
@ostinru
Copy link
Contributor Author

ostinru commented Oct 12, 2024

Error handling is not working in yproxy... should be redesigned =/

@reshke reshke merged commit 7d2f8d6 into open-gpdb:master Oct 14, 2024
1 check passed
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