Bug #3909
openosmo_get_rand_id() fails in containerised environment
0%
Description
In some cases, when running newer libc over an older kernel, the getrandom() call returns ENOSYS
https://github.com/osmocom/libosmocore/blob/master/src/gsm/gsm_utils.c#L456
Given that ENOSYS is a valid retval, there's a multitude of fallback schemes for getting randomness.
E.g.: https://github.com/vapor-community/clibressl/blob/master/Sources/CLibreSSL/getentropy_linux.c
Related issues
Updated by ipse over 4 years ago
To give some context, we found that the current osmo_get_rand_id()
behavior breaks OsmoMGW and OsmoMSC when running in a container when the host system runs an older kernel version. In general, it looks wrong to assume that a newer libc
always comes with a newer kernel..
As a side note, the osmo_get_rand_id()
failure in OsmoMGW was a bit hard to trace - OsmoMGW didn't provide any meaningful log message, just silently rejected all requests. It took us a while to figure out (using strace
) that the reason is in the getrandom()
returning ENOSYS
.
Updated by laforge over 4 years ago
- Related to Feature #2610: optimize GnuTLS fallback added