Bug 1172273 - getrandom call missing in glibc
Summary: getrandom call missing in glibc
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Weimer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1253474 (view as bug list)
Depends On:
Blocks: rhel7-getrandom
TreeView+ depends on / blocked
 
Reported: 2014-12-09 18:36 UTC by Corinna Vinschen
Modified: 2018-04-11 12:26 UTC (History)
16 users (show)

Fixed In Version: glibc-2.24.90-23.fc26
Clone Of:
: rhel7-getrandom (view as bug list)
Environment:
Last Closed: 2016-12-13 11:55:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1326218 1 None None None 2021-01-20 06:05:38 UTC
Sourceware 17252 0 None None None Never

Internal Links: 1326218

Description Corinna Vinschen 2014-12-09 18:36:06 UTC
Description of problem:

  Now that the kernel exports the getrandom syscall, it would be helpful
  if glibc provides a getrandom library call and a matching prototype,
  preferredly in unistd.h, just like in case of getentropy on OpenBSD.

Additional info:

  Having the prototype in a non-Linux specific header would be most
  important for compatibility reasons:  As Cygwin maintainer I'd like
  to provide the call in a fully compatible way on the C library level.
  Providing the prototype in an OS-specific header only would disallow
  this.  A _GNU_SOURCE guard would be ok, though.


Thanks,
Corinna

Comment 1 Carlos O'Donell 2014-12-09 19:22:08 UTC
Thanks for this report. We will have to take this upstream and make sure we do it there, then the next rawhide pull from upstream will include the fix.

Can you give me a little more information? Which kernel version and commit adds the new support? Is it in a stable kernel?

Comment 2 Corinna Vinschen 2014-12-09 19:38:38 UTC
Hi Carlos,

the call has been added by Theodore Ts'o:

http://lists.openwall.net/linux-kernel/2014/07/17/235

It has been added to the 3.17 kernel, and thus is available in
current F20:

$ uname -svr
Linux 3.17.2-200.fc20.x86_64 #1 SMP Tue Nov 4 18:04:56 UTC 2014
$ grep -r getrandom /usr/include
/usr/include/asm-generic/unistd.h:#define __NR_getrandom 278
/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_getrandom, sys_getrandom)
/usr/include/linux/random.h: * Flags for getrandom(2)
/usr/include/asm/unistd_64.h:#define __NR_getrandom 318
/usr/include/asm/unistd_32.h:#define __NR_getrandom 355
/usr/include/asm/unistd_x32.h:#define __NR_getrandom (__X32_SYSCALL_BIT + 318)

If I may add the suggestion that, from a compatibility POV, it would
make sense to add the OpenBSD getentropy call as well.  It's just a
call to the getrandom syscall with 0 flags anyway.


Thanks,
Corinna

Comment 3 Siddhesh Poyarekar 2014-12-10 06:58:06 UTC
Added upstream bug report for reference.

Comment 4 Jaroslav Reznik 2015-03-03 16:35:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 5 Nikos Mavrogiannopoulos 2015-08-13 19:55:05 UTC
*** Bug 1253474 has been marked as a duplicate of this bug. ***

Comment 6 Nikos Mavrogiannopoulos 2015-08-14 08:23:30 UTC
Is there any blocker for this inclusion? As I mentioned in #1253474 that is a very good addition for Fedora (and glibc in general).

Comment 7 Carlos O'Donell 2015-08-14 14:47:05 UTC
(In reply to Nikos Mavrogiannopoulos from comment #6)
> Is there any blocker for this inclusion? As I mentioned in #1253474 that is
> a very good addition for Fedora (and glibc in general).

The blocker is that this is a global API addition that could make Fedora incompatible with every other distribution. We want this to go upstream first. I'm setting devel_cond_nak/upstream to indicate that this needs to go upstream. It can remain open here to track the upstream fix.

I've reiterated in upstream what I believe the right solution would be:
https://sourceware.org/ml/libc-alpha/2015-08/msg00576.html

Comment 8 Nikos Mavrogiannopoulos 2015-08-14 14:58:25 UTC
Sounds reasonable. Thanks.

Comment 9 Jan Kurik 2016-02-24 13:17:49 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 15 Jan Kurik 2016-07-26 04:08:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 16 George R. Goffe 2017-02-06 07:05:06 UTC
Hi,

I've been running a fc25-rawhide (fc26) system and have started seeing these messages.

Fatal: [  110.329306] traps: init[1] general protection ip:7f49c784f352 sp:7ffc6cd8dd70 error:0no entropy gathe[  110.765476]  in libc-2.24.90.so[7f49c7817000+1c3000]

Could this be related to this bug? I see libc-2.24.90 in the message.

"my" bug report is [Bug 1419432] New: kernel panic " general protection no entropy gathe libc-2.24.90.so

Thanks,

George...

Comment 17 Florian Weimer 2017-02-06 07:41:05 UTC
(In reply to George R. Goffe from comment #16)
> Could this be related to this bug? I see libc-2.24.90 in the message.
> 
> "my" bug report is [Bug 1419432] New: kernel panic " general protection no
> entropy gathe libc-2.24.90.so

It's unrelated.  I commented on the other bug.


Note You need to log in before you can comment on or make changes to this bug.