Skip to content

Commit 412c349

Browse files
committed
crypto/rand: early return from disable_getrandom when fallbacks are used
1 parent 0a0020e commit 412c349

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/crypto/internal/sysrand/internal/seccomp/seccomp_linux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ struct seccomp_data {
5858
#endif
5959
6060
int disable_getrandom() {
61+
if (SYS_getrandom == -1 || SYS_seccomp == -1) {
62+
return 3;
63+
}
6164
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {
6265
return 1;
6366
}

0 commit comments

Comments
 (0)