Project

General

Profile

Bug #3909

osmo_get_rand_id() fails in containerised environment

Added by earwin 5 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04/07/2019
Due date:
% Done:

0%

Spec Reference:

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

Related to libosmocore - Feature #2610: optimize GnuTLS fallbackNew11/02/2017

History

#1 Updated by ipse 4 months 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.

#2 Updated by laforge 3 months ago

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)