Projects STRLCPY reverse_ssh Commits 07b8afd6
🤬
  • Ensure gvisor cant panic and kill the program

  • Loading...
  • NHAS committed 2 years ago
    07b8afd6
    1 parent f66056c7
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    internal/client/handlers/tun.go
    skipped 32 lines
    33 33   
    34 34  func Tun(_ *internal.User, newChannel ssh.NewChannel, l logger.Logger) {
    35 35   
     36 + defer func() {
     37 + if r := recover(); r != nil {
     38 + l.Error("Recovered panic from tun driver %v", r)
     39 + }
     40 + }()
     41 + 
    36 42   var tunInfo struct {
    37 43   Mode uint32
    38 44   No uint32
    skipped 340 lines
    379 385   _, err := rawProto.Read(&buff, tcpip.ReadOptions{})
    380 386   
    381 387   if err != nil {
    382  - if _, ok := err.(*tcpip.ErrWouldBlock); ok {
    383  - // Oh, a race condition?
    384  - continue
    385  - } else {
    386  - // This is bad.
    387  - panic(err)
    388  - }
     388 + 
     389 + continue
    389 390   }
    390 391   
    391 392   iph := header.IPv4(buff.Bytes())
    skipped 160 lines
Please wait...
Page is in error, reload to recover