mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix syzkaller panic for unknown error 58.
The errno 58 is not defined and it is the same as deadlock error. Update this in the host_linux.go file. Reported-by: syzbot+60bb099bed4694a37f61@syzkaller.appspotmail.com PiperOrigin-RevId: 667762290
This commit is contained in:
committed by
gVisor bot
parent
ccc5642b1d
commit
9ecb627726
@@ -185,6 +185,19 @@ type connection struct {
|
||||
noOpen bool
|
||||
}
|
||||
|
||||
func connError(err error) error {
|
||||
errno, ok := linuxerr.TranslateError(err)
|
||||
if !ok {
|
||||
log.Warningf("fuse: failed with invalid error: %v", err)
|
||||
return linuxerr.EINVAL
|
||||
}
|
||||
if !linuxerr.IsValid(linuxerr.ToUnix(errno)) {
|
||||
log.Warningf("fuse: failed with invalid error: %v", err)
|
||||
return linuxerr.EINVAL
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (conn *connection) saveInitializedChan() bool {
|
||||
select {
|
||||
case <-conn.initializedChan:
|
||||
@@ -255,7 +268,7 @@ func (conn *connection) Call(ctx context.Context, r *Request) (*Response, error)
|
||||
// Block requests sent before connection is initialized.
|
||||
if !conn.Initialized() && r.hdr.Opcode != linux.FUSE_INIT {
|
||||
if err := ctx.Block(conn.initializedChan); err != nil {
|
||||
return nil, err
|
||||
return nil, connError(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,10 +291,15 @@ func (conn *connection) Call(ctx context.Context, r *Request) (*Response, error)
|
||||
fut, err := conn.callFuture(ctx, r)
|
||||
conn.fd.mu.Unlock()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, connError(err)
|
||||
}
|
||||
|
||||
return fut.resolve(ctx)
|
||||
var res *Response
|
||||
res, err = fut.resolve(ctx)
|
||||
if err != nil {
|
||||
return res, connError(err)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// callFuture makes a request to the server and returns a future response.
|
||||
|
||||
Reference in New Issue
Block a user