Project

General

Profile

Actions

Bug #3909

open

osmo_get_rand_id() fails in containerised environment

Added by earwin almost 5 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
libosmocore
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

Actions
Actions #1

Updated by ipse almost 5 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.

Actions #2

Updated by laforge almost 5 years ago

Actions #3

Updated by laforge almost 3 years ago

  • Category set to libosmocore
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)