google / gvisor

Application Kernel for Containers

Home Page:https://gvisor.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong len in FUSEHeaderIn when sending write request with a payload

YaroslavLitvinov opened this issue · comments

Description

When sending FUSEHeaderIn request with a FUSE_WRITE data containing a payload, current implementation of fuse in gvisor incorrectly calculates FUSEHeaderIn.Len field, taking into account a fixed size of marshaled data structure only, which is - payload.SizeBytes(), and not using here size of actual payload, though sending it.

For instance: When writing 100 bytes file, the overall packet length should be 40 + 40 + 100, where 40 is the size of FUSEHeaderIn, 40 - FUSEWriteIn, 100 - file size, and not just 80 bytes as currently.

It looks to me that the test/fuse/linux/write_test.cc test is testing exactly this behavior.

This leads to errors related to receiving excessive data on server side when it attempts to read that data.

Point me if I am wrong.

Steps to reproduce

No response

runsc version

No response

docker version (if using docker)

No response

uname

No response

kubectl (if using Kubernetes)

No response

repo state (if built from source)

No response

runsc debug logs (if available)

No response

@avagin Hi again, I'm not sure if fuse support is any priority. But if so, what's the supposed write support next steps?

A friendly reminder that this issue had no activity for 120 days.

@avagin seems like you already have a fix for this? Do you want to rebase & merge that?