unix.Errno is of type `uintptr`, which is an unsigned integer. It was being
casted to `int`, which is a signed integer of the same size. This cast could
overflow due to unsigned -> signed.
Reported-by: syzbot+08e5bf6f25d7db4316b9@syzkaller.appspotmail.com
PiperOrigin-RevId: 680668525
linuxerr.IsValid just checks if the errno is less than the max possible errno
value. syserr.IsValid additionally checks if the errno can be translated by the
syserr package.
Furthermore, drop the usage of linuxerr.TranslateError(), which only checks
against a map with 3 entries of sentry-internal errors. Earlier, connError()
would always fail at this step and end up returning linuxerr.EINVAL even if the
errno being returned is valid.
Reported-by: syzbot+180b8537798c091bf9fd@syzkaller.appspotmail.com
PiperOrigin-RevId: 680021716
Some hosts use iptables and are configured to respond an ICMP destination
unreachable message with a {host/net/admin}prohibited code instead of a RST.
Linux handles these codes correctly by aborting the handshake. This commit
adds handling of all possible codes of an ICMPv4 destination unreachable message
to bring gVisor to parity.
PiperOrigin-RevId: 496703813
ErrNoRoute gets translated to EHOSTUNREACH which causes some code paths to
produce different errors unexpectedly. Rename the error so we can clean up some
sites to return ENETUNREACH more clearly where needed.
Updates #8105
PiperOrigin-RevId: 482355099
This change implements AddMulticastRoute and the requisite routing logic.
Subsequent changes will still be needed to:
1. Emit events for missing route or unexpected input interface
2. Implement DelRoute
3. Implement GetRouteStats
Updates #7338.
PiperOrigin-RevId: 451026594
- Stub out sighandling functions with panics on Darwin
- Put Linux-specific errors into their own syserr file
Not sure how best to get automated tests running, so I'll leave that for a later
change.
Fixes#6839.
Related to #1270.
PiperOrigin-RevId: 409516969
Fix syzcaller panic SIGBUS on error handling. Done by
adding an interface, errors.GuestError, which errors can
implement in order to be compared against each other.
PiperOrigin-RevId: 393867554
Removes package syserror and moves still relevant code to either linuxerr
or to syserr (to be later removed).
Internal errors are converted from random types to *errors.Error types used
in linuxerr. Internal errors are in linuxerr/internal.go.
PiperOrigin-RevId: 390724202
Remove three syserror entries duplicated in linuxerr. Because of the
linuxerr.Equals method, this is a mere change of return values from
syserror to linuxerr definitions.
Done with only these three errnos as CLs removing all grow to a significantly
large size.
PiperOrigin-RevId: 382173835
Add Equals method to compare syserror and unix.Errno errors to linuxerr errors.
This will facilitate removal of syserror definitions in a followup, and
finding needed conversions from unix.Errno to linuxerr.
PiperOrigin-RevId: 380909667