Skip to content

Commit 7532ec0

Browse files
ayushr2manninglucas
authored andcommitted
Fix: Check for errors in FUSE Readlink response.
The `fuse.Conn.Call` method can return a `fuse.Response` containing an error, which needs to be checked via `res.Error()` before accessing the response data. Reported-by: syzbot+5e1585f8a22c6e82884b@syzkaller.appspotmail.com Co-authored-by: Lucas Manning <lucasmanning@google.com> PiperOrigin-RevId: 824748103
1 parent a2af0ea commit 7532ec0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/sentry/fsimpl/fuse/inode.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ func (i *inode) Readlink(ctx context.Context, mnt *vfs.Mount) (string, error) {
601601
if err != nil {
602602
return "", err
603603
}
604+
if err := res.Error(); err != nil {
605+
return "", err
606+
}
604607
i.link = string(res.data[res.hdr.SizeBytes():])
605608
if !mnt.Options().ReadOnly {
606609
i.attrTime = ktime.ZeroTime

0 commit comments

Comments
 (0)