Commit Graph
4 Commits
Author SHA1 Message Date
Jing ChenandgVisor bot 659b6e0970 Fix EINTR leakage by correcting type comparison in ConvertIntr.
gVisor leaks `EINTR` to the guest process.

`ConvertIntr` fails to convert hosts's `unix.EINTR`(`unix.Errno`) to
`ERESTARTSYS` due to direct equality check (`==`) against
`ErrInterrupted`(*errors.Error), EINTR leaks to sandboxed process.

Fixed by using `linuxerr.Equals` for type-safe comparison.

Assissted-by: antigravity

Fix #13179

PiperOrigin-RevId: 918823555
2026-05-20 22:02:36 -07:00
Ayush RanjanandgVisor bot 5e4e417885 Remove linuxerr.IsValid and use syserr.IsValid instead.
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: [email protected]
PiperOrigin-RevId: 680021716
2024-09-28 12:34:57 -07:00
Zach KoopmansandgVisor bot 17d151514d [syserr] Move ConvertIntr function to linuxerr package
Move ConverIntr out of syserr package and delete an unused function.

PiperOrigin-RevId: 407676258
2021-11-04 14:55:52 -07:00
Zach KoopmansandgVisor bot 83bf514e27 [syserror] Remove pkg syserror.
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
2021-08-13 17:16:52 -07:00