mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Replace TaskFromContext(ctx).Kernel() with KernelFromContext(ctx)
Panic seen at some code path like control.ExecAsync where ctx does not have a Task. Reported-by: syzbot+55ce727161cf94a7b7d6@syzkaller.appspotmail.com PiperOrigin-RevId: 355960596
This commit is contained in:
@@ -79,8 +79,7 @@ func NewVFS2(t *kernel.Task, family int, skType linux.SockType, protocol int, qu
|
||||
|
||||
// Release implements vfs.FileDescriptionImpl.Release.
|
||||
func (s *SocketVFS2) Release(ctx context.Context) {
|
||||
t := kernel.TaskFromContext(ctx)
|
||||
t.Kernel().DeleteSocketVFS2(&s.vfsfd)
|
||||
kernel.KernelFromContext(ctx).DeleteSocketVFS2(&s.vfsfd)
|
||||
s.socketOpsCommon.Release(ctx)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user